Payment Menu

Delete Token

schedule 1 min read

How to delete tokens.

Edit "Delete Token" on GitHub

Delete recurrenceToken

Payers should be able to delete payment tokens that are associated to them. How to delete a recurrenceToken is described in the example below. Note that the value of state must be Deleted when deleting the token. No other states are supported.

Delete Token Request

Request

1
2
3
4
5
6
7
8
9
PATCH /psp/paymentorders/recurrenceTokens/5a17c24e-d459-4567-bbad-aa0f17a76119 HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json

{
    "state": "Deleted",
    "comment": "Comment on why the deletion is happening"
}

Delete Token Response

Response

1
2
3
4
5
6
7
8
HTTP/1.1 200 OK
Content-Type: application/json

{   
    "token": "5a17c24e-d459-4567-bbad-aa0f17a76119",
    "isDeleted": true
    
}

Delete unscheduledToken Request

Request

1
2
3
4
5
6
7
8
9
PATCH /psp/paymentorders/unscheduledTokens/5a17c24e-d459-4567-bbad-aa0f17a76119 HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json

{
    "state": "Deleted",
    "comment": "Comment on why the deletion is happening"
}

Delete unscheduledToken Response

The example shows a token connected to a card. The instrument parameters and display name will vary depending on the instrument.

Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
HTTP/1.1 200 OK
Content-Type: application/json

{   
    
    "token": "5a17c24e-d459-4567-bbad-aa0f17a76119", 
    "instrument": "CreditCard",
    "instrumentDisplayName": "123456xxxxxx1111"
    "instrumentParameters": {
        "cardBrand": "Visa",
        "expiryDate": "MM/YYYY"
    }
    
}