Card on file
Creates a verified token
Methods
POST
Creates a token only if the supplied payload can be verified
Request
Copied!
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"paymentInstrument": {
"oneOf": [
{
"properties": {
"type": {
"const": "card/plain"
},
"cardNumber": {
"type": "string",
"minLength": 10,
"maxLength": 19,
"pattern": "^[0-9]*$"
},
"cardExpiryDate": {
"type": "object",
"properties": {
"month": {
"type": "integer",
"minimum": 1,
"maximum": 12
},
"year": {
"type": "integer",
"maximum": 9999
}
},
"required": [
"month",
"year"
]
},
"cvc": {
"type": "string",
"minLength": 3,
"maxLength": 4,
"pattern": "^[0-9]*$"
},
"cardHolderName": {
"$ref": "#/definitions/cardHolderName"
},
"billingAddress": {
"$ref": "#/definitions/billingAddress"
}
},
"additionalProperties": false,
"required": [
"type",
"cardNumber",
"cardExpiryDate",
"cardHolderName"
]
},
{
"properties": {
"type": {
"const": "card/checkout"
},
"sessionHref": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/verifiedTokens/sessions/.*$"
},
"cardHolderName": {
"$ref": "#/definitions/cardHolderName"
},
"billingAddress": {
"$ref": "#/definitions/billingAddress"
}
},
"additionalProperties": false,
"required": [
"type",
"sessionHref",
"cardHolderName"
]
}
]
},
"merchant": {
"type": "object",
"properties": {
"entity": {
"type": "string"
}
},
"required": [
"entity"
]
},
"verificationCurrency": {
"type": "string",
"pattern": "^[A-Z]*$",
"minLength": 3,
"maxLength": 3
},
"description": {
"type": "string",
"minLength": 1,
"maxLength": 255,
"pattern": "^[^&<]*$"
},
"tokenExpiryDateTime": {
"type": "string",
"format": "date-time"
},
"namespace": {
"type": "string",
"minLength": 1,
"maxLength": 64
}
},
"required": [
"paymentInstrument",
"merchant",
"verificationCurrency"
],
"definitions": {
"billingAddress": {
"type": "object",
"properties": {
"address1": {
"type": "string"
},
"address2": {
"type": "string"
},
"address3": {
"type": "string"
},
"postalCode": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
},
"countryCode": {
"type": "string",
"pattern": "^[A-Z]*$",
"minLength": 2,
"maxLength": 2
}
},
"required": [
"address1",
"postalCode",
"city",
"countryCode"
]
},
"cardHolderName": {
"type": "string",
"minLength": 1,
"maxLength": 255
}
}
}
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "paymentInstrument": { "oneOf": [ { "properties": { "type": { "const": "card/plain" }, "cardNumber": { "type": "string", "minLength": 10, "maxLength": 19, "pattern": "^[0-9]*$" }, "cardExpiryDate": { "type": "object", "properties": { "month": { "type": "integer", "minimum": 1, "maximum": 12 }, "year": { "type": "integer", "maximum": 9999 } }, "required": [ "month", "year" ] }, "cvc": { "type": "string", "minLength": 3, "maxLength": 4, "pattern": "^[0-9]*$" }, "cardHolderName": { "$ref": "#/definitions/cardHolderName" }, "billingAddress": { "$ref": "#/definitions/billingAddress" } }, "additionalProperties": false, "required": [ "type", "cardNumber", "cardExpiryDate", "cardHolderName" ] }, { "properties": { "type": { "const": "card/checkout" }, "sessionHref": { "type": "string", "pattern": "^https://try.access.worldpay.com/verifiedTokens/sessions/.*$" }, "cardHolderName": { "$ref": "#/definitions/cardHolderName" }, "billingAddress": { "$ref": "#/definitions/billingAddress" } }, "additionalProperties": false, "required": [ "type", "sessionHref", "cardHolderName" ] } ] }, "merchant": { "type": "object", "properties": { "entity": { "type": "string" } }, "required": [ "entity" ] }, "verificationCurrency": { "type": "string", "pattern": "^[A-Z]*$", "minLength": 3, "maxLength": 3 }, "description": { "type": "string", "minLength": 1, "maxLength": 255, "pattern": "^[^&<]*$" }, "tokenExpiryDateTime": { "type": "string", "format": "date-time" }, "namespace": { "type": "string", "minLength": 1, "maxLength": 64 } }, "required": [ "paymentInstrument", "merchant", "verificationCurrency" ], "definitions": { "billingAddress": { "type": "object", "properties": { "address1": { "type": "string" }, "address2": { "type": "string" }, "address3": { "type": "string" }, "postalCode": { "type": "string" }, "city": { "type": "string" }, "state": { "type": "string" }, "countryCode": { "type": "string", "pattern": "^[A-Z]*$", "minLength": 2, "maxLength": 2 } }, "required": [ "address1", "postalCode", "city", "countryCode" ] }, "cardHolderName": { "type": "string", "minLength": 1, "maxLength": 255 } } }
Responses
Response schema
Copied!
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"outcome": {
"const": "verified"
},
"_links": {
"type": "object",
"properties": {
"verifications:verification": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/verifications/accounts/.*$"
}
}
},
"tokens:token": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/tokens/.*$"
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"pattern": "^https://try.access.worldpay.com/rels/.*$"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
}
},
"required": [
"verifications:verification",
"tokens:token",
"curies"
]
}
},
"required": [
"_links",
"outcome"
]
}
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "outcome": { "const": "verified" }, "_links": { "type": "object", "properties": { "verifications:verification": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/verifications/accounts/.*$" } } }, "tokens:token": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/tokens/.*$" } } }, "curies": { "type": "array", "items": { "type": "object", "properties": { "href": { "pattern": "^https://try.access.worldpay.com/rels/.*$" }, "name": { "type": "string" }, "templated": { "type": "boolean" } } } } }, "required": [ "verifications:verification", "tokens:token", "curies" ] } }, "required": [ "_links", "outcome" ] }
Response schema
Copied!
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"outcome": {
"const": "verified"
},
"_links": {
"type": "object",
"properties": {
"verifications:verification": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/verifications/accounts/.*$"
}
}
},
"tokens:token": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/tokens/.*$"
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"pattern": "^https://try.access.worldpay.com/rels/.*$"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
}
},
"required": [
"verifications:verification",
"tokens:token",
"curies"
]
}
},
"required": [
"_links",
"outcome"
]
}
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "outcome": { "const": "verified" }, "_links": { "type": "object", "properties": { "verifications:verification": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/verifications/accounts/.*$" } } }, "tokens:token": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/tokens/.*$" } } }, "curies": { "type": "array", "items": { "type": "object", "properties": { "href": { "pattern": "^https://try.access.worldpay.com/rels/.*$" }, "name": { "type": "string" }, "templated": { "type": "boolean" } } } } }, "required": [ "verifications:verification", "tokens:token", "curies" ] } }, "required": [ "_links", "outcome" ] }
Response schema
Copied!
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"outcome": {
"const": "verified"
},
"_links": {
"type": "object",
"properties": {
"verifications:verification": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/verifications/accounts/.*$"
}
}
},
"tokens:token": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/tokens/.*$"
}
}
},
"tokens:conflicts": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/tokens/.*$"
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"pattern": "^https://try.access.worldpay.com/rels/.*$"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
}
},
"required": [
"verifications:verification",
"tokens:token",
"tokens:conflicts",
"curies"
]
}
},
"required": [
"_links",
"outcome"
]
}
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "outcome": { "const": "verified" }, "_links": { "type": "object", "properties": { "verifications:verification": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/verifications/accounts/.*$" } } }, "tokens:token": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/tokens/.*$" } } }, "tokens:conflicts": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/tokens/.*$" } } }, "curies": { "type": "array", "items": { "type": "object", "properties": { "href": { "pattern": "^https://try.access.worldpay.com/rels/.*$" }, "name": { "type": "string" }, "templated": { "type": "boolean" } } } } }, "required": [ "verifications:verification", "tokens:token", "tokens:conflicts", "curies" ] } }, "required": [ "_links", "outcome" ] }
Response schema
Copied!
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"outcome": {
"const": "not verified"
},
"_links": {
"type": "object",
"properties": {
"verifications:verification": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/verifications/accounts/.*$"
}
}
},
"tokens:token": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/tokens/.*$"
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"pattern": "^https://try.access.worldpay.com/rels/.*$"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
}
},
"required": [
"verifications:verification",
"tokens:token",
"curies"
]
}
}
}
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "outcome": { "const": "not verified" }, "_links": { "type": "object", "properties": { "verifications:verification": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/verifications/accounts/.*$" } } }, "tokens:token": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/tokens/.*$" } } }, "curies": { "type": "array", "items": { "type": "object", "properties": { "href": { "pattern": "^https://try.access.worldpay.com/rels/.*$" }, "name": { "type": "string" }, "templated": { "type": "boolean" } } } } }, "required": [ "verifications:verification", "tokens:token", "curies" ] } } }
Response schema
Copied!
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"outcome": {
"const": "not verified"
},
"_links": {
"type": "object",
"properties": {
"verifications:verification": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/verifications/accounts/.*$"
}
}
},
"tokens:token": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/tokens/.*$"
}
}
},
"tokens:conflicts": {
"type": "object",
"properties": {
"href": {
"type": "string",
"pattern": "^https://try.access.worldpay.com/tokens/.*$"
}
}
},
"curies": {
"type": "array",
"items": {
"type": "object",
"properties": {
"href": {
"pattern": "^https://try.access.worldpay.com/rels/.*$"
},
"name": {
"type": "string"
},
"templated": {
"type": "boolean"
}
}
}
}
},
"required": [
"verifications:verification",
"tokens:token",
"tokens:conflicts",
"curies"
]
}
}
}
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "outcome": { "const": "not verified" }, "_links": { "type": "object", "properties": { "verifications:verification": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/verifications/accounts/.*$" } } }, "tokens:token": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/tokens/.*$" } } }, "tokens:conflicts": { "type": "object", "properties": { "href": { "type": "string", "pattern": "^https://try.access.worldpay.com/tokens/.*$" } } }, "curies": { "type": "array", "items": { "type": "object", "properties": { "href": { "pattern": "^https://try.access.worldpay.com/rels/.*$" }, "name": { "type": "string" }, "templated": { "type": "boolean" } } } } }, "required": [ "verifications:verification", "tokens:token", "tokens:conflicts", "curies" ] } } }
Examples
Creating a new token for cardOnFile transactions when supplying all the payment instrument details.
Matching an existing token for cardOnFile transactions when supplying all the payment instrument details.
Conflicting with an existing token for cardOnFile transactions when supplying all the payment instrument details.
Payload cannot be verified for cardOnFile transactions when supplying all the payment instrument details. An unverified token has been created.
Payload cannot be verified for cardOnFile transactions when supplying all the payment instrument details. An unverified token has been matched.
Payload cannot be verified for cardOnFile transactions when supplying all the payment instrument details. An unverified token with conflicts has been returned.
Creating a new token for cardOnFile transactions using a session created by the access checkout SDK.
Matching a token for cardOnFile transactions using a session created by the access checkout SDK.
Conflicts with an existing token for cardOnFile transactions using a session created by the access checkout SDK.
Payload cannot be verified for cardOnFile transactions using a session created by the access checkout SDK. An unverified token has been created.
Payload cannot be verified for cardOnFile transactions using a session created by the access checkout SDK. An unverified token has been matched.
Payload cannot be verified for cardOnFile transactions using a session created by the access checkout SDK. An unverified token with conflicts has been returned.
Link relationship
verifiedTokens:cardOnFile
The top-level resource for creating card on file verified tokens
resourceTree
A document showing possible interactions with the Verified Tokens service
Creating a new token for cardOnFile transactions when supplying all the payment instrument details.
POSThttps://try.access.worldpay.com/verifiedTokens/cardOnFile
Copied!
{
"Accept": "application/vnd.worldpay.verified-tokens-v1.hal+json",
"Content-type": "application/vnd.worldpay.verified-tokens-v1.hal+json"
}
{ "Accept": "application/vnd.worldpay.verified-tokens-v1.hal+json", "Content-type": "application/vnd.worldpay.verified-tokens-v1.hal+json" }
Copied!
{
"paymentInstrument": {
"type": "card/plain",
"cardHolderName": "Test name",
"cardExpiryDate": {
"month": 10,
"year": 2030
},
"cardNumber": "4444333322221111",
"cvc": "123"
},
"merchant": {
"entity": "test-reference"
},
"verificationCurrency": "GBP"
}
{ "paymentInstrument": { "type": "card/plain", "cardHolderName": "Test name", "cardExpiryDate": { "month": 10, "year": 2030 }, "cardNumber": "4444333322221111", "cvc": "123" }, "merchant": { "entity": "test-reference" }, "verificationCurrency": "GBP" }
201
Copied!
{
"Content-type": "application/vnd.worldpay.verified-tokens-v1.hal+json;charset=UTF-8"
}
{ "Content-type": "application/vnd.worldpay.verified-tokens-v1.hal+json;charset=UTF-8" }
Copied!
{
"outcome": "verified",
"_links": {
"verifications:verification": {
"href": "https://try.access.worldpay.com/verifications/accounts/MTphTFVWNXJYcDUvaXdJT214aWNBWHN3PT06QUVTL0NCQy9QS0NTNVBhZGRpbmc6VXMzQStzaFdwWjZvV2g5STVXK0ZDb3ZiRmVoemdueWpnSDhHZFlmaFZpWitQTHNuWlZMQi84bzV0Z1FOaUZGYkpuTWRNYW9PdTJLY1Q0MURrdkpJMmFveVFJWC92MXArZFRWWUExZTRIdGZrZzBIYnBGeHJCWDJVc1lvMlZhUS8yclRzcHcrcTZ1OUtpZ0JPTVhmRW0zelhaWWl1WjlyR0xIUzR4b3lyOWFNPQ=="
},
"tokens:token": {
"href": "https://try.access.worldpay.com/tokens/${MAYBE_ENCRYPT:MTUzNTAzNjAzNzAyMjIzMjk0Ng==}"
},
"curies": [
{
"href": "https://try.access.worldpay.com/rels/verifications/accounts/{rel}.json",
"name": "verifications",
"templated": true
},
{
"href": "https://try.access.worldpay.com/rels/tokens/{rel}.json",
"name": "tokens",
"templated": true
}
]
}
}
{ "outcome": "verified", "_links": { "verifications:verification": { "href": "https://try.access.worldpay.com/verifications/accounts/MTphTFVWNXJYcDUvaXdJT214aWNBWHN3PT06QUVTL0NCQy9QS0NTNVBhZGRpbmc6VXMzQStzaFdwWjZvV2g5STVXK0ZDb3ZiRmVoemdueWpnSDhHZFlmaFZpWitQTHNuWlZMQi84bzV0Z1FOaUZGYkpuTWRNYW9PdTJLY1Q0MURrdkpJMmFveVFJWC92MXArZFRWWUExZTRIdGZrZzBIYnBGeHJCWDJVc1lvMlZhUS8yclRzcHcrcTZ1OUtpZ0JPTVhmRW0zelhaWWl1WjlyR0xIUzR4b3lyOWFNPQ==" }, "tokens:token": { "href": "https://try.access.worldpay.com/tokens/${MAYBE_ENCRYPT:MTUzNTAzNjAzNzAyMjIzMjk0Ng==}" }, "curies": [ { "href": "https://try.access.worldpay.com/rels/verifications/accounts/{rel}.json", "name": "verifications", "templated": true }, { "href": "https://try.access.worldpay.com/rels/tokens/{rel}.json", "name": "tokens", "templated": true } ] } }