Creates a verified token

Methods

POST

Creates a token only if the supplied payload can be verified

Request

Copied!
{
 "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": {
       "type": "string",
       "minLength": 1,
       "maxLength": 255
      },
      "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"
       ]
      }
     },
     "additionalProperties": false,
     "required": [
      "type",
      "cardNumber",
      "cardExpiryDate",
      "cardHolderName"
     ]
    },
    {
     "properties": {
      "type": {
       "const": "card/checkout"
      },
      "sessionHref": {
       "type": "string",
       "pattern": "^https://try.access.worldpay.com/verifiedTokens/sessions/.*$"
      },
      "cardHolderName": {
       "type": "string",
       "minLength": 1,
       "maxLength": 255
      },
      "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"
       ]
      }
     },
     "additionalProperties": false,
     "required": [
      "type",
      "sessionHref",
      "cardHolderName"
     ]
    }
   ]
  },
  "merchant": {
   "type": "object",
   "properties": {
    "reference": {
     "type": "string"
    }
   },
   "required": [
    "reference"
   ]
  },
  "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!
{
 "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!
{
 "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!
{
 "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!
{
 "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/.*$"
      }
     }
    },
    "curies": {
     "type": "array",
     "items": {
      "type": "object",
      "properties": {
       "href": {
        "pattern": "^https://try.access.worldpay.com/rels/.*$"
       },
       "name": {
        "type": "string"
       },
       "templated": {
        "type": "boolean"
       }
      }
     }
    }
   }
  }
 }
}

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. A token has not been created.
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. A token has not been created.
View

Link relationship

post
 Creating a new token for cardOnFile transactions when supplying all the payment instrument details. 
POST https://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": 2020
    },
    "cardNumber": "4444333322221111",
    "cvc": "123"
  },
  "merchant": {
    "entity": "merchant-entity"
  },
  "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/eyJrIjoxLCJkIjoiNjd5bnJnSTR3a3FITW00SHNjaE90YnAwcVlvZ1pSZ3RFOXJjcklzVzY1ND0ifQ"
    },
    "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
      }
    ]
  }
}