Palbase Payments · API
POST
/payments/me/methodsAdd saved payment method
Opens a PCI-safe card-saving flow (the provider's own page, or a Masterpass OTP link) and returns a NextAction. A channel whose provider keeps no card for the project (iyzico) answers setup_only_unsupported. 409 provider_customer_gone when the customer's record was deleted on the provider's own pages: it is let go of here, and calling again makes a new one.
Called by a signed-in user of your app, with their token and the publishable key.
Request body
cancel_urlstring · optionalAllowed cancel URL.channelstring · optionalOptional channel override.collect_billing_addressboolean · optionalAsk the billing address on the page and keep it in the customer's profile.make_defaultboolean · optionalMake the card the customer's default on its channel once it is saved. The first card saved is the default whatever is asked.phonestring · optionalPhone number for Masterpass card lookup.return_urlstring · optionalAllowed return URL.vaultstring · optionalOptional vault override (masterpass).curl
curl -X POST "https://<your-ref>.palbase.studio/payments/me/methods" \
-H "apikey: $PALBASE_PUBLISHABLE_KEY" \
-H "authorization: Bearer $USER_ACCESS_TOKEN" \
-H "content-type: application/json" \
-d '{"cancel_url":"string","channel":"string","collect_billing_address":false,"make_default":false,"phone":"string","return_url":"string","vault":"string"}'Responses
201Setup action created
defaultStandard Palbase JSON error envelope (`error` and `error_description`).
Operation AddMyMethod of payments's contract.