# Save Card

## Save Card Overview

There are two ways to store credit card data:

1. **Customer Initiated**\
   On the Credit Card payment page there is an option to save the card. When the customer chooses the option, the credit card will be saved after the transaction is successfully authorized.
2. **Merchant Initiation**\
   In the payment initiation process, the merchant sends the card.storedOnFile parameter with the value TO\_BE\_STORED. This parameter becomes an indicator on the Finpay side to store the credit card after the transaction is successfully authorized.

Once the credit card data is stored, the merchant can initiate the payment with or without customer interaction. We call it [One Click Payment](/api-reference/finpay-pg/core-api/credit-card/advance-payment/save-card/transaction-using-stored-card/one-click-payment.md) and [Two Click Payment](/api-reference/finpay-pg/core-api/credit-card/advance-payment/save-card/transaction-using-stored-card/two-click-payment.md).

### Transaction Flow <a href="#transaction-flow" id="transaction-flow"></a>

{% @mermaid/diagram content="sequenceDiagram
opt Merchant Initiation
Merchant->>Merchant : add card.storedOnFile parameter with the value TO\_BE\_STORED
end
Merchant->>Finpay: 1. Request Credit Card Payment Initiation
Finpay->>Merchant: 2. Response Credit Card Payment Page Url
Merchant->>Finpay: 3. Redirect to Credit Card Payment Page Url
Customer->>Finpay: 4. Input Credit Card data
opt Customer Initiation
Customer->>Finpay: 5. Select "Save Card"
end
Finpay->>Finpay : 6. Card authorization process & save
Finpay->>Merchant : 7. Send Notification

```
Note over Merchant,Customer: One Click Payment
Merchant->>Finpay : 1. Request API Retrieve Stored Card
Finpay->>Merchant : 2. Response list of card & token
Merchant->>Finpay : 3. Request API One Click Payment
Finpay->>Merchant : 4. Response status of transaction
Note over Merchant,Customer: Two Click Payment
Merchant->>Finpay : 1. Request API Retrieve Stored Card
Finpay->>Merchant : 2. Response list of card & token
Customer->>Merchant : 3. Select credit card for payment
Merchant->>Finpay : 3. Request API Two Click Payment
Finpay->>Merchant: 2. Response Credit Card Payment Page Url
Merchant->>Finpay: 3. Redirect to Credit Card Payment Page Url
Customer->>Finpay: 4. Input Card Security Code
Finpay->>Finpay : 6. Card authorization process
Finpay->>Merchant : 7. Send Notification" %}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.finpay.id/api-reference/finpay-pg/core-api/credit-card/advance-payment/save-card.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
