# Capture an authorization in several parts Building with an AI agent? Start at https://docs.payme.io/agents.md Multi-capture charges an authorized sale in several parts, for example one per shipment. Each part is a new sale linked to the original authorization. Cards (`credit-card`) and PayPal (`paypal`) are supported; any other payment method returns error `4`. ## Step 1: authorize Create a sale with `sale_type: "authorize"`, in one of two ways: - [`generate-sale`](/payments/hosted-payment-page/post-generate-sale): PayMe returns a `sale_url` where the buyer enters the card. - `sales`: you send the card details in the request (PCI DSS Level 1 partners only), and the response holds the result. When the buyer's card is authorized, the sale's status is `authorized`. `POST /generate-sale` request: ```json { "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567", "sale_price": 10000, "currency": "ILS", "product_name": "Shirt", "sale_type": "authorize", "sale_payment_method": "credit-card", "language": "en" } ``` Response: ```json { "status_code": 0, "sale_url": "https://sandbox.payme.io/sale/generate/SALEDEMO-XXXXXXXX-XXXXXXXX-XXXXXXXX", "payme_sale_id": "SALEDEMO-XXXXXXXX-XXXXXXXX-XXXXXXXX", "payme_sale_code": 1185468, "price": 10000, "transaction_id": "", "currency": "ILS", "sale_payment_method": "credit-card" } ``` `POST /sales` request: ```json { "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567", "product_name": "Shirt", "sale_price": 10000, "currency": "ILS", "sale_type": "authorize", "payment": { "method": "credit-card", "card_number": "5326105300985846", "card_expiry": "1230", "card_cvv": "658" }, "customer": { "name": "Israel Israeli", "email": "buyer@example.com", "phone": "+972500000000", "social_id": "008336174" } } ``` Response (abridged): ```json { "status_code": 0, "payme_sale_id": "SALEDEMO-XXXXXXXX-XXXXXXXX-XXXXXXXX", "payme_sale_code": 1185468, "sale_status": "authorized", "payme_sale_status": "authorized", "currency": "ILS", "price": 10000, "payme_transaction_total": "10000", "buyer_card_mask": "532610******5846", "installments": 1 } ``` ## Step 2: capture each part Call `generate-sale` once per part, with these fields on top of the usual ones: | Field | Type | Description | |---|---|---| | `sale_type` | string | `multi-capture`. | | `origin_sale_id` | string | The authorized sale's `payme_sale_id`. | | `currency` | string | Required. The same currency as the authorized sale. | | `sale_price` | integer | The amount of this part, in minor units. At least the account's minimum sale value (500 by default). | PayMe charges at once, and the response holds the result. `POST /generate-sale` request: ```json { "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567", "sale_price": 4000, "currency": "ILS", "product_name": "Shirt, first shipment", "sale_type": "multi-capture", "origin_sale_id": "SALEDEMO-XXXXXXXX-XXXXXXXX-XXXXXXXX", "sale_payment_method": "credit-card", "language": "en" } ``` Response (abridged): ```json { "status_code": 0, "status_error_code": 0, "payme_status": "success", "payme_sale_id": "SALEDEMO-YYYYYYYY-YYYYYYYY-YYYYYYYY", "payme_sale_code": 1185470, "sale_created": "2026-11-09 09:58:26", "sale_status": "completed", "payme_sale_status": "completed", "price": 4000, "transaction_id": "", "currency": "ILS", "sale_payment_method": "credit-card", "is_token_sale": false, "sale_description": "Shirt, first shipment", "sale_deferred_months": null, "redirect_url": null, "transaction_cc_auth_number": "123456", "payme_transaction_auth_number": "123456" } ``` A declined part returns HTTP 200 with `status_code: 1` and `status_error_code`. ## Rules - The original sale must be `authorized` (error `305`). - Each part must use the original's payment method (error `303`) and its currency, which you must send (error `320`). Both sales must belong to the same partner (error `303`). - All parts together can't exceed the authorized amount, unless PayMe has set a higher capture limit on your account (error `352`). - Don't send `buyer_key` or `token` with a multi-capture (error `357`). - Once a part is captured, the authorization can't be voided (error `369`). The original sale stays `authorized`, and the card issuer releases what you don't capture. ## PayPal Multi-capture works the same way for PayPal payments. You need a PayPal-enabled MPL on PayMe and a PayPal account for the authorization. Use `generate-sale` for PayPal, sending `paypal` wherever the examples above use `credit-card`. The capture runs in the request, so the response holds the result, and PayMe also sends a `sale-complete` or `sale-failure` callback.