Skip to main content
Your agent never sees payment details. Card numbers, bank accounts and wallet tokens stay in the vault. Your agent only gets a reference ID that stands for the payment method. This matters because an agent’s context is logged, cached and replayed. A card number in the context ends up in every system that touches it. Keeping secrets in the vault keeps them out of reach.

Adding a payment method

A payment session lets a shopper add a payment method without the agent seeing it. Call create_payment_session with the shopper_id, the type (card, bank-account or digital-wallet) and a return_url.
Send the shopper to enrollmentUrl. They enter their details on a hosted page, then return to returnUrl. Check progress with get_payment_session: A payment session only adds the payment method. Charging happens later, at checkout.

Payment references

A payment reference is what your agent uses at checkout. It has enough to show the shopper which method it is, and nothing that could be used to pay.
Pass the reference’s id as payment_reference_id to create_checkout. The mandate the shopper approves names it as the payer. See Mandates and approval.