Generate Card Token
/api/v1/tokensGenerate a network token for a card linked to a customer. This tokenizes the card details and returns a token that can be used for subsequent transactions.
Bearer token. Get token →Header Parameters
| Field | Details |
|---|---|
Request-Timestampstringdate-time | ISO 8601 UTC timestamp of the request. Used for idempotency and audit. |
Request-IDstring | Use a global unique identifier [GUID] for the request. Constraints Minimum length: 1 characterMaximum length: 50 characters |
Request Bodyrequired
| Field | Details |
|---|---|
customer_idstringrequired | Unique identifier of the customer in the Pine Labs Online database. Constraints Maximum length: 50 characters |
merchant_token_referencestringrequired | Idempotency Key. Unique token reference assigned by the merchant. Duplicate requests with the same Constraints Maximum length: 50 characters |
payment_methodstringrequired | Payment method for which the token is being generated. Currently only CARD is supported. Allowed values: CARD |
payment_optionobject1 nested field | An object that contains the payment option details. |
paymentobject1 nested field | An object that contains the payment details. |
merchant_metadataobject | Arbitrary key-value pairs for merchant use. Maximum 10 pairs, 256 characters each. Constraints Maximum properties: 10 Additional properties: string · Maximum length: 256 characters |
Status Codes
201 | Card token generated successfully. |
400 | The request was malformed or missing required fields. |
401 | Authentication failed — missing, expired, or invalid Bearer token. |
403 | The authenticated client does not have permission for this operation. |
500 | An unexpected error occurred on the server. |
503 | Service temporarily unavailable. |
curl --request POST \
--url https://pluraluat.v2.pinepg.in/api/v1/tokens \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--header 'Request-ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890' \
--header 'Request-Timestamp: 2024-10-01T10:30:00Z' \
--data '{
"customer_id": "cust-v1-0811030624-aa-RBDgpR",
"merchant_token_reference": "token-ref-001",
"payment_method": "CARD",
"payment_option": {
"encrypted_card_details": "akdsdsdsh12k12h1k21h2khakshakhakshkh121h2k1hak"
},
"payment": {
"acquirer_data": {
"approval_code": "030376",
"acquirer_reference": "202455840588334",
"rrn": "419335023601",
"auth_reference": "AUTH12345678"
}
},
"merchant_metadata": {
"clientId": "DD",
"transactionReferenceNo": "pine-1223",
"merchantId": "1234",
"tid": "9000990",
"acquirerName": "HDFC_FSS",
"isOfferDisplayRequired": "true",
"OfferData": "UHJvZHVjdF9Db2RlPSIgIiZQcm9kdWN0X05hbWU9IiImUGF5bWVudF9Nb2RlPUJhbmsgRU1JJkNhcmRfVHlwZT1EZWJpdCBDYXJkJkJhbmtfTmFtZT1IREZDIERlYml0JkVNSV9UZW51cmU9NiZJbnRlcmVzdF9SYXRlPTkuMCZJbnRlcmVzdF9BbW91bnQ9MTM4MTQwJk1vbnRobHlfSW5zdGFsbG1lbnQ9ODk0NjkwJkF1dGhvcml6YXRpb25fQW1vdW50PTEwMCZMb2FuX2Jvb2tpbmdfQW1vdW50PTUyMzAwMDAmSW50ZXJlc3RfQ2FzaGJhY2tfQW1vdW50PTAmSW50ZXJlc3RfQ2FzaGJhY2tfVHlwZT1EZWZlcnJlZCZBZGRpdGlvbmFsX0Nhc2hiYWNrPSIiJkFkZGl0aW9uYWxfQ2FzaGJhY2tfVHlwZT0iIiZEZXNjcmlwdGlvbj1CYW5rIEVNSSZQcm9kdWN0X1ZhbHVlPTUyMzAwMDA",
"tenant_id": "PGATPOS",
"is_offer_validation_required": "true"
}
}'{
"token_id": "token-v1-1234567890-aa-ABCDEF",
"customer_id": "cust-v1-0811030624-aa-RBDgpR",
"merchant_token_reference": "token-ref-001",
"status": "ACTIVE",
"created_at": "2024-10-04T13:11:29.645591Z",
"updated_at": "2024-10-04T13:11:29.645657Z"
}