Delete a customer

Credentials

Deletes one of the seller's customers. Deleted customers no longer appear in lists or reads, and their guid returns 404. The call has no request body and returns 204 No Content.

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 DELETE '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: "DELETE",
  headers: {
    "Authorization": "Bearer <YOUR_TOKEN>",
  },
});

console.log(await response.text());

Python

import requests

response = requests.delete(
    "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 => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer <YOUR_TOKEN>',
    ],
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;

Responses

204 — Customer deleted. The response has no body. (success)

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"
}

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.
{
  "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"
}

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.