Order Flow

You can initiate transactions through Optty using either customer-initiated or merchant-initiated orders. Customer-Initiated orders are best for the traditional ecommerce flow and are a mandatory part of a direct API integration if not using widgets, merchant-initiated orders can be used to fulfil additional use cases such as subscriptions or recurring customer wallets.

Customer Initiated Orders

A customer-initiated order represents the traditional checkout flow on a e-commerce site. Optty creates an order with the relevant payment provider and returns a redirectUrl, to which the customer should then be redirected. The customer completes the checkout on this page, often by logging into their account with that provider or entering card details for card providers. The customer is then redirected back to the dynamicRedirectURL, returning control to the merchant. Customer Initiated Orders

Merchant Initiated Orders

Merchant-initiated transactions can be used to implement services such as subscriptions or to save payment details, reducing friction at checkout for returning customers. Merchants must obtain consent and clearly communicate to the customer how the token will be used.

These orders can only be initiated after a customer has completed a customer-initiated transaction. When creating the customer-initiated transaction and setting the `getToken` field to `true`, we will generate a token for the customer's payment details. This token can then be used for recurring payments. Merchant Initiated Orders

Auto Capture

When auto capture is set to true, after a payment has been completed the payment is immediately begins the capture process, this is the primary flow outlined in the following diagrams for simplicity. If auto capture is set to false then a second status of captureStatus initially set to AUTHORIZED will be tracked to understand the capture status of your order.

Status Definitions

Pending: The order has been created with the relevant payment provider. For customer-initiated transactions, this status covers waiting for customer input and provider processing the payment. For merchant-initiated transactions, "pending" represents waiting for processor confirmation.

Final Statuses

Once one of these statuses is reached no further status updates will be made without interaction from the merchant to move to refunded.

Success: The payment provider has confirmed that the order has been completed successfully. The goods have been successfully paid for and can be dispatched.

Declined: The transaction has been declined by the provider.

Refunded: The transaction has been refunded. This state is only reached if the payment has been fully refunded; partial refunds will not update the order's status.

Canceled (system): The transaction has been canceled by the Optty system based on the order timeout time passed to Optty.

Canceled (payer): The payer has canceled completing the payment from the checkout page.

Last updated