Checkouts
Create a Checkout
Create a checkout to initiate the collection of a Card Payment, ACH Payment, Insurance Quote Payment, BNPL Payment (not yet available via API), or Card Reader payment in a single flow. Checkouts have the following statuses: created after creating a checkout, attempted when a checkout payment is attempted, completed when a payment is collected for a checkout, expired when a checkout has not been completed after one week since being created
post/checkouts
Request
- Base URLhttps://api.justifi.ai/v1
- Authnone declared. Required headers: Authorization, Sub-Account
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Authorizationstring required
the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)
Sub-Accountstring required
the id of the sub account that this request applies to
Request body
Example request
{
"amount": 10000,
"description": "order_xyz",
"origin_url": "http://localhost:3000",
"payment_method_group_id": "pmg_xyz123",
"statement_descriptor": "Big Business",
"metadata": {},
"application_fees": {
"card": {
"amount": 300
},
"bank_account": {
"amount": 150
}
},
"payment": {
"description": "Pay David for great work",
"metadata": {},
"fees": [
{
"type": "processing_fee",
"amount": 350
},
{
"type": "platform_fee",
"amount": 500
}
]
}
}Response
Checkout was created successfully
Example response
{
"id": "prefix_xyz (same as id of data object)",
"type": "checkout",
"data": {
"id": "cho_xyz",
"account_id": "acc_xyz",
"platform_account_id": "acc_xyz",
"payment_intent_id": "pi_xyz",
"payment_amount": 10000,
"payment_currency": "USD",
"payment_description": "my order xyz",
"payment_methods": [
{
"id": "pm_123xyz",
"type": "card",
"status": "valid",
"invalid_reason": null,
"name": "John Doe",
"brand": "visa",
"acct_last_four": "4321",
"month": "12",
"year": "2031",
"address_line1_check": "pass",
"address_postal_code_check": "pass",
"bin_details": {}
},
{
"id": "pm_789abc",
"type": "bank_account",
"status": "valid",
"invalid_reason": null,
"account_owner_name": "Mary Lane",
"account_type": "checking",
"bank_name": "Altra",
"acct_last_four": "4512"
}
],
"payment_method_group_id": "pmg_xyz",
"mode": "test",
"successful_payment_id": "py_123xyz",
"statement_descriptor": "Big Business",
"metadata": {},
"application_fees": {
"card": {
"amount": 300
},
"bank_account": {
"amount": 150
}
},
"payment_settings": {
"ach_payments": true,
"bnpl_payments": false,
"credit_card_payments": true,
"insurance_payments": false,
"bank_account_verification": false
},
"payment": {
"description": "my order xyz",
"metadata": {
"new": "info"
},
"expedited": true,
"fees": [
{
"type": "processing_fee",
"amount": 295
},
{
"type": "platform_fee",
"amount": 150
}
]
},
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-01T12:00:00Z",
"completions": [
{
"id": "chc_xyz123",
"payment_mode": "ecom",
"payment_token": "pm_xyz123",
"status": "succeeded",
"payment_status": "succeeded",
"payment_error_code": "card_declined",
"payment_error_description": "Your card was declined",
"payment_response": {
"id": "py_xyz",
"type": "payment",
"data": {
"id": "py_xyz",
"account_id": "acc_xyz",
"amount": 10000,
"amount_refundable": 10000,
"balance": 99850,
"fee_amount": 150,
"financial_transaction_id": "ft_123xyz",
"captured": true,
"capture_strategy": "automatic",
"currency": "usd",
"description": "my_order_xyz",
"disputes": [],
"error_code": "credit_card_number_invalid",
"error_description": "Credit Card Number Invalid (Failed LUHN checksum)",
"is_test": true,
"metadata": {},
"payment_intent_id": "pi_123xyz",
"checkout_id": "cho_123xyz",
"payment_method": {
"card": {
"id": "pm_123xyz",
"brand": "Visa",
"digital_wallet": "apple_pay",
"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"
},
"application_fee_rate_id": "afr_123xyz",
"fees": [
{
"id": "pyfee_abc",
"type": "processing_fee",
"amount": 350,
"currency": "usd",
"remaining_amount": 350,
"source_configuration_id": "sfc_abc123",
"source_fee_type": "processing_ecomm",
"refund_id": null
},
{
"id": "pyfee_xyz",
"type": "platform_fee",
"amount": 500,
"currency": "usd",
"remaining_amount": 500,
"source_configuration_id": "sfc_abc123",
"source_fee_type": "platform",
"refund_id": null
}
],
"payment_mode": "ecom",
"terminal_id": "trm_123xyz",
"transaction_hold": {
"id": "th_123xyz",
"financial_transaction_id": "ft_123xyz"
},
"created_at": "2021-01-01T12:00:00Z",
"updated_at": "2021-01-01T12:00:00Z"
}
},
"checkout_id": "cho_xyz123",
"additional_transactions": [],
"payment_id": "py_xyz123",
"payment_method_id": "pm_xyz123",
"terminal_id": "trm_xyz123",
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-01T12:00:00Z"
}
]
}
}Changes
No recorded changes to this operation across all 1 revision of this API.