Pine LabsDOCS

Generate Card Token

POST/api/v1/tokens

Generate 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.

Requires Bearer token. Get token →

Request Body

NameTypeDescription
customer_id
stringrequired

Unique identifier of the customer in the Pine Labs Online database.

merchant_token_reference
stringrequired

Idempotency Key. Unique token reference assigned by the merchant. Duplicate requests with the same merchant_token_reference will return the existing token instead of creating a new one.

payment_method
stringrequired

Payment method for which the token is being generated. Currently only CARD is supported.

Allowed values:
CARD
payment_option
object

An object that contains the payment option details.

encrypted_card_details
string

Encrypted card details.

payment
object

An object that contains the payment details.

acquirer_data
object

An object that contains the acquirer details.

merchant_metadata
object

Arbitrary key-value pairs for merchant use. Maximum 10 pairs, 256 characters each.

Status Codes

201Card token generated successfully.
400The request was malformed or missing required fields.
401Authentication failed — missing, expired, or invalid Bearer token.
403The authenticated client does not have permission for this operation.
500An unexpected error occurred on the server.
503Service temporarily unavailable.
Request
curl --request POST \
  --url https://pluraluat.v2.pinepg.in/api/v1/tokens \
  --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  --header 'Content-Type: application/json' \
  --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"
  }
}'

Run this request

201 Created
{
  "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"
}