# Get a customer Building with an AI agent? Start at https://docs.payme.io/agents.md - Sandbox: `GET https://payme-store-staging.payme.io/api/customers/{guid}` - Production: `GET https://payme-store.payme.io/api/customers/{guid}` ## Credentials - Header `Authorization: Bearer ` Returns one of the seller's customers by its `guid`. A customer that doesn't exist, was deleted or belongs to another seller returns `404`. Send `Authorization: Bearer `, the token from [`POST /auth-tokens`](/products-and-customers/authentication/post-auth-token). Hosts, tokens and the error format: [Hosts, authentication and errors](/products-and-customers/authentication). ## Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `guid` | path | string | yes | The customer `guid` (a UUID) that `POST /customers` returned. Any other format returns `400`. | ## Code samples ### curl ```bash curl -X GET 'https://payme-store-staging.payme.io/api/customers/' \ -H 'Authorization: Bearer ' ``` ### Node.js ```javascript const response = await fetch("https://payme-store-staging.payme.io/api/customers/", { method: "GET", headers: { "Authorization": "Bearer ", }, }); console.log(await response.text()); ``` ### Python ```python import requests response = requests.get( "https://payme-store-staging.payme.io/api/customers/", headers={ "Authorization": "Bearer ", }, ) print(response.text) ``` ### PHP ```php '); curl_setopt_array($ch, [ CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ', ], ]); $response = curl_exec($ch); curl_close($ch); echo $response; ``` ## Responses ### 200 — The customer. (success) | Field | Type | Description | | --- | --- | --- | | `guid` | string | Customer id (a UUID) assigned by PayMe. Use it in `/customers/{guid}`. | | `first_name` | string | First name. | | `middle_name` | string | Middle name. | | `last_name` | string | Last name. | | `email` | string | Email address. | | `phone_number` | string | Main phone number. You send it as `phone`. | | `additional_phone_number` | string | Second phone number. You send it as `additional_phone`. | | `address` | object | Postal address. You send these fields at the top level of the request. | | `address.country` | string | Country. | | `address.city` | string | City. | | `address.street` | string | Street. | | `address.building_number` | string | Building number, e.g. `12A`. | | `address.floor` | string | Floor. | | `address.zip` | string | Postal code. | | `company_name` | string | Company name. | | `description` | string | Your note about the customer. | | `birthday` | string | Date of birth, `YYYY-MM-DD`. | | `status` | integer | `0` – inactive, `1` – active, `2` – draft. | | `payment_tokens` | array | The customer's saved payment tokens. | | `payment_tokens[].token` | string | A payment token you saved for the customer. | | `payment_tokens[].token_data` | string | The JSON string you saved with the token, e.g. the card mask and brand. | ```json { "guid": "6c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f", "first_name": "Dana", "middle_name": null, "last_name": "Levi", "email": "dana@example.com", "phone_number": "0501234567", "additional_phone_number": null, "address": { "country": "Israel", "city": "Tel Aviv", "street": "Rothschild", "building_number": "12A", "floor": "3", "zip": "6688101" }, "company_name": "Example Ltd", "description": "Prefers email contact", "birthday": "1990-05-17", "status": 1, "payment_tokens": [ { "token": "8f3a2c1d9e7b4a60", "token_data": "{\"card_mask\":\"4580 **** **** 0000\",\"card_brand\":\"visa\"}" } ] } ``` ### 400 — `guid` isn't a UUID. (error) | Field | Type | Description | | --- | --- | --- | | `status_error_details` | string | What went wrong. | | `status_error_code` | integer | `999`. | | `session` | string | Trace id of the request. Quote it when you contact PayMe support. | ```json { "status_error_details": "Validation failed (uuid is expected)", "status_error_code": 999, "session": "f3a1c2b0-9e4d-11ef-8c1a-0242ac120002" } ``` ### 401 — The `Authorization` header is missing, or the access token is invalid or expired. Get a new token with `POST /refresh-exchanges` or `POST /auth-tokens`. (error) | Field | Type | Description | | --- | --- | --- | | `status_error_details` | string | What went wrong. | | `status_error_code` | integer | `999`. | | `session` | string | Trace id of the request. Quote it when you contact PayMe support. | ```json { "status_error_details": "Unauthorized", "status_error_code": 999, "session": "f3a1c2b0-9e4d-11ef-8c1a-0242ac120002" } ``` ### 404 — The customer doesn't exist, was deleted, or belongs to another seller. (error) | Field | Type | Description | | --- | --- | --- | | `status_error_details` | string | What went wrong. | | `status_error_code` | integer | `999`. | | `session` | string | Trace id of the request. Quote it when you contact PayMe support. | ```json { "status_error_details": "Customer not found", "status_error_code": 999, "session": "f3a1c2b0-9e4d-11ef-8c1a-0242ac120002" } ``` ### 500 — Server error. Contact PayMe support and quote the `session`. (error) | Field | Type | Description | | --- | --- | --- | | `status_error_details` | string | What went wrong. | | `status_error_code` | integer | `999`. | | `session` | string | Trace id of the request. Quote it when you contact PayMe support. |