POST https://sandbox.payme.io/api/get-buyer-keyPOST https://live.payme.io/api/get-buyer-keyseller_payme_id (required): Our unique seller ID.This API endpoint will allow you to get the buyer-key created and used to pay for a certain payment request in our system.
Once a new authorization request is created and the buyer is approved, a new buyer key is generated behind the scenes and can be obtained using this API endpoint.
This endpoint takes no path, query or header parameters.
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
payme_sale_id |
string | yes | Our unique sale ID. |
seller_payme_id |
string | yes | Our unique seller ID. |
{
"payme_sale_id": "SALE1686-XXXXXXXX-XXXXXXXX-XXXXXXXX",
"seller_payme_id": "MPL16852-XXXXXXXX-XXXXXXXX-XXXXXXXX"
}
curl -X POST 'https://sandbox.payme.io/api/get-buyer-key' \
-H 'Content-Type: application/json' \
--data-raw '{
"payme_sale_id": "SALE1686-XXXXXXXX-XXXXXXXX-XXXXXXXX",
"seller_payme_id": "MPL16852-XXXXXXXX-XXXXXXXX-XXXXXXXX"
}'
const response = await fetch("https://sandbox.payme.io/api/get-buyer-key", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"payme_sale_id": "SALE1686-XXXXXXXX-XXXXXXXX-XXXXXXXX",
"seller_payme_id": "MPL16852-XXXXXXXX-XXXXXXXX-XXXXXXXX"
}),
});
console.log(await response.text());
import requests
response = requests.post(
"https://sandbox.payme.io/api/get-buyer-key",
json={
"payme_sale_id": "SALE1686-XXXXXXXX-XXXXXXXX-XXXXXXXX",
"seller_payme_id": "MPL16852-XXXXXXXX-XXXXXXXX-XXXXXXXX",
},
)
print(response.text)
<?php
$body = <<<'BODY'
{
"payme_sale_id": "SALE1686-XXXXXXXX-XXXXXXXX-XXXXXXXX",
"seller_payme_id": "MPL16852-XXXXXXXX-XXXXXXXX-XXXXXXXX"
}
BODY;
$ch = curl_init('https://sandbox.payme.io/api/get-buyer-key');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
| Field | Type | Description |
|---|---|---|
payme_sale_id |
string | Our unique sale ID. |
buyer_key |
string | Buyer's unique token. |
buyer_card_mask |
string | Buyer's card mask. |
buyer_card_expiry |
string | Buyer's card exp (MMYY). |
buyer_card_brand |
string | Buyer's card brand. |
status_code |
string |
{
"payme_sale_id": "MPL16861-35251ZB5-PLVPEMCW-ZUAQJBQO",
"buyer_key": "BUYER166-5640185F-UFEKYAYD-WLJSO6QS",
"buyer_card_mask": "532610******5846",
"buyer_card_expiry": "0426",
"buyer_card_brand": "099474924",
"buyer_is_permanent": null,
"status_code": null
}
| Field | Type | Description |
|---|---|---|
status_code |
integer | |
status_error_details |
string | |
status_additional_info |
string | |
status_error_code |
integer | |
session |
string |
{
"status_code": 1,
"status_error_details": "Buyer not found",
"status_additional_info": "No Buyer for Sale",
"status_error_code": 600,
"session": "St4K2Azk"
}