> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Sample Flows ## Article: Sample Flows ## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-billing/sample-flows.md ## Article Content: # Order Billing: Sample Use Cases and Flows This article shares some possible use cases your app could support, as well as a sample flow that could support each use case. This can be a helpful jumping off point as you plan your app's implementation. ## Authorize and capture with a saved payment method To authorize a payment for an order with a saved payment method, follow these steps: 1. Ensure the order has a saved payment method. To do this, pass the order ID to the [List Transactions For Single Order](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-transactions/list-transactions-for-single-order.md) method. 2. Search the response for a payment with `regularPaymentDetails.savedPaymentMethod` set to `true`. If no such payment exists, you will not be able to use Authorize Charge With Saved Payment Method. 3. Pass the order ID and the other required fields to [Authorize Charge With Saved Payment Method](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-billing/authorize-charge-with-saved-payment-method.md). Use the `delayedCaptureSettings` field to define whether to automatically capture or void the authorized charge. 4. To capture the payment manually, pass the order ID and payment ID to [Capture Authorized Payments](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-billing/capture-authorized-payments.md). Currently, capturing only the full amount is supported. 5. To void the payment, pass the order ID and payment ID to [Void Authorized Payments](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-billing/void-authorized-payments.md). ## Process the refund of an entire order To fully refund an entire order, follow these steps: 1. Pass the selected order's ID to [Get Order Refundability](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-billing/get-order-refundability.md) to retrieve the refundable items and amounts. 2. Retrieve the refundable payments from the response. 3. Pass the order ID and payment IDs to [Refund Payments](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-billing/refund-payments.md). Use the response from Get Order Refundability to provide the amount and items related to the refund. ## Process the partial refund of an order Sometimes you may want to refund only a certain item. To partially refund an order, follow these steps: 1. Pass the selected order's ID to [Get Order Refundability](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-billing/get-order-refundability.md) to retrieve the refundable items and amounts. 2. Retrieve the refundable payments from the response. 3. Pass the order ID and line item ID to [Calculate Refund](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-billing/calculate-refund.md) to compute the refund amount for the required item, including associated taxes and discounts. 4. Pass the received amount and the line item ID to [Refund Payments](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-billing/refund-payments.md) to execute the partial refund for the selected item. ## Record a refund made on an external system In cases where the payment provider is not supported by Wix or the refund was processed outside of Wix, you can still record the refund using the Order Billing API. To do this, follow these steps: 1. Call [Refund Payments](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order-billing/refund-payments.md). 2. Pass the order ID, payment ID, and refund amount. 3. Set `externalRefund` to `true`.