If you'd like to track the payment method and all associated payment attempts for a particular payment, you can use payment intents. Once you've tokenized a payment method and attached it to a payment intent, capturing the payment intent will let JustiFi know to charge the payment method and create a payment. If the capture fails, you can attempt again on the same payment intent.
Create a payment intent if you'd like a place to track the payment method along with all payment attempts for a payment.
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} |
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 intent was created successfully
{- "amount": 1000,
- "currency": "usd",
- "description": "ORDER 1235ABC: Charging $10 to the test card",
- "metadata": {
- "order_number": "12345ABC"
}
}
{- "id": "pi_xyz",
- "account_id": "acc_xyz",
- "amount": 10000,
- "currency": "usd",
- "description": "my_order_xyz",
- "metadata": { },
- "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"
}, - "status": "requires_payment_method",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}
List the payment intents 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 payment intents
{- "id": 1,
- "type": "array",
- "data": [
- {
- "id": "pi_xyz",
- "account_id": "acc_xyz",
- "amount": 10000,
- "currency": "usd",
- "description": "my_order_xyz",
- "metadata": { },
- "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"
}, - "status": "requires_payment_method",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - {
- "id": "pi_xyz",
- "account_id": "acc_xyz",
- "amount": 10000,
- "currency": "usd",
- "description": "my_order_xyz",
- "metadata": { },
- "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"
}, - "status": "requires_payment_method",
- "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"
}
}
Get information about a payment intent.
Successfully get a payment intent
{- "id": "pi_xyz",
- "account_id": "acc_xyz",
- "amount": 10000,
- "currency": "usd",
- "description": "my_order_xyz",
- "metadata": { },
- "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"
}, - "status": "requires_payment_method",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}
Change a payment intent's description or metadata; attach a payment method.
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 intent update was successful
{- "description": "order_xyz",
- "metadata": { },
- "payment_method": {
- "card": {
- "name": "Kevin Garnett",
- "number": 4242424242424242,
- "verification": 123,
- "month": 5,
- "year": 2042,
- "address_line1": "123 Fake St",
- "address_line2": "Suite 101",
- "address_city": "Cityville",
- "address_state": "MN",
- "address_postal_code": 55555,
- "address_country": "US",
- "brand": "Visa",
- "metadata": { }
}, - "token": "pm_xyz"
}, - "amount": 10000
}
{- "id": "pi_xyz",
- "account_id": "acc_xyz",
- "amount": 10000,
- "currency": "usd",
- "description": "my_order_xyz",
- "metadata": { },
- "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"
}, - "status": "requires_payment_method",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}
Capturing a payment intent lets JustiFi know you intend to process a payment. JustiFi will charge the attached payment method and create a payment.
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} |
object |
Payment intent was captured successfully
{- "payment_method": {
- "card": {
- "name": "Kevin Garnett",
- "number": 4242424242424242,
- "verification": 123,
- "month": 5,
- "year": 2042,
- "address_line1": "123 Fake St",
- "address_line2": "Suite 101",
- "address_city": "Cityville",
- "address_state": "MN",
- "address_postal_code": 55555,
- "address_country": "US",
- "brand": "Visa",
- "metadata": { }
}, - "token": "pm_xyz"
}
}
{- "id": "pi_xyz",
- "account_id": "acc_xyz",
- "amount": 10000,
- "currency": "usd",
- "description": "my_order_xyz",
- "metadata": { },
- "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"
}, - "status": "requires_payment_method",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}
Get information about the payments associated with a payment intent.
Successfully retrieve the payments for a payment intent
{- "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"
}
}