Customer's Cards (Tokenization)


Next Page: Technical Support
Previous Page: Transaction Re-Query

This section is only used for Tokenization using Cybersource & MPGS only. Cards can be saved using Customer details which include name, email, mobile_number and payment_type_id.

Get Customer Cards

This API is used to fetch all the saved cards of a customer.

Request Parameters

Field Type Description
name String Name of the customer
email String Email of the customer
mobile_number String Mobile number of the customer
payment_type_id Number In case you only want to fetch cards based on the payment type, you may use this. MPGS: 2, Cybersource: 5, Cybersource AMEX: 7

Request Snippet

$baseUrl = https://sandbox.hesabe.com
$customerCardApi = {{$baseUrl}}/api/customer-cards?name={{$name}}&email={{$email}}&mobile_number={{$mobileNumber}}&payment_type_id={{paymentTypeId}}
$customerCardRequestData = new Request();
$customerCardRequest = Request::create($customerCardApi, 'GET', $customerCardRequestData->all());
$customerCardRequest->headers->set('accessCode', $accessCode);
$customerCardRequest->headers->set('Accept', 'application/json');
$customerCardResponse = Route::dispatch($customerCardRequest);
$customerCardResponseContent = $customerCardResponse->content();

Response Sample

{
    "status": true,
    "message": "Customer's cards fetched successfully",
    "data": [
        {
            "id": "7nlnXXX",
            "card_number": "xxxxxxxxxxxx1111",
            "expiry": "1222",
            "brand": "VISA",
            "is_expired": false
        }
    ]
}

Response Parameters

Field Type Description
status Boolean Payment status (true - success; false - failure)
message String Response message
data JSON A JSON object of the transaction is found else null
id Alphanumeric Card id which can be used for tokenized transaction
card_number Alphanumeric Partial Card information
expiry Float Expiry of the card in format (MMYY)
brand String Card brand name such VISA, Mastercard, Amex

Delete Customer Card

This API is used to delete a saved card of a customer.

Request Parameters

Field Type Description
id String Card id of the customer

Request Snippet

$baseUrl = https://sandbox.hesabe.com
$customerCardApi = {{$baseUrl}}/api/customer-cards/{{$id}}
$customerCardRequestData = new Request();
$customerCardRequest = Request::create($customerCardApi, 'DELETE', $customerCardRequestData->all());
$customerCardRequest->headers->set('accessCode', $accessCode);
$customerCardRequest->headers->set('Accept', 'application/json');
$customerCardResponse = Route::dispatch($customerCardRequest);
$customerCardResponseContent = $customerCardResponse->content();

Response Sample

{
    "status": true,
    "message": "Customer's card removed successfully",
    "data": null
}

Response Parameters

Field Type Description
status Boolean Payment status (true - success; false - failure)
message String Response message
data JSON A JSON object of the transaction is found else null

{info} Please use the Sandbox URL and test merchant code for testing purposes and Production URL and LIVE merchant code for real transactions.






Next Page: Technical Support
Previous Page: MPGS