Wallet
Storefront Wallet API endpoints
An API endpoint to setup token for payment method.
Request body
Setup payment method body
gateway_idoptionalintegerReturnsPaymentMethodSetup
Token required to setup payment method
tokenstringError responses
400objectThe gateway is an Authorize.Net gateway, which has no setup flow.
422objectgateway_id is missing or is not a gateway of the shop.
An API endpoint to get list of payment methods.
Query parameters
currency_codeoptionalstringCurrency ISO code
ReturnsPaymentMethod[]
Payment method object response
Error responses
401objectMissing or invalid customer token.
422objectcurrency_code is not a string, or expand is not an array of strings.
An API endpoint to store payment method.
Request body
Store payment method body
gateway_idRequiredintegertokenRequiredstringReturnsPaymentMethod
Payment method object response
Error responses
401objectMissing or invalid customer token.
422objectgateway_id is missing or is not a gateway of the shop, or token is missing or not a string.
An API endpoint to delete a customer payment method. The payment method is also detached on the payment gateway.
The last remaining payment method can only be deleted when the shop allows it and the customer has no active subscription, otherwise the request is rejected.
Path parameters
payment_method_idRequiredintegerPayment method ID
ReturnsPaymentMethod
The deleted payment method object
Error responses
400objectThe payment method does not belong to the customer, or it is the last one left and cannot be removed.
401objectMissing or invalid customer token.
404objectThe payment method does not exist or has already been deleted.
An API endpoint to make a payment method the customer default one.
Path parameters
payment_method_idRequiredintegerPayment method ID
ReturnsPaymentMethod
Payment method object response
Error responses
400objectThe payment method does not belong to the customer.
401objectMissing or invalid customer token.
404objectThe payment method does not exist.
422anyThe payment method cannot be made the default: it belongs to a test mode gateway, or it is a card that has expired.