Getnet DocsGetnet Docs

Generate Network Token

POST/dpm/tsp/v1/tokenization/token

__Generate Network Token__<br><br>This endpoint requests a network token for a card directly from the card brand's Token Service Provider (TSP). A network token replaces the PAN with a brand-issued token you can use in place of the raw card number.<br><br>**Usage Scenarios:**<br>- Obtaining a network token to use instead of the raw card number in a payment.<br>- Preparing a card for a network-tokenized transaction that also requires a cryptogram.<br><br>**Notes:**<br>- Call [Generate Cryptogram](#tag/network-token/post/dpm/tsp/v1/tokenization/crypt) with the returned `network_token_id` to obtain the cryptogram required for the payment.<br>- The network token is issued by the card brand, not by Getnet's vault.

Body application/json

customer_idstring

Buyer identifier. Application-defined information that consumes the Digital Platform API.

emailstring

Buyer's email address.

card_brandstringrequired

Card brand of the PAN to tokenize with the card brand's Token Service Provider (TSP).

card_pan_sourcestringrequired

Source of the card data sent for tokenization.

card_panstringrequired

Card Number (PAN) to tokenize with the card brand's Token Service Provider (TSP).

security_codestringrequired

Security code. CVV or CVC.

expiration_monthstringrequired

Two-digit card expiration month.

expiration_yearstringrequired

Four-digit card expiration year.

Response

Network token generated successfully.

x_trace_idstring<uuid>

Trace identifier for the request. Use it when contacting Getnet support about this request.

network_token_idstring

Identifier of the network token issued by the card brand's Token Service Provider (TSP). Send it to Generate Cryptogram, and use it in the payment request's `card.number` field in place of the raw PAN.

token_statusstring

Status of the network token.

Invalid request.

messagestring

Detailed error message.

namestring

Name of the module or service that returned the error.

status_codeinteger<int32>

HTTP status code of the error.

detailsobject[]

Network tokenization error details.

Show details properties
statusstring

Error situation.

error_codestring

Error code.

descriptionstring

Short description of the error.

description_detailstring

Specific reason the network token or cryptogram request failed, naming the invalid field or the token service provider's denial reason.

Invalid Authentication.

messagestring

Detailed error message.

namestring

Name of the module or service that returned the error.

status_codeinteger<int32>

HTTP status code of the error.

detailsobject[]

Network tokenization error details.

Show details properties
statusstring

Error situation.

error_codestring

Error code.

descriptionstring

Short description of the error.

description_detailstring

Specific reason the network token or cryptogram request failed, naming the invalid field or the token service provider's denial reason.

Unprocessable Entity

messagestring

Detailed error message.

namestring

Name of the module or service that returned the error.

status_codeinteger<int32>

HTTP status code of the error.

detailsobject[]

Network tokenization error details.

Show details properties
statusstring

Error situation.

error_codestring

Error code.

descriptionstring

Short description of the error.

description_detailstring

Specific reason the network token or cryptogram request failed, naming the invalid field or the token service provider's denial reason.

Internal server or service error.

messagestring

Detailed error message.

namestring

Name of the module or service that returned the error.

status_codeinteger<int32>

HTTP status code of the error.

detailsobject[]

Network tokenization error details.

Show details properties
statusstring

Error situation.

error_codestring

Error code.

descriptionstring

Short description of the error.

description_detailstring

Specific reason the network token or cryptogram request failed, naming the invalid field or the token service provider's denial reason.

Request
curl -X POST "https://api.pre.globalgetnet.com/dpm/tsp/v1/tokenization/token" \
  -H "Content-Type: application/json" \
  -d '{
  "customer_id": "088442880012",
  "email": "[email protected]",
  "card_brand": "visa",
  "card_pan_source": "ON_FILE",
  "card_pan": "5204731600014784",
  "security_code": "681",
  "expiration_month": "12",
  "expiration_year": "2030"
}'
Response
{
  "x_trace_id": "0459e608-4445-4028-8667-e6e5b6d942df",
  "network_token_id": "d3ec0f0ff65a4ef4b65194cbf64d263f",
  "token_status": "ACTIVE"
}