Submit a Payment Session
Submit a payment attempt for a payment session.
This request works with the Flow handleSubmit callback, where you can perform a customized payment submission.
You must send the unmodified response body as the response of the handleSubmit callback.
- Type: string ·idmin length:30max length:30
Pattern: ^(ps)_(\w{27})$requiredThe Payment Sessions unique identifier
- Type: string ·session
_data required - Type: integer ·amountmin:0
The payment amount. Provide a value of
0to perform a card verification.The amount must be provided in the minor currency unit.
- Type: string ·currencymin length:3max length:3
The three-letter ISO currency code.
- Type: object ·billing
The billing details.
- Type: string ·success
_url max length:1024Format: uriOverrides the default success redirect URL configured on your account, for payment methods that require a redirect.
- Type: string ·failure
_url max length:1024Format: uriOverrides the default failure redirect URL configured on your account, for payment methods that require a redirect.
- Type: string · enumpayment
_type Must be specified for card-not-present (CNP) payments. For example, a recurring mail order / telephone order (MOTO) payment.
values- Regular
- Recurring
- M
O T O - Installment
- Unscheduled
- Type: object ·billing
_descriptor A description of the purchase, which is displayed on the customer's statement.
- Type: string ·referencemax length:50
A reference you can use to identify the payment. For example, an order number.
- For Amex payments, this must be at most 30 characters.
- For Benefit payments, the reference must be a unique alphanumeric value.
- For iDEAL payments, the reference is required and must be an alphanumeric value with a 35-character limit.
- Type: object ·customer
The customer's details.
- Type: object ·shipping
The shipping details
- Type: array object[] · 1…1000items
The line items in the order.
- application/json
- application/json
- 401
Unauthorized (Empty Response).
- application/problem+json; charset=utf-8
- application/json
- 502
Bad gateway.
curl 'https://{prefix}.api.sandbox.checkout.com/payment-sessions/ps_2Un6I6lRpIAiIEwQIyxWVnV9CqQ/submit' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"session_data": "",
"amount": 1000,
"currency": "USD",
"billing": {
"address": {
"address_line1": "123 High St.",
"address_line2": "Flat 456",
"city": "London",
"state": "",
"zip": "SW1A 1AA",
"country": "GB"
},
"phone": {
"country_code": "+1",
"number": "415 555 2671"
}
},
"success_url": "https://example.com/payments/success",
"failure_url": "https://example.com/payments/failure",
"payment_type": "Regular",
"billing_descriptor": {
"name": "",
"city": "",
"reference": ""
},
"reference": "ORD-123A",
"customer": {
"email": "jia.tsang@example.com",
"name": "Jia Tsang",
"id": "",
"phone": {
"country_code": "+1",
"number": "415 555 2671"
},
"tax_number": "",
"summary": {
"registration_date": "2023-05-01",
"first_transaction_date": "2023-07-01",
"last_payment_date": "2023-08-01",
"total_order_count": 15,
"last_payment_amount": 500,
"is_premium_customer": true,
"is_returning_customer": true,
"lifetime_value": 500
}
},
"shipping": {
"address": {
"address_line1": "123 High St.",
"address_line2": "Flat 456",
"city": "London",
"state": "",
"zip": "SW1A 1AA",
"country": "GB"
},
"phone": {
"country_code": "+1",
"number": "415 555 2671"
}
},
"items": [
{
"reference": "",
"commodity_code": "",
"unit_of_measure": "",
"total_amount": 1000,
"tax_amount": 1000,
"discount_amount": 1000,
"url": "",
"image_url": "",
"name": "Gold Necklace",
"quantity": 1,
"unit_price": 1000
}
],
"amount_allocations": [
{
"id": "",
"amount": 1,
"reference": "ORD-123A",
"commission": {
"amount": 10,
"percentage": 12.5
}
}
],
"3ds": {
"enabled": "false",
"challenge_indicator": "no_preference",
"allow_upgrade": true,
"exemption": "low_value"
},
"payment_method_configuration": {
"applepay": {
"store_payment_details": "disabled"
},
"card": {
"store_payment_details": "disabled"
},
"googlepay": {
"store_payment_details": "disabled"
}
},
"recipient": {
"dob": {},
"account_number": "5555554444",
"address": {
"address_line1": "123 High St.",
"address_line2": "Flat 456",
"city": "London",
"state": "",
"zip": "SW1A 1AA",
"country": "GB"
},
"first_name": "Jia",
"last_name": "Tsang"
},
"instruction": {
"purpose": "donations"
},
"processing_channel_id": "",
"metadata": {
"coupon_code": "NY2018"
},
"sender": {},
"capture": true,
"capture_on": "2024-01-01T09:15:30Z",
"processing": {
"pan_preference": "fpan",
"provision_network_token": true
}
}'
{
"id": "pay_mbabizu24mvu3mela5njyhpit4",
"status": "Approved",
"type": "card"
}