Overview #
The Delete Customer Token API allows merchants to delete a previously saved customer card token using the associated customerId and customerTokenId.
Once successfully deleted, the specified customer token can no longer be used for subsequent tokenized transactions.
Environment #
| Environment | Base URL |
|---|---|
| UAT | https://test.amwalpg.com:14443/ |
| Production | https://webhook.amwalpg.com/ |
Endpoint #
POST
/Customer/DeleteCustomerToken
Content Type #
application/json
Request #
Request Headers #
| Header | Required | Value |
|---|---|---|
Content-Type | Yes | application/json |
Request Method #
POST
Sample Request #
{
"merchantId": 7921,
"customerId": "ec5a28a6-9055-496b-9da8-5c68ff51f6f0",
"customerTokenId": "cbd1cc0f-ab41-4dca-a089-39e3d2294b30",
"secureHashValue": "6FB154BF8793CEF208663F19C3D1C0BC886DDAA198047936801E9C21C53574F3"
}
Request Parameters #
| Field | Required | Type | Constraints | Description | Example |
|---|---|---|---|---|---|
customerId | Yes | GUID | Maximum 32 characters | Customer ID associated with the registered token in the system. | 5ee9205ab53d45638b07f90507c2866d |
customerTokenId | Yes | GUID | Maximum 32 characters | Customer token ID that identifies the saved customer card token. | ea0a60d2e9be4c35b15a2a7f031a821f |
merchantId | Yes | Numeric | Maximum 30 characters | Merchant ID associated with the customer token. | 1345 |
secureHashValue | Yes | String | Maximum 256 characters | Secure hash value used to validate the integrity and authenticity of the request. | 3DB2F9CB975DADB533A2068F5C2911F9CCFF8AA0DFF3F92 |
Response #
Successful Response #
When the customer token is successfully deleted, the API returns success: true and response code 00.
Sample Success Response #
{
"success": true,
"responseCode": "00",
"message": "Success",
"data": null,
"errorList": []
}
Success Response Parameters #
| Field | Type | Description | Example |
|---|---|---|---|
success | Boolean | Indicates whether the token deletion was successful. | true |
responseCode | String | Response code returned by the API. | 00 |
message | String | Response message describing the result. | Success |
data | Object | Response data. This is null when the token is successfully deleted. | null |
errorList | String Array | List of errors. This should be empty for a successful response. | [] |
Failure Response #
If the customer token cannot be deleted, the API returns success: false along with a response code and an errorList describing the failure.
Sample Failure Response #
{
"success": false,
"message": "APGEX: A business exception occurred. Please contact your system administrator. 16b63ae8fcd9",
"responseCode": "61",
"data": null,
"errorList": [
"Token Not Found"
]
}
Failure Response Parameters #
| Field | Type | Description | Example |
|---|---|---|---|
success | Boolean | Indicates whether the token deletion was successful. | false |
responseCode | String | Response code returned by the API. | 61 |
message | String | Response or error message describing the failure. | Token Not Found |
data | Object | Response data. This is typically null when the request fails. | null |
errorList | String Array | List containing one or more errors describing the failure. | ["Token Not Found"] |
Common Failure Example #
Token Not Found #
{
"success": false,
"responseCode": "61",
"message": "APGEX: A business exception occurred. Please contact your system administrator. 16b63ae8fcd9",
"data": null,
"errorList": [
"Token Not Found"
]
}
The Token Not Found error indicates that the specified customerId and/or customerTokenId could not be found or does not correspond to a valid saved customer token.
Note: Ensure that the correct merchant credentials and environment-specific configuration are used when switching between UAT and Production.
Token Deletion Flow #
The Delete Customer Token process follows these steps:
- The merchant obtains the card
customerIdandcustomerTokenIdassociated with the saved customer card. - The merchant prepares a deletion request containing the required customer and merchant information.
- The merchant generates the required
secureHashValue. - The request is submitted to the
Customer/DeleteCustomerTokenendpoint. - The API validates the request and attempts to delete the specified customer token.
- If successful, the API returns response code
00and an emptyerrorList. - If the token cannot be found or the deletion fails, the API returns an appropriate failure response.
