Remove a saved card
DELETE
Base URL
Sandbox Base URL
Strictly for sandbox testing. Never use the sandbox URL in your production environment.
https://sandbox.hesabe.com
Remove a saved card by its cardId. The token is deleted at MPGS first; only if MPGS confirms deletion is the card deactivated on Hesabe's side. Once removed, any charge-card call with that card_id will fail.
accessCode*stringPass the merchant access code issued by Hesabe
Content-Type*stringapplication/json
cardId*integerThe card_id received from VERIFY or GET /api/direct-payment/cards
application/json- body
data*stringConvert payload JSON object to encrypted string and send it to the server
Sample Encryption and Decryption Process:
The following steps demonstrate how to integrate with this API using sandbox credentials.
Step 1: Create JSON Object
{ "merchantCode": "842217"}Payload Details:
Contains the list of parameters and their corresponding values required to make the API request.
| Field Name | Description | Required |
|---|---|---|
merchantCode | Pass the merchant code provided by Hesabe | Yes |
Step 2: Convert the JSON object into an encrypted string format and post to Hesabe
{ "data": "0e7898bd7464d0c402fe8a949d9cbf9b826ccb9b83b56fa003373275f1947a65"}Step 3: Receive encrypted response from Hesabe:
{ "response": "60a8f6241932227b840a9f5e36987f4db903974d1c3d52c9477e081b7b7021a24e12d8167593b972419d1d00e26889ae4ab1235ca98f00197e09d3fcf7eca2aa0f0f8996bc23bb232e3c487734b61a82386eaa3a19bb821e39e58231c2270acd"}Step 4: Decrypt the API response and view the JSON output
{ "status": true, "code": 200, "message": "Card removed successfully", "response": null}Card removed successfully
application/json- response
status?booleancode?integermessage?stringresponse?unknownconst body = JSON.stringify({ "data": "0e7898bd7464d0c402fe8a949d9cbf9b826ccb9b83b56fa003373275f1947a65"})fetch("https://sandbox.hesabe.com/api/direct-payment/cards/2270", { method: "DELETE", headers: { "Content-Type": "application/json", "accessCode": "c333729b-d060-4b74-a49d-7686a8353481" }, body})Example Response
{ "status": true, "code": 200, "message": "Card removed successfully", "response": null}