Create Token
This service has the function of capturing the card data and returning a token in its place.
Environment | EndPoint | Method |
Development | POST | |
Production | POST |
Headers
Header | Value | Required |
Content-Type | application/json | Yes |
ALG-API-VERSION | API version to be used. Available values: 1618440906 | Yes |
Authorization | Bearer <Access_Token> | Yes |
"Content-Type":"application/json",
"ALG-API-VERSION":"1618440906",
"Authorization":"Bearer GciOiJSUzI1NsInR5cCI6IkpXVCIsImt.........",
Request
Parameter | Type | Long. | Description | Req. |
action | String | - | The intent of the merchant. In this case it is "tokenize". | Yes |
card.pan | String (N) | 20 | Cardholder's card number | Yes |
card.expiry_date | String (N) | 4 | Cardholder's card expiration date. MMYY Format. | Yes |
card.security_code | String (N) | 4 | Cardholder's Card Security Code. | Yes |
card_holder.first_name | String (AN) | 50 | Cardholder Name. | Yes |
card_holder.last_name | String (AN) | 50 | Cardholder's Last Name. | Yes |
card_holder.email_address | String (AN) | 60 | Cardholder's e-mail address. | Yes |
card_holder.identity_document_country | String (AN) | 2 | Country of the Cardholder's identity document in ISO format. | Yes |
card_holder.identity_document_type | String (AN) | 25 | Cardholder's ID type: DNI, CE, PASSPORT | Yes |
card_holder.identity_document_identifier | String (AN) | 25 | Cardholder's ID number. | Yes |
transaction.meta.internal_operation_number | String (N) | 9 | Internal merchant operation number. | Yes |
transaction.meta.additional_fields.user_id | String (AN) | 30 | Internal user identifier to the merchant | Yes |
{
"action":"tokenize",
"card":[
{
"pan":"4444444444444444",
"expiry_date":"1219",
"security_code":"123"
}
],
"card_holder":[
{
"first_name":"Foo",
"last_name":"Bar",
"email_address":"foo.bar@email.com",
"identity_document_country":"PER",
"identity_document_type":"DNI",
"identity_document_identifier":"12345678"
}
],
"transaction":{
"meta":{
"internal_operation_number":"000000001",
"additional_fields":{
"user_id":"foo-bar32"
}
}
}
}
Response
Parameter | Description |
action | Process performed, in this case is "tokenize". |
success | Result of the operation: True: processed successfully. False: not processed successfully. |
token.id | Token |
token.card.brand | Card brand. Possible values:
|
token.card.bin | Bin associated to the card. |
token.card.last_pan | Last 4 card numbers. |
token.card.issuer | Card issuer. Value subject to availability. |
token.creation_date | Token creation date. |
transaction.meta.commerce_id | Merchant ID. |
transaction.meta.internal_operation_number | Internal merchant operation number |
transaction.meta.status.code | Code associated with the operation status. |
transaction.meta.status.message_ilgn.locale | Regional settings defining language and country. |
transaction.meta.status.message_ilgn.value | Message resulting from the process. |
transaction.meta.additional_fields.user_id | Internal user identifier to the merchant. |
{
"action": "tokenize",
"success": true,
"transaction": {
"meta": {
"commerceId": "9011",
"internal_operation_number": "000000001",
"status": {
"code": "00",
"message_ilgn": [
{
"locale": "es_PE",
"value": "Token creado"
}
]
},
"additional_fields": { "user_id": "foo-bar32" }
}
},
"token": [
{
"id": "c35a-1d3b-3w9x-0051",
"card": {
"bin": "485951",
"last_pan": "0051",
"brand": "Visa",
"issuer": "BCP"
},
"creation_date": "1568399357390"
}
]
}
Continue to Consult Token ➡️