Payment Methods
List saved payment methods for a customer
Retrieves the payment methods saved on a customer (e.g. cards stored via a
card-save link). Pass ?provider= to narrow to a single payment provider.
Required Scope
payment-methods-read
path Parameters
customerIdThe customer ID
query Parameters
providerFilter by payment provider
List saved payment methods for a customer › Responses
List of payment methods
idUnique identifier of the payment method
customerIdCustomer ID this payment method belongs to
providerPayment provider
labelHuman-readable label for the payment method
isDefaultWhether this is the default payment method for the customer
statusCurrent status of the payment method
createdAtWhen the payment method was created
cardMaskMasked card number
cardTypeCard type as reported by the provider
expiryMonthCard expiry month
expiryYearCard expiry year
Cancel a saved card on the payment provider
Cancels the card subscription on OnPay and marks it as cancelled. This cannot be undone.
Required Scope
payment-methods-write
path Parameters
customerIdThe customer ID
paymentMethodIdThe payment method ID to cancel
Headers
x-api-idempotency-keyOptional idempotency key for safely retrying mutating requests.
Cancel a saved card on the payment provider › Responses
Card cancelled
Unassign a payment method from a customer
Removes the link between the customer and the card. The card stays active on the provider and can be reassigned to another customer.
Required Scope
payment-methods-write
path Parameters
customerIdThe customer ID
paymentMethodIdThe payment method ID to unassign
Headers
x-api-idempotency-keyOptional idempotency key for safely retrying mutating requests.
Unassign a payment method from a customer › Responses
Payment method unassigned
Generate a link for the customer to save a card for future payments
Creates a payment window URL where the customer can enter their card details. The card is saved as a subscription for future charges. Send this URL to your customer.
Required Scope
payment-methods-write
path Parameters
customerIdThe customer ID
Headers
x-api-idempotency-keyOptional idempotency key for safely retrying mutating requests.
Generate a link for the customer to save a card for future payments › Request Body
providerPayment provider to use for saving the card
Generate a link for the customer to save a card for future payments › Responses
Payment link created
urlURL to the payment provider window. Send this to your customer.
expiresAtWhen the payment link expires
Set a saved payment method as the customer default
Marks this card as the default for the customer. It does not attach the card to any subscription: cards are attached to a subscription by the buyer with their consent, through a card-save link or the customer portal.
Required Scope
payment-methods-write
path Parameters
customerIdThe customer ID
paymentMethodIdThe payment method ID to set as default
Headers
x-api-idempotency-keyOptional idempotency key for safely retrying mutating requests.
Set a saved payment method as the customer default › Responses
Default updated