Developers / Guides / Payments
Saved payment methods
Vault a customer's payment method once and reuse it for later charges, instead of asking them to re-enter card details every time — the same convenience as any "keep this card on file" checkout.
Two ways to save a method
Vault it directly
Call the payment-methods endpoint any time — useful for a "save my card" flow that isn't tied to a purchase.
Save while charging
Set saveForFutureUse: true
on a charge (with a customerId) and PayMidWare vaults the method used
right after the charge succeeds — best-effort, so a vaulting hiccup never fails a charge that
already went through.
Endpoints
| Endpoint | Purpose |
|---|---|
| POST /api/merchant-accounts/{ref}/customers | Create a customer to attach saved methods to. Returns a customerId; an optional accountNumber (unique per merchant) is your own number for the customer. |
| POST .../customers/{customerId}/payment-methods/{gateway} | Vault a payment method for that customer on a specific gateway. |
| GET .../customers/{customerId}/payment-methods | List a customer's saved methods (display metadata only — never the raw gateway token). |
| DELETE .../payment-methods/{id} | Remove a saved method. Always removed from PayMidWare's own records, even if the gateway-side delete fails. |
| POST /api/payments/charge | Pass savedPaymentMethodId instead of a raw token to charge a saved method. |
Manage saved methods for a specific customer from
the Portal too: /Merchants → your merchant → Customers → a customer.