Card on file
Card on file lets you charge a customer's card again later without them re-entering details — for example for top-ups, usage billing, or other merchant-initiated transactions (MIT).
The flow has three steps:
1. Save the card on the first payment
On the customer's first (customer-initiated) payment, create the payment link with save_card set to "required" (always save the card), "optional" (the customer ticks a box) or "required_without_checkbox" (save it without showing the box). save_card is a string: a JSON boolean such as true returns 422, and sending save_card to Initiate Payment does nothing. Don't use hold_and_charge_later on this payment, because a held-then-captured payment never returns a card_id. The customer completes this payment as normal, including 3D Secure where required.
3DS is applied on the first payment onlyThe first payment is authenticated with 3DS per the usual rules. Subsequent merchant-initiated charges against the saved card run off-session and are not sent through 3DS again — the card was already verified on the first payment.
2. Read the card ID from the webhook
When that first payment succeeds, the payment.succeeded webhook contains the saved card's identifier under payment_method.card_id (nested inside the payment_method object — not a top-level field):
{
"event_type": "payment.succeeded",
"payment_method": {
"card_id": "CARD-XXXXXXXXXX",
"type": "CREDIT VISA",
"card_last4": "1111"
}
}Store card_id against your customer record. See the Payment object for the full payload.
3. Charge the saved card later (MIT)
To charge the saved card later, call Create payment with the card_id param. This is the merchant-initiated branch: the charge runs off-session and does not require customer presence or 3DS.
curl --location 'https://business.mamopay.com/manage_api/v1/payments' \
--header 'Authorization: Bearer <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{ "card_id": "CARD-XXXXXXXXXX", "amount": 25.00 }'
Saved cards are not shown in the dashboardThere is no dashboard view of saved cards — track
card_idvalues in your own system.
Updated 5 days ago