Card

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.

Request

1
2
3
4
5
6
7
8
9
10
PATCH /psp/creditcard/payments/instrumentData/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",
    "tokenType" : "recurrenceToken"
}

Response

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

{   
    "instrumentData": {
        "id": "/psp/creditcard/payments/instrumentData/5a17c24e-d459-4567-bbad-aa0f17a76119",
        "paymentToken": "5a17c24e-d459-4567-bbad-aa0f17a76119",
        "payeeId": "5cabf558-5283-482f-b252-4d58e06f6f3b",
        "isDeleted": true 
        "isPayeeToken": false,
        "cardBrand": "Visa",
        "maskedPan": "123456xxxxxx1111",
        "expiryDate": "MM/YYYY",
        "tokenType" : "recurrenceToken" 
    }
    
}

Delete unscheduledToken

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

Request

1
2
3
4
5
6
7
8
9
10
PATCH /psp/creditcard/payments/instrumentData/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",
    "tokenType" : "unscheduledToken"
}

Response

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

{   
    "instrumentData": {
        "id": "/psp/creditcard/payments/instrumentData/5a17c24e-d459-4567-bbad-aa0f17a76119",
        "paymentToken": "5a17c24e-d459-4567-bbad-aa0f17a76119",
        "payeeId": "5cabf558-5283-482f-b252-4d58e06f6f3b",
        "isDeleted": true 
        "isPayeeToken": false,
        "cardBrand": "Visa",
        "maskedPan": "123456xxxxxx1111",
        "expiryDate": "MM/YYYY",
        "tokenType" : "unscheduledToken" 
    }
    
}