Modifying a token
If you need to update details on an existing customer token you can use the modify endpoint. This allows you to change the customer's email address or mobile phone number associated with the token.
Modifying a customer token​
- Request
- Response
- Error
PUT /purchase/customer-tokens/916f7730-8d24-4dd9-9778-92b75b747382 HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
Content-Type: application/json
{
"email": "updated@example.com",
"mobilePhone": "+46701234567"
}
HttpStatusCode: 200 OK
/*
Example error. More errors available below.
*/
HttpStatusCode: 404 Not Found
{
"id": "fe8a21bb-6cb5-4d7d-b7f6-c0c335fc4593",
"error": {
"code": 404,
"message": "The resource requested was not found.",
"errors": []
}
}
Request Properties​
Request headers
| Header | Required | Explanation |
|---|---|---|
| Authorization | Yes | Instructions on how to generate the authorization header value can be found here. |
| Walley-Idempotency-Key | No | Instructions on how to use idempotency can be found here. |
Request body
| Property | Type | Required | Explanation |
|---|---|---|---|
| string | No | The new email address for the token's buyer. Must be a valid email address format. | |
| mobilePhone | string | No | The new mobile phone number for the token's buyer. |
note
All request body properties are optional. Include only the fields you wish to update.
There is no requirement that the provided values differ from the current ones — the request will be accepted regardless.
Important error responses​
| Error code | Cause |
|---|---|
| 400 | Invalid email address format |
| 401 | Incorrect, missing or expired bearer token |
| 403 | The customer token has been cancelled |
| 404 | The customer token was not found for the authenticated bearer token |
| 422 | Cannot modify buyer information: the token has no buyer |