API Reference
Enrolls a vaulted card for a network token with the card network. The Enrollment API invocation is intended to occur when there is an acceptable time window for the enrollment to be completed with the network and card issuer. In a checkout flow, where a new card is being vaulted, it is not recommended to enroll into NT prior to authorizing payments as the calls to the network and issuers require asynchronous callbacks.
When there is an acceptable time window for the enrollment to be completed with the network and card issuer, hence customers will receive multiple responses - Synchronous and Asynchronous.The synchronous response is returned immediately upon posting the enroll request. This response does not provide the final state of the request. A webhook will be invoked as the final state of the enrollment request is completed or the user can GET the network token by its ID to get its current state.
A network token cannot be used within a transaction unless it is in the ACTIVE state.
Provision network token response
Provision network token response
Bad Request
Not Found. Possible error codes:
declined
Unprocessable Entity. Possible error codes:
card-not-allowed
card-brand-not-supported
required-fields-missing
invalid-format
rejected
Internal Server Error
Provision network token response
POST /network-tokens HTTP/1.1
Host: calm.sandbox.verygoodsecurity.app
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 63
{
"pan_alias": "5573495XKjDP28V7312",
"exp_month": 7,
"exp_year": 24
}
{
"pan_alias": "9914040119524512000",
"network_token_last4": "2345",
"expires_at": "2023-12",
"state": "ACTIVE",
"created_at": "2019-05-15T12:30:45Z",
"updated_at": "2019-05-15T12:30:45Z",
"card": {
"last4": "0010",
"bin": "489537",
"expires_at": "2023-12",
"holder_info": {
"name": "Jane Doe",
"email": "[email protected]",
"number": "+1415-123-4567",
"billing_address": {
"name": "John Doe",
"company": "John Doe Company",
"address1": "555 Unblock Us St",
"address2": "M13 9PL",
"city": "New York",
"region": "CA",
"country": "US",
"postal_code": "12301",
"phone": "+14842634673"
}
}
}
}
Getting the network token will fetch the data for the provisioned network token and the card information.
VGS alias representing the PAN
9914040119524512000
Retrieve network token response
Not Found
Internal Server Error
Retrieve network token response
GET /network-tokens/{pan_alias} HTTP/1.1
Host: calm.sandbox.verygoodsecurity.app
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"pan_alias": "9914040119524512000",
"network_token_last4": "2345",
"expires_at": "2023-12",
"created_at": "2019-05-15T12:30:45Z",
"updated_at": "2019-05-15T12:30:45Z",
"state": "ACTIVE",
"card": {
"last4": "0010",
"bin": "489537",
"expires_at": "2023-12",
"holder_info": {
"name": "Jane Doe",
"email": "[email protected]",
"number": "+1415-123-4567",
"billing_address": {
"name": "John Doe",
"company": "John Doe Company",
"address1": "555 Unblock Us St",
"address2": "M13 9PL",
"city": "New York",
"region": "CA",
"country": "US",
"postal_code": "12301",
"phone": "+14842634673"
}
}
}
}
Invoking the delete API will delete a provisioned network token. The result of this operation leads to a token status update.
VGS alias representing the PAN
9914040119524512000
OK
Not Found
Internal Server Error
Delete network token response
DELETE /network-tokens/{pan_alias} HTTP/1.1
Host: calm.sandbox.verygoodsecurity.app
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"pan_alias": "9914040119524512000",
"created_at": "2019-05-15T12:30:45Z",
"updated_at": "2019-05-15T12:30:45Z",
"network_token_last4": "2345",
"state": "DELETED",
"expires_at": "2027-01",
"card": {
"last4": "1234",
"bin": "123456",
"expires_at": "2027-01"
}
}
Last updated