Get a customer
- 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 <token>
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 <auth_token>, the token from POST /auth-tokens. Hosts, tokens and the error format: Hosts, authentication and errors.
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
curl -X GET 'https://payme-store-staging.payme.io/api/customers/<guid>' \
-H 'Authorization: Bearer <YOUR_TOKEN>'
Node.js
const response = await fetch("https://payme-store-staging.payme.io/api/customers/<guid>", {
method: "GET",
headers: {
"Authorization": "Bearer <YOUR_TOKEN>",
},
});
console.log(await response.text());
Python
import requests
response = requests.get(
"https://payme-store-staging.payme.io/api/customers/<guid>",
headers={
"Authorization": "Bearer <YOUR_TOKEN>",
},
)
print(response.text)
PHP
<?php
$ch = curl_init('https://payme-store-staging.payme.io/api/customers/<guid>');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <YOUR_TOKEN>',
],
]);
$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. |
{
"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. |
{
"status_error_details": "Validation failed (uuid is expected)",
"status_error_code": 999,
"session": "f3a1c2b0-9e4d-11ef-8c1a-0242ac120002"
}
| 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. |
{
"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. |
{
"status_error_details": "Customer not found",
"status_error_code": 999,
"session": "f3a1c2b0-9e4d-11ef-8c1a-0242ac120002"
}
| 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. |