Skip to main content

Cancel Payment Intent

POST /v1/payment_intents/:id/cancel

Overview

Cancels a specific payment intent using its unique identifier. This endpoint updates the intent's status to canceled.

Authorization

  • Header: Authorization: Bearer sk_test_907...de66
Request Details

Request

curl https://api-prod.paybytoken.io/v1/payment_intents/pay_t24c9qLoGieNDhvHVHWo/cancel \
-X POST \
-H "Authorization: Bearer sk_test_907...de66"

Request Parameters

ParameterTypeDescription
idstringUnique identifier of the payment intent (e.g., pay_t24c9qLoGieNDhvHVHWo).
Response Details

Response

The response returns a PaymentIntent object containing the updated details of the canceled payment intent.

Attributes

AttributeTypeDescription
idstringUnique identifier for the payment intent (e.g., pay_t24c9qLoGieNDhvHVHWo).
statusstringCurrent status of the payment intent (e.g., canceled).

Example Response

{
"id": "pay_t24c9qLoGieNDhvHVHWo",
"status": "canceled"
}