Update payment method

Update a payment method for the authenticated customer — set it as default and/or update its card details via the active gateway. Provide either is_default or payment_gateway; when payment_gateway is given, exp_month and exp_year are required (plus gateway-specific fields).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Overview

Update a payment method for the authenticated customer — set it as the default and/or update its card details through the active gateway. Returns the updated payment method (with a setup_intent when extra authentication is required).

Example:

curl --request PUT \
  --url 'https://www.pelcro.com/api/v1/sdk/payment_methods/1019?site_id=1232' \
  --header 'Authorization: Bearer <JWT>' \
  --header 'Content-Type: application/json' \
  --data '{ "is_default": true }'

Conditional Requirements

  • Provide either is_default or payment_gateway — one of the two is required.
  • When payment_gateway is provided, exp_month and exp_year are required, plus gateway-specific fields (token for Braintree, cybersource_token for Cybersource, paypageRegistrationId/type/lastFour for Vantiv).
Path Params
int32
required

The unique identifier of the payment method.

Query Params
int32
required

The unique identifier of the site associated with your account.

Body Params
boolean

Set this payment method as the customer’s default. Required when payment_gateway is not provided.

string
enum

Active payment gateway (stripe, braintree, cybersource, vantiv). Required when is_default is not provided.

Allowed:
string

Card expiry month MM. Required when payment_gateway is provided.

string

Card expiry year YYYY (must be in the future). Required when payment_gateway is provided.

string

Required when payment_gateway is braintree.

string

Required when payment_gateway is cybersource.

string

Required when payment_gateway is vantiv.

string

Required when payment_gateway is vantiv.

string

Required when payment_gateway is vantiv.

Responses

Language
Credentials
Query
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json