Update Payment Method
Use this endpoint to update a customer's payment method. It is not possible to directly send payment information to the API. Instead, you must use a secure form for collecting payment information and pass the generated token to the API.
REST Endpoint
POST /restapi/v1/customers/:customerId/paymentMethod
Request Content Type
application/json
Request JSON Example
{
"billingAddress": {
"name": "Test Guy",
"company": "Some co",
"address1": "123 Place",
"address2": "",
"city": "Someplace",
"state": "UT",
"zip": "84117",
"country": "US"
},
"paymentMethod": {
"paymentMethodType": "usaepayCardToken",
"usaepayCardTokenId": "1234"
}
}
Explanation of Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
| billingAddress.name | string | true | Mailing address name |
| billingAddress.address1 | string | true | Mailing address line 1 |
| billingAddress.address2 | string | true | Mailing address line 2 |
| billingAddress.city | string | true | Mailing address city |
| billingAddress.state | string | true | Mailing address state/province (must be two-character code for US and CA) |
| billingAddress.zip | string | true | Sender zip or postal code |
| billingAddress.country | string | true | ISO two-character country code |
| paymentMethod | object | true | Object containing payment method token |
| paymentMethod.paymentMethodType | string | true | Must equal 'usaepayCardToken' |
| paymentMethod.usaepayCardTokenId | string | true | Token ID generated through secure payment form |
Response Status Code
200 OK
Response Content Type
application/json
Response JSON Example
{
"ok": true
}