Payments API V3

Create and manage payment transactions

Create a payment

post

Creates a new payment transaction. Amounts should be provided in cents (e.g., 2999 for $29.99).

Authorizations
AuthorizationstringRequired

API key authentication. Include your API key in the Authorization header as a Bearer token. Example: Authorization: Bearer sk_test_1a2b3c4d5e6f

Body
amountintegerRequired

Payment amount in cents

Example: 2999
currencystring · enumRequired

Three-letter ISO currency code

Example: usdPossible values:
customer_idstringOptional

ID of an existing customer

Example: cus_1a2b3c4d5e6f
descriptionstringOptional

Description of the payment

Example: Monthly subscription
Responses
200

Payment created successfully

application/json
post
/payments

Retrieve a payment

get

Retrieves the details of a previously created payment.

Authorizations
AuthorizationstringRequired

API key authentication. Include your API key in the Authorization header as a Bearer token. Example: Authorization: Bearer sk_test_1a2b3c4d5e6f

Path parameters
idstringRequired

The payment ID

Example: pay_1a2b3c4d5e6f
Responses
200

Payment retrieved successfully

application/json
get
/payments/{id}
Experimental

Refund a payment

post

Refunds a previously successful payment. You can refund the full amount or a partial amount.

Authorizations
AuthorizationstringRequired

API key authentication. Include your API key in the Authorization header as a Bearer token. Example: Authorization: Bearer sk_test_1a2b3c4d5e6f

Path parameters
idstringRequired

The payment ID to refund

Example: pay_1a2b3c4d5e6f
Body
amountintegerOptional

Amount to refund in cents. If not provided, the full amount will be refunded.

Example: 1500
reasonstringOptional

Reason for the refund

Example: Customer requested refund
Responses
200

Payment refunded successfully

application/json
post
/payments/{id}/refund

Last updated