In this section, we will cover a more comprehensive example in an e-commerce retail setting that further expands on all the remaining Transactions API concepts.
Suppose you’re a furniture retailer and your customer is purchasing the following items:
The customer completed the Flex Pay checkout journey and accepted a Flex Pay financing offer for a $1,000 order for the 4 items above.
Authorizing a transaction
đź’ˇ After the customer completed the Flex Pay checkout journey, you submit an authorization request for $1,000.00. In the Transaction response object, you can find the transaction id and the remaining_amount of $1,000.00 available for capture. |
Authorization Sample
POST {flexpay_api_url}/v1/transactions |
Sample request body |
{ "order_id": "d2e50ab8-2839-4865-bf38-b20ca4cdf7b7", "amount": 1000.00, "currency": "USD", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a" } |
Sample response body |
{ "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "original_amount": 1000.00, "remaining_amount": 1000.00, "captured_amount": 0.00, "refunded_amount": 0.00, "authorization_expiration": "2025-04-21T20:33:15.200317Z", "order_id": "d2e50ab8-2839-4865-bf38-b20ca4cdf7b7", "created": "2025-04-14T20:33:15.200431691Z", "currency": "USD", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "status": "AUTHORIZED", "events": [ { "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "amount": 1000.00, "currency": "USD", "created": "2025-04-14T20:33:15.200664Z", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "type": "AUTHORIZATION" } ] } |
Voiding a transaction
In the event you need to void an already authorized transaction, such as when the customer is cancelling an item before it is fulfilled, or you are certain that an item is out of stock and cannot be fulfilled, you can submit a POST request to the /v1/{transaction_id}/void endpoint. You may fully or partially void a transaction by specifying an amount in the request, but it must be less than or equal to the remaining_amount available in the Transaction object.
When the void request is successfully processed, an updated Transaction object is returned in the response, with the remaining_amount updated to reflect the latest void event. Note that once an amount is voided, it is permanently deducted from the remaining_amount and you can no longer capture against the amount voided.
💡 Before you have fulfilled any of the customer’s orders, the customer calls in to let you know that they would like to cancel the coffee table before it is fulfilled. In this case, you can submit a void request with an amount equal to $200.00. In the Transaction object, you should notice that the remaining_amount is reduced from $1,000.00 to $800.00, which means you will still have $800.00 left to capture for the remaining 3 items of this order. |
Void Sample
POST {flexpay_api_url}/v1/transactions/{transaction_id}/void |
Sample request body |
{ "amount": 200.00, "currency": "USD", "merchant_reference_id": "f45bffd4-f4aa-4aad-8e14-c20f439f6663" } |
Sample response body |
{ "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "original_amount": 1000.00, "remaining_amount": 800.00, "captured_amount": 0.00, "refunded_amount": 0.00, "authorization_expiration": "2025-04-21T20:33:15.200317Z", "order_id": "d2e50ab8-2839-4865-bf38-b20ca4cdf7b7", "created": "2025-04-14T20:33:15.200432Z", "currency": "USD", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "status": "AUTHORIZED", "events": [ { "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "amount": 1000.00, "currency": "USD", "created": "2025-04-14T20:33:15.200664Z", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "type": "AUTHORIZATION" }, { "id": "bc4f60ab-25a4-4d3b-93f8-dc9e29af4f85", "amount": 200.00, "currency": "USD", "created": "2025-04-14T20:34:15.626351Z", "merchant_reference_id": "f45bffd4-f4aa-4aad-8e14-c20f439f6663", "type": "VOID" } ] } |
Capturing a transaction
đź’ˇ Of the remaining three items in the order, you are currently only able to fulfill the couch for $300.00, while the rug and the standing lamp are still on backorder. Therefore, you elect to first submit a partial capture by specifying an amount of $300.00 in the capture request. In the Transaction response object, the remaining_amount is reduced from $800.00 to $500.00 and the captured_amount is updated from $0.00 to $300.00. At the end of the transaction period, $300.00 is deposited into your bank account as part of the disbursement process. A few days later, the rug finally becomes in stock, so you submit another partial capture by specifying an amount of $400.00 in a second capture request. The Transaction response object again updates to reduce the remaining_amount to $100.00 and to increase the captured_amount to $700.00. At the end of the transaction period, an additional $400.00 is deposited into your bank account as part of the disbursement process. |
First Capture Sample
POST {flexpay_api_url}/v1/transactions/{transaction_id}/capture |
Sample request body |
{ "amount": 300.00, "currency": "USD", "merchant_reference_id": "b0819d03-3c09-4654-8b95-05ed722add21" } |
Sample response body |
{ "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "original_amount": 1000.00, "remaining_amount": 500.00, "captured_amount": 300.00, "refunded_amount": 0.00, "authorization_expiration": "2025-04-21T20:33:15.200317Z", "order_id": "d2e50ab8-2839-4865-bf38-b20ca4cdf7b7", "created": "2025-04-14T20:33:15.200432Z", "currency": "USD", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "status": "PARTIALLY_CAPTURED", "events": [ { "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "amount": 1000.00, "currency": "USD", "created": "2025-04-14T20:33:15.200664Z", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "type": "AUTHORIZATION" }, { "id": "bc4f60ab-25a4-4d3b-93f8-dc9e29af4f85", "amount": 200.00, "currency": "USD", "created": "2025-04-14T20:34:15.626351Z", "merchant_reference_id": "f45bffd4-f4aa-4aad-8e14-c20f439f6663", "type": "VOID" }, { "id": "99ecbe91-9555-424f-b5d5-2515732d47c4", "amount": 300.00, "currency": "USD", "created": "2025-04-14T20:35:06.579678Z", "merchant_reference_id": "b0819d03-3c09-4654-8b95-05ed722add21", "type": "CAPTURE" } ] } |
Second Capture Sample
POST {flexpay_api_url}/v1/transactions/{transaction_id}/capture |
Sample request body |
{ "amount": 400.00, "currency": "USD", "merchant_reference_id": "afa4ed39-501c-4042-8d2e-4ef20041edd3" } |
Sample response body |
{ "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "original_amount": 1000.00, "remaining_amount": 100.00, "captured_amount": 700.00, "refunded_amount": 0.00, "authorization_expiration": "2025-04-21T20:33:15.200317Z", "order_id": "d2e50ab8-2839-4865-bf38-b20ca4cdf7b7", "created": "2025-04-14T20:33:15.200432Z", "currency": "USD", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "status": "PARTIALLY_CAPTURED", "events": [ { "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "amount": 1000.00, "currency": "USD", "created": "2025-04-14T20:33:15.200664Z", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "type": "AUTHORIZATION" }, { "id": "bc4f60ab-25a4-4d3b-93f8-dc9e29af4f85", "amount": 200.00, "currency": "USD", "created": "2025-04-14T20:34:15.626351Z", "merchant_reference_id": "f45bffd4-f4aa-4aad-8e14-c20f439f6663", "type": "VOID" }, { "id": "99ecbe91-9555-424f-b5d5-2515732d47c4", "amount": 300.00, "currency": "USD", "created": "2025-04-14T20:35:06.579678Z", "merchant_reference_id": "b0819d03-3c09-4654-8b95-05ed722add21", "type": "CAPTURE" }, { "id": "da5f9b2d-a26a-40de-b18d-75f63625f1ea", "amount": 400.00, "currency": "USD", "created": "2025-04-14T20:37:07.185014Z", "merchant_reference_id": "afa4ed39-501c-4042-8d2e-4ef20041edd3", "type": "CAPTURE" } ] } |
Authorization Expiration
Each transaction has an authorization_expiration timestamp. If there is any uncaptured amount in the transaction by the time the authorization expires, all remaining_amount will automatically be voided and updated to $0.00. Any subsequent capture requests submitted will be declined. Therefore, we recommend you check the authorization_expiration timestamp and use it as a reference before fulfilling the remaining items in the order.
đź’ˇ The standing lamp is still out of stock by the time we reach the authorization expiration date. Flex Pay automatically voids the remaining_amount of $100.00 available in the transaction. You should notice that the remaining_amount is reduced by $100.00 to $0.00 in the Transaction object. |
Authorization Sample
Sample response body |
{ "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "original_amount": 1000.00, "remaining_amount": 0.00, "captured_amount": 700.00, "refunded_amount": 0.00, "authorization_expiration": "2025-04-21T20:33:15.200317Z", "order_id": "d2e50ab8-2839-4865-bf38-b20ca4cdf7b7", "created": "2025-04-14T20:33:15.200432Z", "currency": "USD", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "status": "CAPTURED", "events": [ { "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "amount": 1000.00, "currency": "USD", "created": "2025-04-14T20:33:15.200664Z", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "type": "AUTHORIZATION" }, { "id": "bc4f60ab-25a4-4d3b-93f8-dc9e29af4f85", "amount": 200.00, "currency": "USD", "created": "2025-04-14T20:34:15.626351Z", "merchant_reference_id": "f45bffd4-f4aa-4aad-8e14-c20f439f6663", "type": "VOID" }, { "id": "99ecbe91-9555-424f-b5d5-2515732d47c4", "amount": 300.00, "currency": "USD", "created": "2025-04-14T20:35:06.579678Z", "merchant_reference_id": "b0819d03-3c09-4654-8b95-05ed722add21", "type": "CAPTURE" }, { "id": "da5f9b2d-a26a-40de-b18d-75f63625f1ea", "amount": 400.00, "currency": "USD", "created": "2025-04-14T20:37:07.185014Z", "merchant_reference_id": "afa4ed39-501c-4042-8d2e-4ef20041edd3", "type": "CAPTURE" } ] } |
Refunding a transaction
💡 Suppose some time down the line, the customer decides to return the rug. After reviewing your refund policy, you accept the customer’s return and would like to issue a refund to the customer via Flex Pay. You submit a refund request by specifying an amount of $400.00. In the Transaction object, you will notice that the captured_amount is now reduced from $700.00 to $300.00 and the refunded_amount is increased from $0.00 to $400.00. At the end of the transaction period, $400.00 is deducted from the upcoming disbursement to your bank account as part of the disbursement process. |
Refund Sample
POST {flexpay_api_url}/v1/transactions/{transaction_id}/refund |
Sample request body |
{ "amount": 400.00, "currency": "USD", "merchant_reference_id": "de4eec48-a8de-4639-a913-89d8ddddecad" } |
Sample response body |
{ "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "original_amount": 1000.00, "remaining_amount": 0.00, "captured_amount": 300.00, "refunded_amount": 400.00, "authorization_expiration": "2025-04-21T20:33:15.200317Z", "order_id": "d2e50ab8-2839-4865-bf38-b20ca4cdf7b7", "created": "2025-04-14T20:33:15.200432Z", "currency": "USD", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "status": "PARTIALLY_REFUNDED", "events": [ { "id": "cbaf4ada-e78c-40f3-b6e3-0953b442cfd1", "amount": 1000.00, "currency": "USD", "created": "2025-04-14T20:33:15.200664Z", "merchant_reference_id": "cc2405b9-d9dd-49da-931e-d0b0919f6d7a", "type": "AUTHORIZATION" }, { "id": "bc4f60ab-25a4-4d3b-93f8-dc9e29af4f85", "amount": 200.00, "currency": "USD", "created": "2025-04-14T20:34:15.626351Z", "merchant_reference_id": "f45bffd4-f4aa-4aad-8e14-c20f439f6663", "type": "VOID" }, { "id": "99ecbe91-9555-424f-b5d5-2515732d47c4", "amount": 300.00, "currency": "USD", "created": "2025-04-14T20:35:06.579678Z", "merchant_reference_id": "b0819d03-3c09-4654-8b95-05ed722add21", "type": "CAPTURE" }, { "id": "da5f9b2d-a26a-40de-b18d-75f63625f1ea", "amount": 400.00, "currency": "USD", "created": "2025-04-14T20:37:07.185014Z", "merchant_reference_id": "afa4ed39-501c-4042-8d2e-4ef20041edd3", "type": "CAPTURE" }, { "id": "852b888f-fa30-47b9-8c64-ff456f2323d2", "amount": 400.00, "currency": "USD", "created": "2025-04-24T20:46:13.107859Z", "merchant_reference_id": "de4eec48-a8de-4639-a913-89d8ddddecad", "type": "REFUND" } ] } |
Disbursement process
At the end of the transaction period, Flex Pay aggregates all transaction events to arrive at a net disbursement amount to be paid out to your designated bank account. The net disbursement amount is calculated by adding up all captured amounts and subtracting all refunded amounts during the period. On the following business day, Flex Pay and its lending partners will initiate ACH transfers to disburse the funds to you. Depending on the processing time of your financial institution, the funds may arrive at your bank account within a few business days.
Note: if during a given transaction period, the net disbursement amount is negative (meaning there were more refunds than captures during the period), the negative net disbursement balance will be carried over to the next transaction period and subtracted from next period’s net disbursement amount.