Customer Payment Methods
Customer Payment Methods represent chargeable payment methods like credit cards or direct debit mandates belonging to a customer. You can save them to Customer objects to store instrument details for future payments.
Endpoints
The Customer Payment Method object
Attributes
_id
Required
string
The ID of the payment method
primary
Required
boolean
Whether the payment method is primary
active
Required
boolean
Whether the payment method is primary
gatewayId
Required
string
The ID of the attached payment gateway or additional payment method
Optional Attributes
Collapse allExample
{"_id": "string","data": {},"paymentDetails": {},"primary": true,"active": true,"gatewayType": "stripe","gatewayId": "string","channels": [[]],"createdAt": "2030-01-23T23:00:00.123Z","updatedAt": "2030-01-23T23:00:00.123Z"}
Get payment methods for customer
Query
channel
Optional
string
Channel the methods are used for
primary
Optional
boolean
Whether the payment method is primary or not
active
Optional
boolean
Whether the payment method is active or not
gatewayId
Optional
string
The ID of the payment gateway or additional payment method which the payment method belongs to
paymentGatewayChannels
Optional
array<string>
The allowed payment gateway channels
Responses
200
OK
400
Bad Request
401
Unauthorized
get
/api/customers/{id}/payment-methods
Response
application/json
[{"_id": "string","data": {},"paymentDetails": {},"primary": true,"active": true,"gatewayType": "stripe","gatewayId": "string","channels": [[]],"createdAt": "2030-01-23T23:00:00.123Z","updatedAt": "2030-01-23T23:00:00.123Z"}]
Create a customer payment method
Payload
One of
Only one of the following types
gatewayId
Required
string
The ID of the payment gateway or additional payment method which the payment method belongs to
Optional Attributes
Collapse allResponses
201
Created
400
Bad Request
401
Unauthorized
post
/api/customers/{id}/payment-methods
{"data": {"iban": "string","bic": "string","accountHolderName": "string"},"gatewayId": "string"}
Response
application/json
{"_id": "string","data": {},"paymentDetails": {},"primary": true,"active": true,"gatewayType": "stripe","gatewayId": "string","channels": [[]],"createdAt": "2030-01-23T23:00:00.123Z","updatedAt": "2030-01-23T23:00:00.123Z"}
Set customer payment method to primary
Query
No supported query parameters
Responses
200
OK
400
Bad Request
401
Unauthorized
post
/api/customers/{customerId}/payment-methods/{paymentMethodId}/primary
Response
application/json
{"_id": "string","data": {},"paymentDetails": {},"primary": true,"active": true,"gatewayType": "stripe","gatewayId": "string","channels": [[]],"createdAt": "2030-01-23T23:00:00.123Z","updatedAt": "2030-01-23T23:00:00.123Z"}