# Charge Later
source: https://developer.mastercard.com/mastercard-gateway/documentation/use-cases/charge-later/index.md

## Get paid using a saved card (token‑based payment) {#get-paid-using-a-saved-card-tokenbased-payment}

This flow allows you to charge a returning customer using a previously saved card token. It enables a fast and seamless checkout experience by removing the need for the customer to enter their card details again.

This approach is useful for retail, travel, and hospitality scenarios where customers frequently complete purchases using stored payment methods (for example, [card-on-file](https://developer.mastercard.com/mastercard-gateway/documentation/security-and-fraud/cred-file-transc/index.md)). The Mastercard Gateway resolves the stored token to the underlying payment credentials and processes the payment using the saved card details.

### Prerequisites {#prerequisites}

* A token already exists and is mapped to the payer.
* The token vault contains valid card credentials.
* The merchant has obtained consent to reuse the stored card in accordance with card-on-file requirements.

### Sequence diagram {#sequence-diagram}

Diagram get-paid-saved-card

### Workflow {#workflow}

1. The payer selects a previously saved card for the payment.
2. The merchant UI submits the payment request using the saved token to the merchant server.
3. The merchant server submits a PAY request containing the token to the Mastercard Gateway.
4. The Mastercard Gateway resolves the token to the associated payment credentials.
5. The token vault returns the payment credentials reference to the Mastercard Gateway.
6. The Mastercard Gateway submits the customer-initiated payment request to the acquirer.
7. The acquirer returns an approval or decline response to the Mastercard Gateway.
8. The Mastercard Gateway returns the payment result to the merchant server.
9. The merchant server displays the payment confirmation to the payer through the merchant UI.

### Endpoint {#endpoint}

|     API     | Format | HTTP Method |                                                                            Operation                                                                             |
|-------------|--------|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Transaction | NVP    | POST        | [Pay](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction:%20%20Pay.html?locale=en_US)                   |
|             | REST   | PUT         | [Pay](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction%3a%20%20Pay.html?locale=en_US)           |
|             | NVP    | POST        | [Authorize](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction%3a%20%20Authorize.html?locale=en_US)     |
|             | REST   | PUT         | [Authorize](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction:%20%20Authorize.html?locale=en_US) |

### Error resolution {#error-resolution}

For details on error resolution, explore our [Code and Formats](https://developer.mastercard.com/mastercard-gateway/documentation/code-and-formats/index.md) section.

## Set up subscriptions and recurring payments {#set-up-subscriptions-and-recurring-payments}

This use case shows how to set up and manage subscriptions or recurring payments using the Mastercard Gateway APIs.  

It explains how to:

* Collect customer consent for recurring [card-on-file](https://developer.mastercard.com/mastercard-gateway/documentation/security-and-fraud/cred-file-transc/index.md) payments.
* Take the first payment during an interactive checkout.
* Store the required references to process future recurring charges automatically.   

This flow is commonly used for subscription-based services, memberships, and recurring billing scenarios where payments are collected on a regular schedule.

### Prerequisites {#prerequisites-1}

* The payer has accepted the subscription terms and conditions.
* The merchant supports recurring payment agreements.
* Tokenisation is enabled if card reuse is required.

### Sequence diagram {#sequence-diagram-1}

Diagram setup-subs-rec-payment

### Workflow {#workflow-1}

1. The payer starts the subscription process and accepts the subscription terms.
2. The merchant UI submits the subscription request to the merchant server.
3. The merchant server creates a recurring payment agreement with the Mastercard Gateway.
4. The merchant server submits the initial payment request with the agreement reference and payment storage instruction.
5. The Mastercard Gateway sends the payment credentials to the token vault for tokenisation.
6. The token vault returns the payment token to the Mastercard Gateway.
7. The Mastercard Gateway processes the initial customer-initiated payment through the acquirer.
8. The acquirer returns the payment result to the Mastercard Gateway.
9. The Mastercard Gateway returns the payment result, agreement reference, and token to the merchant server.
10. The merchant server displays an active subscription confirmation in the merchant UI.
11. The merchant server stores the agreement reference and token for future recurring payments.

### Endpoint {#endpoint-1}

|     API     | Format | HTTP Method |                                                                            Operation                                                                             |
|-------------|--------|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Transaction | NVP    | POST        | [Pay](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction:%20%20Pay.html?locale=en_US)                   |
|             | REST   | PUT         | [Pay](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction%3a%20%20Pay.html?locale=en_US)           |
|             | NVP    | POST        | [Authorize](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction%3a%20%20Authorize.html?locale=en_US)     |
|             | REST   | PUT         | [Authorize](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction:%20%20Authorize.html?locale=en_US) |

* CREATE_AGREEMENT
* TOKENIZATION \> GENERATE TOKEN

### Error resolution {#error-resolution-1}

For details on error resolution, explore our [Code and Formats](https://developer.mastercard.com/mastercard-gateway/documentation/code-and-formats/index.md) section.

## Charge a customer without them being present (merchant‑initiated transaction) {#charge-a-customer-without-them-being-present-merchantinitiated-transaction}

This use case shows how to charge a customer when they are not present, using previously stored payment details and an existing customer agreement.  

It explains how to process [merchant-initiated transactions (MITs)](https://developer.mastercard.com/mastercard-gateway/documentation/security-and-fraud/cred-file-transc/index.md) that rely on consent captured during an earlier customer-initiated transaction.

This flow is commonly used for subscriptions, instalment payments, renewals, and usage-based billing.

The key difference from a standard checkout payment is that the merchant initiates the transaction rather than the customer. These payments depend on the customer's prior consent and the stored payment details associated with a [card-on-file](https://developer.mastercard.com/mastercard-gateway/documentation/security-and-fraud/cred-file-transc/index.md) arrangement.

### Prerequisites {#prerequisites-2}

* A valid `agreementId` exists from the initial card-on-file setup.
* A token is stored and linked to the payer.
* Stored credential indicators and customer consent have been recorded.
* Billing schedules and retry rules are configured.

### Sequence diagram {#sequence-diagram-2}

Diagram charge-cust-wo-present

### Workflow {#workflow-2}

1. The billing scheduler triggers a scheduled billing event for a renewal, instalment, or recurring charge.
2. The merchant server submits a merchant-initiated payment request containing the token, agreement reference, and stored credential indicators to the Mastercard Gateway.
3. The Mastercard Gateway validates the agreement reference and confirms that it is linked to the original card-on-file transaction.
4. The Mastercard Gateway resolves the token to the associated payment credentials.
5. The token vault returns the payment credentials reference to the Mastercard Gateway.
6. The Mastercard Gateway processes the merchant-initiated transaction through the acquirer.
7. The acquirer returns an approval or decline response to the Mastercard Gateway.
8. The Mastercard Gateway returns the payment result to the merchant server.
9. The merchant server updates the billing status and applies any configured retry logic.

### Endpoint {#endpoint-2}

|     API     | Format | HTTP Method |                                                                            Operation                                                                             |
|-------------|--------|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Transaction | NVP    | POST        | [Pay](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction:%20%20Pay.html?locale=en_US)                   |
|             | REST   | PUT         | [Pay](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction%3a%20%20Pay.html?locale=en_US)           |
|             | NVP    | POST        | [Authorize](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction%3a%20%20Authorize.html?locale=en_US)     |
|             | REST   | PUT         | [Authorize](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction:%20%20Authorize.html?locale=en_US) |

The request includes:

* `agreement.id`
* `token`
* Stored credential indicators for the merchant-initiated transaction

### Error resolution {#error-resolution-2}

For details on error resolution, explore our [Code and Formats](https://developer.mastercard.com/mastercard-gateway/documentation/code-and-formats/index.md) section.
