# List previous recipients Building with an AI agent? Start at https://docs.payme.io/agents.md - Sandbox: `GET https://sandbox.payme.io/api/payment-contracts/recipients` - Production: `GET https://live.payme.io/api/payment-contracts/recipients` ## Credentials - Header `PayMe-Merchant-Key` (API key) Lists the recipients of this seller's earlier contracts that are registered PayMe sellers, so you can create a new contract for them without typing their details again. Authenticate with the initiator's MPL in the `PayMe-Merchant-Key` header. - PayMe returns one entry per recipient seller account linked to any of your contracts, whatever the contract's status, as long as that account is active. - `name`, `phone`, `email` and `business_code` are the details you sent on your most recent contract with that recipient that included an `email`. They are not the recipient's registered details. A recipient you never sent an `email` for isn't listed. - To pay a listed recipient, send its `seller_payme_id_checksum` as `recipient.payme_id` in [Create a payment contract](/b2b-payments/contracts/post-user), with no other `recipient` field. - The result isn't paginated: `page` is always `1`, and `items_per_page` and `items_total` both equal the number of items. ### Errors HTTP status | Error code | Message | When ---|---|---|--- `500` | `1` | Required parameter is missing | The `PayMe-Merchant-Key` header is missing. `status_additional_info` is `payme_client_key`. `500` | `251` | Seller was not found | The seller key is unknown. `500` | `163` | Account settings problem - please contact Customer Support | The seller is not active. ## Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `PayMe-Merchant-Key` | header | string | yes | The initiator's `seller_payme_id` (MPL). | ## Code samples ### curl ```bash curl -X GET 'https://sandbox.payme.io/api/payment-contracts/recipients' \ -H 'PayMe-Merchant-Key: ' ``` ### Node.js ```javascript const response = await fetch("https://sandbox.payme.io/api/payment-contracts/recipients", { method: "GET", headers: { "PayMe-Merchant-Key": "", }, }); console.log(await response.text()); ``` ### Python ```python import requests response = requests.get( "https://sandbox.payme.io/api/payment-contracts/recipients", headers={ "PayMe-Merchant-Key": "", }, ) print(response.text) ``` ### PHP ```php 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'PayMe-Merchant-Key: ', ], ]); $response = curl_exec($ch); curl_close($ch); echo $response; ``` ## Responses ### 200 — Your previous recipients. An empty `items` array if there are none. (success) | Field | Type | Description | | --- | --- | --- | | `status_code` | integer | `0` on success. | | `session` | string | PayMe session ID. Quote it when you contact PayMe support. | | `page` | integer | Always `1`. | | `items_per_page` | integer | The number of items. | | `items_total` | integer | The number of items. | | `items` | array | One entry per recipient seller account. | | `items[].name` | string | The recipient name you sent. `null` if you didn't send one. | | `items[].phone` | string | The phone number you sent. `null` if you didn't send one. | | `items[].business_code` | integer | The business number you sent, as sent: a number, or a string if you sent a string. `null` if you didn't send one. | | `items[].email` | string | The email address you sent. | | `items[].seller_payme_id_checksum` | string | An encrypted reference to the recipient's seller account. Send it as `recipient.payme_id` when you create a contract. Treat it as opaque: it differs on every call, and every value works. | ```json { "status_code": 0, "session": "FhT3aXe7", "page": 1, "items_per_page": 2, "items_total": 2, "items": [ { "name": "Example Supplies Ltd", "phone": "0500000001", "business_code": 515555555, "email": "supplier@example.com", "seller_payme_id_checksum": "eyJpdiI6IkV4YW1wbGVJVjAwMDAwMDAwMDAwPT0iLCJ2YWx1ZSI6IkV4YW1wbGUxIn0=" }, { "name": null, "phone": null, "business_code": 516666666, "email": "billing@example.com", "seller_payme_id_checksum": "eyJpdiI6IkV4YW1wbGVJVjExMTExMTExMTExPT0iLCJ2YWx1ZSI6IkV4YW1wbGUyIn0=" } ] } ``` ### 500 — A missing, unknown or inactive seller key. (error) | Field | Type | Description | | --- | --- | --- | | `status_code` | integer | `1` on failure. | | `status_error_details` | string | The error message. | | `status_additional_info` | string | More detail, such as the field or value that failed. | | `status_error_code` | integer | PayMe error code. See the error table above. | | `session` | string | PayMe session ID. Quote it when you contact PayMe support. | ```json { "status_code": 1, "status_error_details": "Required parameter is missing", "status_additional_info": "payme_client_key", "status_error_code": 1, "session": "FhT3aXe7" } ```