---
title: "Save Card Details With Rapyd Checkout"
source_url: https://docs.rapyd.net/en/save-card-details-with-rapyd-checkout.html
lang: en
---

# Save Card Details With Rapyd Checkout

The Rapyd Checkout page allows you to save a customer’s card details when they make a payment. You can use the saved payment information for future payments.

The saved card information is tokenized, which follows PCI-DSS standards. This allows sensitive information to be stored safely. Saving card details using the Rapyd Checkout Page enables you to link the card details to the customer.

### Save Card Details With Rapyd Checkout Page Example

1. Enter your card information.

   ![save-card-details-rapyd-checkout-flow-1.png](image/img-f6d7e8b06794a82ef8835dd8e4a4d4f1.png)
2. (Optional): Click the **Save card for future payments** checkbox.
3. Click **Place Your Order** to complete the payment.
4. Redirect to the payment success page.
5. Click **Finish**.

### Save Card Details With Rapyd Checkout Page Workflow

![payment-links-flow-4.png](image/img-c122ff6b822a425ab191c3c9a759b86f.png)

1. You request Rapyd to generate a Hosted Checkout Page.
2. Rapyd processes your request and sends the response with the redirect URL.
3. You display the redirect URL to the customer.
4. The customer completes the payment on the hosted page.

### Card Payment Rapyd Checkout Message Sequences

The message sequence diagrams below describe how information is exchanged between Rapyd, the merchant, the merchant's customers, and the card network.

Card Payment Rapyd Checkout - Success

![checkout-card-success.svg](image/img-995e7025cd4dc51957e1aae39c02d83d.svg)

Card Payment Rapyd Checkout - Failure

![checkout-card---payment-declined.svg](image/img-197a9eb6736c469cc15f8fa74d701225.svg)

### How Saving Card Details With Rapyd Checkout Works

You need to complete the following steps in order to generate a Hosted Checkout Page:

1. [Create a Customer](https://docs.rapyd.net/en/create-customer.md "Create Customer") (API Integration or via the Client Portal)
2. Generate a Hosted Checkout Page (API Integration or via the Client Portal)

### Generating the Hosted Checkout Page

You must pass the customer ID (a string starting with **cus_**) in the request when generating the Hosted Checkout Page. This enables the card details to be saved for future payments.

Description of Body Parameters

See [Create Checkout Page](https://docs.rapyd.net/en/create-checkout-page.md "Create Checkout Page") for additional details about the parameters.

| Body Parameter | Required | Description |
| --- | --- | --- |
| amount | yes | The amount of the payment, in units of currency defined in **currency**. |
| country | yes | The two-letter ISO 3166-1 ALPHA-2 code for the country. |
| currency | yes | Three-letter ISO 4217 code for the currency. |
| customer | no | ID of the customer, a string starting with **cus_**.  **Note**: Must be included to enable the card details to be saved. |

### Create Checkout Page Request

- - Request

    - ```
      // Request URL: POST https://sandboxapi.rapyd.net/v1/checkout                                        
      // Message body: 
                                                  
      {
          "amount": 123.45,
          "complete_payment_url": "http://example.com/complete",
          "country": "GB",
          "currency": "GBP",
          "customer": "cus_ecfab8b87e2fa11d66b95cc1f2c94037",
          "error_payment_url": "http://example.com/error",
          "merchant_reference_id": "950ae8c6-78",
          "cardholder_preferred_currency": true,
          "language": "en",
          "metadata": {
              "merchant_defined": true
          },
                                                    
          "expiration": 1708498532,
          "payment_method_types_exclude": []
      }
      ```

### Create Checkout Page Response

[Create Checkout Page](https://docs.rapyd.net/en/create-checkout-page.md "Create Checkout Page") describes the fields in the response.

- - Response

    - ```
      {
          "status": {
              "error_code": "",
              "status": "SUCCESS",
              "message": "",
              "response_code": "",
              "operation_id": "47d0211e-9da3-4846-ae28-f7fc1d2438da"
          },
          "data": {
              "id": "checkout_0d7e080a7162c785ebcb8b416b1c0860",
              "status": "NEW",
              "language": "en",
              "merchant_color": null,
              "merchant_logo": null,
              "merchant_website": "https://www.rapyd.net",
              "merchant_customer_support": {},
              "merchant_alias": "N/A",
              "merchant_terms": null,
              "merchant_privacy_policy": null,
              "page_expiration": 1708565261,
              "redirect_url": "https://sandboxcheckout.rapyd.net/?token=checkout_0d7e080a7162c785ebcb8b416b1c0860",
              "merchant_main_button": "place_your_order",
              "cancel_checkout_url": "https://www.rapyd.net",
              "complete_checkout_url": "https://www.rapyd.net",
              "country": "GB",
              "currency": "GBP",
              "amount": 123.45,
              "payment": {
                  "id": null,
                  "amount": 123.45,
                  "original_amount": 0,
                  "is_partial": false,
                  "currency_code": "GBP",
                  "country_code": "GB",
                  "status": null,
                  "description": "Payment via Checkout",
                  "merchant_reference_id": "950ae8c6-78",
                  "customer_token": "cus_ecfab8b87e2fa11d66b95cc1f2c94037",
                  "payment_method": null,
                  "payment_method_data": {},
                  "expiration": 1708498532,
                  "captured": false,
                  "refunded": false,
                  "refunded_amount": 0,
                  "receipt_email": null,
                  "redirect_url": null,
                  "complete_payment_url": "http://example.com/complete",
                  "error_payment_url": "http://example.com/error",
                  "receipt_number": null,
                  "flow_type": null,
                  "address": null,
                  "statement_descriptor": null,
                  "transaction_id": null,
                  "created_at": 0,
                  "updated_at": 0,
                  "metadata": {
                      "merchant_defined": true
                  },
                  "failure_code": null,
                  "failure_message": null,
                  "paid": false,
                  "paid_at": 0,
                  "dispute": null,
                  "refunds": null,
                  "order": null,
                  "outcome": null,
                  "visual_codes": {},
                  "textual_codes": {},
                  "instructions": {},
                  "ewallet_id": null,
                  "ewallets": [],
                  "payment_method_options": {},
                  "payment_method_type": null,
                  "payment_method_type_category": null,
                  "fx_rate": null,
                  "merchant_requested_currency": null,
                  "merchant_requested_amount": null,
                  "fixed_side": null,
                  "payment_fees": null,
                  "invoice": null,
                  "escrow": null,
                  "group_payment": null,
                  "cancel_reason": null,
                  "initiation_type": null,
                  "mid": null,
                  "next_action": "not_applicable"
              },
              "payment_method_type": null,
              "payment_method_type_categories": null,
              "payment_method_types_include": null,
              "payment_method_types_exclude": [],
              "account_funding_transaction": null,
              "customer": "cus_ecfab8b87e2fa11d66b95cc1f2c94037",
              "custom_elements": {
                  "save_card_default": false,
                  "display_description": false,
                  "payment_fees_display": true,
                  "merchant_currency_only": false,
                  "billing_address_collect": false,
                  "dynamic_currency_conversion": false
              },
              "timestamp": 1707355661,
              "payment_expiration": null,
              "cart_items": [],
              "escrow": null,
              "escrow_release_days": null
          }
      }
      ```
