Upload seller files
- Sandbox:
POST https://sandbox.payme.io/api/upload-seller-files - Production:
POST https://live.payme.io/api/upload-seller-files
Credentials
- Request body field
payme_client_key(required): Your partner key. - Request body field
seller_payme_id(optional): The seller's MPL. Required unless you sendseller_id.
Uploads KYC documents for one of your sellers, such as an ID card or a bank account confirmation. Partners only: send your payme_client_key and the seller's seller_payme_id (or your own seller_id for the seller). Send one file or several in seller_files. Each file is either a public url that PayMe downloads, or the file content in base64.
Set each file's type from File types. Types 90–97 are personal documents. They are attached to the seller's primary individual, and the call fails with error 184 if the seller has more than one individual. All other types are attached to the seller.
Allowed extensions: pdf, jpg, jpeg, jfif, png, bmp, tif, tiff, doc, docx, and mp4, avi, mov, webm for video (used for the face-to-face video, type 97). Allowed MIME types include application/pdf, image/jpeg, image/png, image/heic, image/tiff, application/msword, video/mp4 and video/quicktime.
Errors
Every error returns status_code 1 with the code in status_error_code.
| Code | When |
|---|---|
1 |
seller_files is missing or empty (HTTP 400), or a file has neither url nor base64. |
20 |
A file's type is missing or not an integer (HTTP 400), or isn't a known file type. |
184 |
A personal document (types 90–97) was sent for a seller with more than one individual. |
904 |
The file extension isn't allowed. |
905 |
The mime_type isn't allowed. |
909 |
PayMe can't read the file. |
The full list is on Errors.
Parameters
This endpoint takes no path, query or header parameters.
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
payme_client_key |
string | yes | Your partner key. |
seller_payme_id |
string | no | The seller's MPL. Required unless you send seller_id. |
seller_id |
string | no | Your own ID for the seller, as sent on Create a seller. Use it instead of seller_payme_id. |
seller_files |
array | yes | The files to upload, at least one. |
seller_files[].type |
integer | yes | Document type code, see File types. Missing or not an integer returns error 20. |
seller_files[].url |
string | no | Public URL of the file. Send url or base64. |
seller_files[].base64 |
string | no | The file content, base64-encoded. A data:<mime>;base64, prefix is allowed and sets the MIME type. Send url or base64. |
seller_files[].name |
string | no | File name with extension, for example id.pdf. If you omit it, PayMe names the file from its MIME type. |
seller_files[].mime_type |
string | no | MIME type of the file, for example application/pdf or image/jpeg. |
language |
string | no | Language of error messages: he (default) or en. |
Request example
{
"payme_client_key": "XXXXXXXX",
"seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
"seller_files": [
{
"name": "social_id.pdf",
"type": 1,
"url": "https://www.example.com/files/social_id.pdf",
"mime_type": "application/pdf"
},
{
"name": "cheque.png",
"type": 2,
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",
"mime_type": "image/png"
}
],
"language": "en"
}
Code samples
curl
curl -X POST 'https://sandbox.payme.io/api/upload-seller-files' \
-H 'Content-Type: application/json' \
--data-raw '{
"payme_client_key": "XXXXXXXX",
"seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
"seller_files": [
{
"name": "social_id.pdf",
"type": 1,
"url": "https://www.example.com/files/social_id.pdf",
"mime_type": "application/pdf"
},
{
"name": "cheque.png",
"type": 2,
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",
"mime_type": "image/png"
}
],
"language": "en"
}'
Node.js
const response = await fetch("https://sandbox.payme.io/api/upload-seller-files", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
"payme_client_key": "XXXXXXXX",
"seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
"seller_files": [
{
"name": "social_id.pdf",
"type": 1,
"url": "https://www.example.com/files/social_id.pdf",
"mime_type": "application/pdf"
},
{
"name": "cheque.png",
"type": 2,
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",
"mime_type": "image/png"
}
],
"language": "en"
}),
});
console.log(await response.text());
Python
import requests
response = requests.post(
"https://sandbox.payme.io/api/upload-seller-files",
json={
"payme_client_key": "XXXXXXXX",
"seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
"seller_files": [
{
"name": "social_id.pdf",
"type": 1,
"url": "https://www.example.com/files/social_id.pdf",
"mime_type": "application/pdf",
},
{
"name": "cheque.png",
"type": 2,
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",
"mime_type": "image/png",
},
],
"language": "en",
},
)
print(response.text)
PHP
<?php
$body = <<<'BODY'
{
"payme_client_key": "XXXXXXXX",
"seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567",
"seller_files": [
{
"name": "social_id.pdf",
"type": 1,
"url": "https://www.example.com/files/social_id.pdf",
"mime_type": "application/pdf"
},
{
"name": "cheque.png",
"type": 2,
"base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",
"mime_type": "image/png"
}
],
"language": "en"
}
BODY;
$ch = curl_init('https://sandbox.payme.io/api/upload-seller-files');
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;
Responses
200 — OK (success)
| Field | Type | Description |
|---|---|---|
status_code |
integer | 0 when the files were accepted. |
session |
string | PayMe session ID. |
{
"status_code": 0,
"session": "a1B2c3D4"
}
400 — Bad request, for example error 20: a file's type is missing or invalid (error)
| Field | Type | Description |
|---|---|---|
status_code |
integer | 1 on failure. |
status_error_code |
integer | PayMe error code. See Errors. |
status_error_details |
string | Error message, in the request's language. |
status_additional_info |
string | Extra detail, such as the name of the missing or invalid field. Can be null. |
session |
string | PayMe session ID. Quote it when you contact support. |
{
"status_code": 1,
"status_error_details": "Validation error",
"status_additional_info": "type",
"status_error_code": 20,
"session": "a1B2c3D4"
}
500 — Error, for example error 904: the file extension isn't allowed (error)
| Field | Type | Description |
|---|---|---|
status_code |
integer | 1 on failure. |
status_error_code |
integer | PayMe error code. See Errors. |
status_error_details |
string | Error message, in the request's language. |
status_additional_info |
string | Extra detail, such as the name of the missing or invalid field. Can be null. |
session |
string | PayMe session ID. Quote it when you contact support. |
{
"status_code": 1,
"status_error_details": "Invalid file extension",
"status_additional_info": null,
"status_error_code": 904,
"session": "a1B2c3D4"
}