Cancel income document

Credentials

No credentials are documented for this endpoint.

Cancel an existing income document. This will create a cancellation record.

Parameters

Name In Type Required Description
id path string yes Document ID to cancel

Request body

Content type: application/json

Code samples

curl

curl -X POST 'https://sandbox.payme.io/api/seller/api/documents/income/<id>/cancel' \
  -H 'Content-Type: application/json' \
  --data-raw '{}'

Node.js

const response = await fetch("https://sandbox.payme.io/api/seller/api/documents/income/<id>/cancel", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});

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

Python

import requests

response = requests.post(
    "https://sandbox.payme.io/api/seller/api/documents/income/<id>/cancel",
    json={},
)

print(response.text)

PHP

<?php

$body = <<<'BODY'
{}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/seller/api/documents/income/<id>/cancel');
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 — Document cancelled successfully (success)

400 — Bad Request (error)

Field Type Description
statusCode integer HTTP status code
message string Error message(s)
error string Error type
{
  "statusCode": 400,
  "message": [
    "Validation failed"
  ],
  "error": "Bad Request"
}

401 — Unauthorized (error)

Field Type Description
statusCode integer HTTP status code
message string Error message(s)
error string Error type
{
  "statusCode": 401,
  "message": "Unauthorized",
  "error": "Unauthorized"
}

404 — Not Found (error)

Field Type Description
statusCode integer HTTP status code
message string Error message(s)
error string Error type
{
  "statusCode": 404,
  "message": "Document not found",
  "error": "Not Found"
}