# Accept Payment Details
source: https://developer.mastercard.com/mastercard-gateway/documentation/use-cases/accept-payment-details/index.md

## Save a card for future payments {#save-a-card-for-future-payments}

An online merchant can allow returning customers to pay faster by securely saving their card details during checkout. When the customer chooses to save their card, the merchant processes a payment or authorization transaction and instructs the Mastercard Gateway to store the card credentials. The gateway tokenises the card details and returns a gateway token, which the merchant stores against the customer's profile for use in future transactions.

### Prerequisites {#prerequisites}

* Tokenisation is enabled.
* A supported payment integration method is enabled.

### Sequence diagram {#sequence-diagram}

Diagram save-card-for-future-payment

### Workflow {#workflow}

1. The payer selects the option to save their card during checkout.
2. The merchant UI submits the payment request and card storage preference to the merchant server.
3. The merchant server submits a payment or authorization request with instructions to store the card credentials.
4. The Mastercard Gateway sends the card credentials to the token vault for tokenisation.
5. The token vault returns a gateway token to the Mastercard Gateway.
6. The Mastercard Gateway returns the payment result and gateway token to the merchant server.
7. The merchant server sends the payment success result and saved card status to the merchant UI.
8. The merchant server stores the gateway token against the customer's profile for future transactions.

### 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)                                  |
| Tokenization | NVP    | POST        | [Create or Update Token](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Tokenization:%20%20Create%20or%20Update%20Token.html?locale=en_US)       |
|              | REST   | PUT         | [Create or Update Token](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Tokenization:%20%20Create%20or%20Update%20Token.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.

## Save payment details without charging {#save-payment-details-without-charging}

This flow allows a merchant to collect and securely store a customer's card details in advance using the Mastercard Gateway, without charging the customer. The merchant verifies the payment method and, upon successful verification, the gateway tokenises the card details and returns a token. The merchant can then reuse the saved payment method for future transactions, including both on-session and off-session payments.

### Prerequisites {#prerequisites-1}

* Tokenisation is enabled.
* A supported payment integration method is enabled.
* The merchant profile supports payment method verification.

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

Diagram save-pay-details-wo-charge

### Workflow {#workflow-1}

1. The payer adds a payment method without making a purchase.
2. The merchant UI submits the card details or hosted session data to the merchant server.
3. The merchant server submits a VERIFY request to the Mastercard Gateway.
4. The Mastercard Gateway sends a payment method verification request to the acquirer.
5. The acquirer returns the verification outcome to the Mastercard Gateway.
6. The Mastercard Gateway sends the verified card details to the token vault for tokenisation.
7. The token vault returns a gateway token to the Mastercard Gateway.
8. The Mastercard Gateway returns the verification result and gateway token to the merchant server.
9. The merchant server displays a card saved confirmation in the merchant UI.

|     API      | Format | HTTP Method |                                                                                             Operation                                                                                             |
|--------------|--------|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Session      | NVP    | POST        | [Create Session](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Session:%20Create%20Session.html?locale=en_US)                                   |
|              | REST   | POST        | [Create Session](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Session:%20Create%20Session.html?locale=en_US)                             |
| Transaction  | NVP    | POST        | [Verify](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Transaction:%20%20Verify.html?locale=en_US)                                              |
|              | REST   | PUT         | [Verify](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Transaction:%20%20Verify.html?locale=en_US)                                        |
| Tokenization | NVP    | POST        | [Create or Update Token](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/nvp/version/100/operation/Tokenization:%20%20Create%20or%20Update%20Token.html?locale=en_US)       |
|              | REST   | PUT         | [Create or Update Token](https://mtf.gateway.mastercard.com/api/documentation/apiDocumentation/rest-json/version/100/operation/Tokenization:%20%20Create%20or%20Update%20Token.html?locale=en_US) |

### 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.
