# Unscheduled payments with stored card details With an unscheduled payment agreement, you can request to store a customer's card details during an initial transaction and perform a card-not-present (CNP) transaction with the stored card at a later date. These types of transactions are referred to as merchant-initiated transactions (MITs). For example, a customer may provide their card details when checking into a hotel, but is only charged after they check out, at which point they may have incurred additional charges. --- ## SCA requirements In regions that require [Strong Customer Authentication (SCA)](https://www.checkout.com/docs/business-operations/ensure-regulatory-compliance/sca-compliance.md), you must enable [3D Secure (3DS)](https://www.checkout.com/docs/payments/authenticate-payments/3d-secure.md) authentication for the initial payment by setting `3ds.enabled` to `true` in the payment request. If you do not supply the required information, your payment request has a higher risk of declining with a `20154` response code. If this happens, Checkout.com [automatically upgrades the payment to 3DS](https://www.checkout.com/docs/risk-management/3d-secure/automated-sca-soft-decline-retry.md) and retries the transaction. You must also set `3ds.challenge_indicator` to `challenge_requested_mandate` to prevent subsequent CNP transactions from being declined. > **Information** > > If the transaction qualifies, you can also apply [3DS exemptions](https://www.checkout.com/docs/risk-management/3d-secure/sessions/3ds-exemptions.md). --- ## Set up an unscheduled payment agreement To obtain consent for an unscheduled payment via a card verification transaction, call the [Request a payment or payout](https://api-reference.checkout.com/tag/Payments/#operation/requestAPaymentOrPayout) endpoint. In the request body, provide the following fields: - `amount` – Set to `0`. - `payment_type` – Set to `Unscheduled`. You do not need to set `source.store_for_future_use` to `true`. `Unscheduled` payments automatically request to store the cardholder's details. Alternatively, you can perform an initial transaction in which `amount` is set to a non-zero value and `store_for_future_use` is set to `true`. > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/payments` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments` ### Request examples **Full card details** ```json { "source": { "type": "card", "number": 4242424242424242, "expiry_month": 10, "expiry_year": 2026 }, "amount": 0, "currency": "USD", "payment_type": "Unscheduled", "merchant_initiated": false, "3ds": { "enabled": true, "challenge_indicator": "challenge_requested_mandate" } } ``` **Card token** ```json { "source": { "type": "token", "token": "tok_tokenguid" }, "amount": 0, "currency": "USD", "payment_type": "Unscheduled", "merchant_initiated": false, "3ds": { "enabled": true, "challenge_indicator": "challenge_requested_mandate" } } ``` **Network token** ```json { "source": { "type": "network_token", "token": "4111111111111111", "token_type": "vts", "expiry_month": "10", "expiry_year": "2025", "eci": "06", "cryptogram": "AgAAAAAAAIR8CQrXcIhbQAAAAAA=" }, "amount": 0, "currency": "USD", "payment_type": "Unscheduled", "merchant_initiated": false, "3ds": { "enabled": true, "challenge_indicator": "challenge_requested" } } ``` ### Response example ```json { "id": "pay_4hlqceyyib5ezpxtpdpwfhwtda", "status": "Pending", "reference": "ORD-5023-4E89", "3ds": { "downgraded": false, "enrolled": "Y" }, "source": { "type": "id", "id": "src_nwd3m4in3hkuddfpjsaevunhdy" }, "_links": { "self": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_fbfrj7f3bwou5bdgmzsryd223i" }, "actions": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_fbfrj7f3bwou5bdgmzsryd223i/actions" }, "redirect": { "href": "https://{prefix}.api.sandbox.checkout.com/redirect/act_y3oqhf46pyzuxjbcn2giaqnb44" } } } ``` The response returns a payment instrument value in the `source.id` field, which you can use to request future payments with the stored card details. > **Information** > > For Mastercard payments, the `processing.scheme_transaction_link_id` in the response is the Mastercard Transaction Link Identifier (TLID). See [Mastercard Transaction Link Identifier > ](https://support.checkout.com/hc/en-us/articles/33589249067538) for more information. --- ## Request an unscheduled payment Once you've set up an unscheduled payment agreement with your customer, you can request a payment at a later date and perform a CNP transaction. 1. Call the [Request a payment or payout](https://api-reference.checkout.com/tag/Payments/#operation/requestAPaymentOrPayout) endpoint. In the request body, provide the following fields: - `payment_type` – Set to `Unscheduled`. - `merchant_initiated` – Set to `true`. - `previous_payment_id` – Set to the ID of initial CIT. > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/payments` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments` ### Request example ```json { "source": { "type": "id", "id": "src_nwd3m4in3hkuddfpjsaevunhdy" }, "amount": 5000, "currency": "USD", "payment_type": "Unscheduled", "merchant_initiated": true, "previous_payment_id": "pay_4hlqceyyib5ezpxtpdpwfhwtda", "processing": { "merchant_initiated_reason": "delayed_charge" } } ``` To improve your approval rates and chargeback processes, we recommend setting the `merchant_initiated_reason` field and to one of the following: - `resubmission` – Use when the original purchase has occurred, but you could not get authorization at the time that goods or services were provided. For example, when goods or services were provided, but the post-event authorization request was declined due to insufficient funds. - `delayed_charge` – Use when there is a delayed charge. For example, in travel and cruise environments, where a delayed charge is used to complete a supplemental account charge after original services were provided. - `no_show` – Use when the cardholder entered into an agreement to purchase but failed to meet the terms of the agreement. - `reauthorization` – Use when an additional purchase was made after the original purchase, typically for delayed or split orders. This improves issuer visibility over the intent of the transaction. > **Note** > > If you process a payment with full card details or network tokens stored in a card-on-file system external to Checkout.com, you must set `source.stored` to `true` in the request. ### Request examples **Full card details** ```json { "source": { "type": "card", "number": 4242424242424242, "expiry_month": 10, "expiry_year": 2026, "stored": true }, "amount": 5000, "currency": "USD", "payment_type": "Unscheduled", "merchant_initiated": true, "previous_payment_id": "pay_4hlqceyyib5ezpxtpdpwfhwtda", "processing": { "merchant_initiated_reason": "delayed_charge" } } ``` **Network token** ```json { "source": { "type": "network_token", "token": "4111111111111111", "token_type": "vts", "expiry_month": "10", "expiry_year": "2025", "eci": "06", "cryptogram": "AgAAAAAAAIR8CQrXcIhbQAAAAAA=", "stored": true }, "amount": 5000, "currency": "USD", "payment_type": "Unscheduled", "previous_payment_id": "pay_4hlqceyyib5ezpxtpdpwfhwtda", "merchant_initiated": true, "processing": { "merchant_initiated_reason": "delayed_charge" } } ``` If you do not provide a `previous_payment_id`: - Checkout.com automatically attempts to retrieve the payment ID from the initial CIT in the payment series. - If the fallback mechanism fails to find a payment ID, we attempt to apply relevant exemptions. > **Note** > > Do not use the fallback mechanism as your primary method of managing transaction IDs. MITs fall out of scope of SCA and qualify for exemption under the merchant-initiated exemption, which means 3DS authentication is not required. You can either set `3ds.enabled` to `false`, or omit it from the request. ### Response example ```json { "id": "pay_4prafl3phiyejkfrjtgzlh4kye", "action_id": "act_ep5277oczf7u7lg6hrsscbt6xy", "amount": 100, "currency": "USD", "approved": true, "status": "Authorized", "auth_code": "482LT5", "response_code": "10000", "response_summary": "Approved", "balances": { "total_authorized": 100, "total_voided": 0, "available_to_void": 100, "total_captured": 0, "available_to_capture": 100, "total_refunded": 0, "available_to_refund": 0 }, "risk": { "flagged": false }, "source": { "id": "src_y4pwpefkykre7ijbeyxjsxdkf4", "type": "card", "expiry_month": 12, "expiry_year": 2025, "scheme": "Visa", "last4": "4242", "fingerprint": "005D09BED0F110E7B3B13407DF0167F6E68C2FEFAB094D49DA4B4BFAE459C569", "bin": "424242", "card_type": "CREDIT", "card_category": "CONSUMER", "issuer": "Test Bank", "issuer_country": "GB", "product_id": "F", "product_type": "Visa Classic", "payment_account_reference": "" }, "processed_on": "2023-01-25T16:42:20.8748358Z", "reference": "ORD-5023-4E89", "scheme_id": "481108533665280", "processing": { "acquirer_transaction_id": "931228481108533665280", "retrieval_reference_number": "302516931228" }, "expires_on": "2023-02-01T16:42:20.8106477Z", "_links": { "self": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_fbfrj7f3bwou5bdgmzsryd223i" }, "actions": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_fbfrj7f3bwou5bdgmzsryd223i/actions" }, "redirect": { "href": "https://{prefix}.api.sandbox.checkout.com/redirect/act_y3oqhf46pyzuxjbcn2giaqnb44" } } } ``` > **Information** > > You may be able to automatically retry failed payments if you [configure scheduled retries](https://www.checkout.com/docs/payments/manage-payments/configure-scheduled-retries.md), or enable [automatic downtime retries](https://www.checkout.com/docs/payments/manage-payments/configure-scheduled-retries.md#Automatic_downtime_retries).