To charge a payment method the desired amount, you'll use a payment. You can choose whether to charge a payment method that's already been tokenized or tokenize a new one when you create the payment. If a payment fails, the status will reflect it and an error code will be returned. You can retrieve information about your payments and refund them if needed.
Authorize, capture, and charge a payment method.
Note: For platforms, if the sub account status is not enabled
, 400
will be returned.
Idempotency-Key required | string <uuid> a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests Example: my-request-123abc |
Authorization required | string the Example: Bearer {access_token} |
Sub-Account | string for platforms, the id of the sub account that this request applies to Example: acc_2IdMEOjIG6lJAncakgdBF2 |
Seller-Account | string Deprecated for platforms, the id of the seller account that this request applies to |
Payment was created successfully
{- "amount": 1000,
- "currency": "usd",
- "capture_strategy": "automatic",
- "email": "example@test.com",
- "description": "Charging $10 to the test card",
- "payment_method": {
- "card": {
- "name": "Sylvia Fowles",
- "number": "4111111111111111",
- "verification": "123",
- "month": "3",
- "year": "2040",
- "address_postal_code": "55555"
}
}
}
{- "id": "py_123xyz",
- "type": "payment",
- "data": {
- "id": "py_123xyz",
- "account_id": "acc_123xyz",
- "amount_disputed": 0,
- "amount_refunded": 0,
- "amount_returned": 0,
- "amount": 10000,
- "amount_refundable": 10000,
- "application_fee_rate_id": "afr_123xyz",
- "balance": 99850,
- "capture_strategy": "automatic",
- "captured": true,
- "created_at": "2021-01-01T12:00:00Z",
- "currency": "usd",
- "description": "my order xyz",
- "disputed": false,
- "error_code": null,
- "error_description": null,
- "fee_amount": 150,
- "financial_transaction_id": "ft_123xyz",
- "is_test": true,
- "metadata": { },
- "payment_intent_id": "pi_xyz",
- "refunded": false,
- "returned": false,
- "status": "succeeded",
- "updated_at": "2021-01-01T12:00:00Z",
- "payment_method": {
- "card": {
- "id": "pm_123xyz",
- "acct_last_four": "4242",
- "brand": "visa",
- "name": "Sylvia Fowles",
- "token": "pm_123xyz",
- "metadata": { },
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "customer_id": "null",
- "signature": "123abc"
}, - "application_fee": {
- "id": "fee_123xyz",
- "amount": 150,
- "currency": "usd",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "refunds": [ ],
- "disputes": [ ]
}, - "page_info": null
}
List the payments for your account. This endpoint supports pagination.
Authorization required | string the Example: Bearer {access_token} |
Sub-Account | string for platforms, the id of the sub account that this request applies to Example: acc_2IdMEOjIG6lJAncakgdBF2 |
Seller-Account | string Deprecated for platforms, the id of the seller account that this request applies to |
Successfully list payments
{- "id": 1,
- "type": "array",
- "data": [
- {
- "id": "py_xyz",
- "account_id": "acc_xyz",
- "amount": 10000,
- "amount_disputed": 0,
- "amount_refunded": 0,
- "amount_refundable": 10000,
- "balance": 99850,
- "fee_amount": 150,
- "financial_transaction_id": "ft_123xyz",
- "captured": true,
- "capture_strategy": "automatic",
- "currency": "usd",
- "description": "my_order_xyz",
- "disputed": false,
- "disputes": [ ],
- "error_code": "credit_card_number_invalid",
- "error_description": "Credit Card Number Invalid (Failed LUHN checksum)",
- "is_test": true,
- "metadata": { },
- "payment_intent_id": "py_xyz",
- "payment_method": {
- "card": {
- "id": "pm_123xyz",
- "acct_last_four": 4242,
- "brand": "Visa",
- "name": "Amanda Kessel",
- "token": "pm_123xyz",
- "month": "5",
- "year": "2042",
- "metadata": { },
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z",
- "address_line1_check": "unchecked",
- "address_postal_code_check": "unchecked"
}, - "customer_id": "cust_xyz",
- "signature": "4guAJNkVA3lRLVlanNVoBK",
- "account_id": "acc_123"
}, - "application_fee": {
- "id": "fee_123xyz",
- "amount": 150,
- "currency": "usd",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "refunded": false,
- "status": "pending",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - {
- "id": "py_xyz",
- "account_id": "acc_xyz",
- "amount": 10000,
- "amount_disputed": 0,
- "amount_refunded": 0,
- "amount_refundable": 10000,
- "balance": 99850,
- "fee_amount": 150,
- "financial_transaction_id": "ft_123xyz",
- "captured": true,
- "capture_strategy": "automatic",
- "currency": "usd",
- "description": "my_order_xyz",
- "disputed": false,
- "disputes": [ ],
- "error_code": "credit_card_number_invalid",
- "error_description": "Credit Card Number Invalid (Failed LUHN checksum)",
- "is_test": true,
- "metadata": { },
- "payment_intent_id": "py_xyz",
- "payment_method": {
- "bank_account": {
- "id": "pm_123xyz",
- "acct_last_four": 1111,
- "brand": "Wells Fargo",
- "name": "Phil Kessel",
- "token": "pm_123xyz",
- "metadata": { },
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "customer_id": "cust_xyz",
- "signature": "4guAJNkVA3lRLVlanNVoBK",
- "account_id": "acc_123"
}, - "application_fee": {
- "id": "fee_123xyz",
- "amount": 150,
- "currency": "usd",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "refunded": false,
- "status": "pending",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}
], - "page_info": {
- "end_cursor": "WyIyMDIyLTAyLTA4IDE5OjUyOjM3LjEwNDE3MzAwMCIsIjY4MDliYTU5LTYxYjctNDg3MS05YWFiLWE2Y2MyNmY3M2M1ZCJd",
- "has_next": false,
- "has_previous": false,
- "start_cursor": "WyIyMDIyLTAyLTA4IDIwOjAxOjU4LjEyMDIzMjAwMCIsIjU5ZTFjNGI1LWFlOWQtNDIyZC04MTVkLWNjNzQ5NzdlYmFjYSJd"
}
}
{- "id": "py_123xyz",
- "type": "payment",
- "data": {
- "id": "py_123xyz",
- "account_id": "acc_123xyz",
- "amount_disputed": 0,
- "amount_refunded": 0,
- "amount_returned": 0,
- "amount": 10000,
- "amount_refundable": 10000,
- "application_fee_rate_id": "afr_123xyz",
- "balance": 99850,
- "capture_strategy": "automatic",
- "captured": true,
- "created_at": "2021-01-01T12:00:00Z",
- "currency": "usd",
- "description": "my order xyz",
- "disputed": false,
- "error_code": null,
- "error_description": null,
- "fee_amount": 150,
- "financial_transaction_id": "ft_123xyz",
- "is_test": true,
- "metadata": { },
- "payment_intent_id": "pi_xyz",
- "refunded": false,
- "returned": false,
- "status": "succeeded",
- "updated_at": "2021-01-01T12:00:00Z",
- "payment_method": {
- "card": {
- "id": "pm_123xyz",
- "acct_last_four": "4242",
- "brand": "visa",
- "name": "Sylvia Fowles",
- "token": "pm_123xyz",
- "metadata": { },
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "customer_id": null,
- "signature": "123abc"
}, - "application_fee": {
- "id": "fee_123xyz",
- "amount": 150,
- "currency": "usd",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "refunds": [ ],
- "disputes": [ ]
}, - "page_info": null
}
Change a payment's description or metadata.
Idempotency-Key required | string <uuid> a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests Example: my-request-123abc |
Authorization required | string the Example: Bearer {access_token} |
Payment update was successful
{- "description": "order_xyz new description",
- "metadata": { }
}
{- "id": "py_123xyz",
- "type": "payment",
- "data": {
- "id": "py_123xyz",
- "account_id": "acc_123xyz",
- "amount_refunded": 0,
- "amount_disputed": 0,
- "amount_returned": 0,
- "amount": 10000,
- "amount_refundable": 10000,
- "application_fee_rate_id": "afr_123xyz",
- "balance": 99850,
- "capture_strategy": "automatic",
- "captured": true,
- "created_at": "2021-01-01T12:00:00Z",
- "currency": "usd",
- "description": "order xyz new description",
- "disputed": false,
- "error_code": null,
- "error_description": null,
- "fee_amount": 150,
- "financial_transaction_id": "ft_123xyz",
- "is_test": true,
- "metadata": { },
- "payment_intent_id": "pi_xyz",
- "refunded": false,
- "returned": false,
- "status": "succeeded",
- "updated_at": "2021-01-01T12:00:00Z",
- "payment_method": {
- "card": {
- "id": "pm_123xyz",
- "acct_last_four": "4242",
- "brand": "visa",
- "name": "Sylvia Fowles",
- "token": "pm_123xyz",
- "metadata": { },
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "customer_id": null,
- "signature": "123abc"
}, - "application_fee": {
- "id": "fee_123xyz",
- "amount": 150,
- "currency": "usd",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "refunds": [ ],
- "disputes": [ ]
}, - "page_info": null
}
To charge a payment method and capture a previously authorized payment. Returns a payment_already_captured
error if the payment is in a captured state.
Note: For platforms, if the sub account status is not enabled
, 400
will be returned.
Idempotency-Key required | string <uuid> a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests Example: my-request-123abc |
Authorization required | string the Example: Bearer {access_token} |
Payment with identical idempotency key was captured
Payment was captured successfully
{- "id": "py_123xyz",
- "type": "payment",
- "data": {
- "id": "py_123xyz",
- "account_id": "acc_123xyz",
- "amount_disputed": 0,
- "amount_refunded": 0,
- "amount_returned": 0,
- "amount": 10000,
- "amount_refundable": 10000,
- "application_fee_rate_id": "afr_123xyz",
- "balance": 99850,
- "capture_strategy": "automatic",
- "captured": true,
- "created_at": "2021-01-01T12:00:00Z",
- "currency": "usd",
- "description": "order xyz",
- "disputed": false,
- "error_code": null,
- "error_description": null,
- "fee_amount": 150,
- "financial_transaction_id": "ft_123xyz",
- "is_test": true,
- "metadata": { },
- "payment_intent_id": "pi_xyz",
- "refunded": false,
- "returned": false,
- "status": "succeeded",
- "updated_at": "2021-01-01T12:00:00Z",
- "payment_method": {
- "card": {
- "id": "pm_123xyz",
- "acct_last_four": "4242",
- "brand": "visa",
- "name": "Sylvia Fowles",
- "token": "pm_123xyz",
- "metadata": { },
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "customer_id": null,
- "signature": "123abc"
}, - "application_fee": {
- "id": "fee_123xyz",
- "amount": 150,
- "currency": "usd",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "refunds": [ ],
- "disputes": [ ]
}, - "page_info": null
}
Issue a refund for a payment. You may refund the full payment amount or just a portion. When refunding a portion, multiple refunds are supported up until the full payment amount has been refunded.
Note: For platforms, if the seller account status is not enabled
, 400
will be returned.
Idempotency-Key required | string <uuid> a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests Example: my-request-123abc |
Authorization required | string the Example: Bearer {access_token} |
Refund was created successfully
{- "amount": 10000,
- "description": "string",
- "reason": "duplicate",
- "metadata": { }
}
{- "id": 1,
- "type": "refund",
- "data": {
- "id": "re_xyz",
- "payment_id": "py_xyz",
- "amount": 100,
- "description": "customer canceled their order",
- "reason": "duplicate",
- "status": "succeeded",
- "metadata": { },
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "page_info": "string"
}
Get information about the payment-balance-transactions associated with a payment.
Successfully retrieve the payment-balance-transactions for a payment
{- "id": 1,
- "type": "array",
- "data": [
- {
- "id": "pbt_123xyz",
- "amount": 40145,
- "balance": 53550,
- "currency": "usd",
- "financial_transaction_id": "py_2644edn",
- "payment_id": "py_2644edn",
- "payment_balance_txn_type": "fee_refund",
- "source_id": "fee_6Vt2jlZZVh",
- "source_type": "ApplicationFee",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}
], - "page_info": {
- "end_cursor": "WyIyMDIyLTAyLTA4IDE5OjUyOjM3LjEwNDE3MzAwMCIsIjY4MDliYTU5LTYxYjctNDg3MS05YWFiLWE2Y2MyNmY3M2M1ZCJd",
- "has_next": false,
- "has_previous": false,
- "start_cursor": "WyIyMDIyLTAyLTA4IDIwOjAxOjU4LjEyMDIzMjAwMCIsIjU5ZTFjNGI1LWFlOWQtNDIyZC04MTVkLWNjNzQ5NzdlYmFjYSJd"
}
}