# Authorize now, capture later Building with an AI agent? Start at https://docs.payme.io/agents.md Also known as pre-authorization. PayMe places a hold on the buyer's card; you charge it later with [`capture-sale`](/payments/post-sale-actions/post-capture-sale), once, for the full amount or less. Capture within 7 days (168 hours) of the authorization; after that, `capture-sale` fails with error `516`. The card issuer decides how long the hold stays on the card. ## Flow 1. Create the sale with [`generate-sale`](/payments/hosted-payment-page/post-generate-sale) and `sale_type: "authorize"`. Show the buyer the `sale_url`. 2. When the buyer pays, the sale's status becomes `authorized` and PayMe sends a `sale-authorized` callback to your `sale_callback_url`. 3. Call `capture-sale` with `payme_sale_id` and, to charge less, `sale_price`. The sale becomes `completed` and PayMe sends a `sale-complete` callback. ### Create the sale | Field | Value | |---|---| | `sale_type` | `authorize` | | `sale_price` | The amount to hold, in minor units (`10000` = 100.00). | All other `generate-sale` fields work as for a regular sale. ### Capture it | Field | Required | Description | |---|---|---| | `seller_payme_id` | yes, unless you send `seller_id` with `payme_client_key` | The seller's MPL, as on `refund-sale`. | | `payme_sale_id` | yes | The authorized sale. | | `sale_price` | no | Amount to capture, in minor units. Default: the full authorized amount. At least the account's minimum sale value (500 by default). | | `installments` | no | Number of installments, `1`–`36`. Default: the sale's installments. | To capture in several parts, use [multi-capture](/accepting-payments/capture-and-saved-cards/multi-capture). ## Releasing a hold To cancel, void the hold with [`refund-sale`](/payments/post-sale-actions/void-sale) while the sale is `authorized`. PayMe never voids an authorization on its own. If you don't release it, the card issuer releases the hold on its own schedule (days, up to about 30). A partly voided sale can't be captured. To charge less than you authorized, capture with a lower `sale_price` instead. ## Errors - `516`: the 7 days have passed. The error doesn't release the hold; void it with `refund-sale`. - `305`: the sale isn't `authorized` (for example, already captured, voided or partly voided). `status_additional_info` holds its status. - `352`: `sale_price` is `0`, below the account minimum (500 by default) or above the authorized amount. - `518`: the sale's authorization is no longer open, for example because the authorization failed. - A declined capture returns HTTP 200 with `status_code: 1` and leaves the sale `failed`. You can retry while the authorization is still valid. - `20001`: the acquirer refused a void or refund. Contact PayMe with the `payme_sale_id` and the time of the call. A captured sale that shows a balance of 0 right after the capture is normal: the funds reach the wallet during settlement.