Payments testing
Last updated: April 29, 2022
Create a test token that you can use in future test payment requests, without having to process or store any sensitive information.
Exchange card details for a reference token that can be used later to request a card payment. Tokens are single use and expire after 15 minutes. To create a token, you'll need to authenticate using your public API key.
post
https://api.sandbox.checkout.com/tokens
| Header | Value | 
|---|---|
| 
 required | 
 This will be prefixed by pktest. | 
| 
 required | 
 | 
Information
You can use any of our test cards' details in the body of your request.
| Field name | Description | 
|---|---|
| 
 required string | Set this to  | 
| 
 required string | The card number. | 
| 
 required integer | The expiry month of the card. | 
| 
 required integer | The expiry year of the card. | 
| 
 optional string | The cardholder's name. | 
| 
 optional string | The card verification value/code. 3 digits, except for American Express (4 digits). | 
| 
 optional object | The payment source owner's billing address. | 
| 
 optional object | The payment source owner's phone number. | 
If your request was successful, you'll receive a 201 response containing a card token prefixed by tok_. You then have 15 minutes to request a payment using this token.
Create a payment request using the token you just received.