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
  }
 }
}

Responses

Examples

POST
 Creating a new token for cardOnFile transactions when supplying all the payment instrument details.
View
POST
 Matching an existing token for cardOnFile transactions when supplying all the payment instrument details.
View
POST
 Conflicting with an existing token for cardOnFile transactions when supplying all the payment instrument details.
View
POST
 Payload cannot be verified for cardOnFile transactions when supplying all the payment instrument details. An unverified token has been created.
View
POST
 Payload cannot be verified for cardOnFile transactions when supplying all the payment instrument details. An unverified token has been matched.
View
POST
 Payload cannot be verified for cardOnFile transactions when supplying all the payment instrument details. An unverified token with conflicts has been returned.
View
POST
 Creating a new token for cardOnFile transactions using a session created by the access checkout SDK.
View
POST
 Matching a token for cardOnFile transactions using a session created by the access checkout SDK.
View
POST
 Conflicts with an existing token for cardOnFile transactions using a session created by the access checkout SDK.
View
POST
 Payload cannot be verified for cardOnFile transactions using a session created by the access checkout SDK. An unverified token has been created.
View
POST
 Payload cannot be verified for cardOnFile transactions using a session created by the access checkout SDK. An unverified token has been matched.
View
POST
 Payload cannot be verified for cardOnFile transactions using a session created by the access checkout SDK. An unverified token with conflicts has been returned.
View

Link relationship

post
 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"
}
Copied!
{
  "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"
}
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
      }
    ]
  }
}