Palbase Payments · API
/payments/customers/{customer_id}/methodsAdd a saved payment method for a payer
Opens the provider's own page that saves a card for the payer, nothing charged, and returns it as a NextAction to send whoever holds the card to. The card is listed once the provider tells it saved. A channel whose provider keeps no card for the project (iyzico) answers setup_only_unsupported before the provider is asked anything. When this call makes the payer's record at the provider and the provider refuses a part of the payer's profile, it answers tax_id_invalid or billing_address_invalid and opens no page: write the profile again, then call again. Opened by an environment's token, the page saves a card no later than the token ends. An email or phone the provider finds malformed is left off the record and told the same way (invalid_request). A profile the provider refuses for another reason of its own is told the same way, on every call, until the profile is written again as the provider takes it; the payer's payments go on meanwhile. 409 provider_customer_gone when the payer's record was deleted on the provider's own pages: it is let go of here, and calling again makes a new one. 503 provider_unavailable when the provider could not be asked to write the payer's profile on a record it just made: the record is kept, and calling again writes it. With require_terms the page asks whoever saves the card to agree to the provider account's terms of service.
Called by your server, with the project's secret key.
Path
customer_idstring · requiredThe payer's id: a user id, or any name of 1 to 128 characters the project's server gives a company or a team. Escape it as a path segment.Request body
cancel_urlstring · optionalAllowed cancel URL (default: return_url).channelstring · optionalOptional channel override.collect_billing_addressboolean · optionalAsk the billing address on the page and keep it in the payer's profile.make_defaultboolean · optionalMake the card the payer's default on its channel once it is saved. The first card saved is the default whatever is asked.return_urlstring · requiredAllowed return URL the page sends the cardholder back to.require_termsboolean · optionalHave whoever saves the card agree, on the provider's page, to the terms of service the provider account's public details name (Stripe: Checkout's consent_collection; the account must have a terms of service URL set): their word that the card may be charged with nobody at the screen.curl -X POST "https://<your-ref>.palbase.studio/payments/customers/<customer_id>/methods" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"return_url":"string"}'Responses
201Card page opened
defaultStandard Palbase JSON error envelope (`error` and `error_description`).
Operation AddCustomerMethod of payments's contract.