---
title: "Authorise at checkout and capture when the · Agent Wranglers"
url: https://agentwranglers.se/playbook/ecommerce/orders-and-fulfilment/capture-on-shipment
id: ECM-20
level: Recommended
updated: 2026-10-22
tokens: 971
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Authorise at checkout and capture when the goods ship

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Orders and fulfilment](https://agentwranglers.se/playbook/ecommerce/orders-and-fulfilment.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: ECM-20
- Level: Recommended
- Chapter: [Orders and fulfilment](https://agentwranglers.se/playbook/ecommerce/orders-and-fulfilment.md)
- Rule: For physical goods paid by card, authorise the payment at checkout and capture it when the shipment leaves. Capture only the lines you ship, and release the rest.
- Check: A test places an order for two items, ships one and cancels the other. The provider shows one capture for the shipped line and the remaining amount released. A daily query finds no uncaptured authorisation older than its expiry.
- How: Capturing at shipment means a cancelled or unshippable order needs no refund, and refund fees and disputes go down. An online card authorisation usually lasts about 7 days, and Visa's lasts 5 days for payments the merchant starts. Capture or release before the authorisation expires, and alert when one is a day from expiry. When a delay is longer than the authorisation, capture the lines ready now, or take a new payment with consent. Capture only on a verified event from your own system that the parcel left. The payment events that move the order are in [Let provider events move the order](https://agentwranglers.se/playbook/payments/payment-events-and-reconciliation/events-drive-fulfilment.md). Some payment methods cannot capture later, such as bank debits, so capture those at checkout.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### TypeScript example

```ts
export async function onShipmentLeft(shipment: Shipment) {
  const amountMinor = shipment.lines.reduce((sum, line) => sum + line.totalMinor, 0);
  await stripe.paymentIntents.capture(shipment.order.paymentIntentId,
    { amount_to_capture: amountMinor }, { idempotencyKey: `capture-${shipment.id}` });
}
```

### Python example

```python
def on_shipment_left(shipment) -> None:
    amount_minor = sum(line.total_minor for line in shipment.lines)
    stripe.PaymentIntent.capture(shipment.order.payment_intent_id,
                                 amount_to_capture=amount_minor, idempotency_key=f"capture-{shipment.id}")
```

## Sources

- [Stripe, place a hold on a payment method](https://docs.stripe.com/payments/place-a-hold-on-a-payment-method)

## Related rules

- ECM-10 [Sell preorders and backorders only with a shipping date](https://agentwranglers.se/playbook/ecommerce/stock-and-reservations/preorders-and-backorders.md) in E-commerce and fulfilment
- PAY-18 [Let provider events move the order](https://agentwranglers.se/playbook/payments/payment-events-and-reconciliation/events-drive-fulfilment.md) in Payments and billing

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/ecommerce/orders-and-fulfilment/capture-on-shipment">Agent Wranglers e-commerce and fulfilment playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Group order lines into shipments](https://agentwranglers.se/playbook/ecommerce/orders-and-fulfilment/shipments.md)
- Next: [Ship within the promised time or offer to cancel](https://agentwranglers.se/playbook/ecommerce/orders-and-fulfilment/shipping-time-promise.md)
- [Orders and fulfilment](https://agentwranglers.se/playbook/ecommerce/orders-and-fulfilment.md)
