POST
/
payments
/
{id}
/
cancel
curl --request POST \
  --url https://api.plane.com/v1/payments/{id}/cancel \
  --header 'Authorization: Bearer <token>'
{
  "id": "pt_KhzQL81YnE3B7K6MZb65gCJx",
  "status": "cancelled",
}

You can cancel a previously created payment if its status is pending.

Parameters

id
string
required

The ID of a payment object.

Returns

Returns the payment id and status if the cancellation succeeds. Returns an error if the payment is already cancelled or can’t be cancelled.

{
  "id": "pt_KhzQL81YnE3B7K6MZb65gCJx",
  "status": "cancelled",
}