Payments testing
Last updated: November 19, 2025
Create a test token for test payment requests. This means you do not have to process or store any sensitive information.
Note
Tokens are single use and expire after 15 minutes.
- Request a token.
- Create a payment request using the token ID from the Request a token response.
Call the Request a token endpoint and authenticate using your public API key prefixed with pktest..
In the request body, provide the following details for any test card:
type– Set tocard.number– The card numberexpiry_monthexpiry_year
Optionally, provide
name– The cardholder's namecvv– The card verification valuepin– The first two digits of the card personal identification number (PIN)
post
https://api.sandbox.checkout.com/tokens
1{2"type": "card",3"number": "4543474002249996",4"expiry_month": 6,5"expiry_year": 2025,6"name": "John Smith",7"cvv": "956",8"billing_address": {9"address_line1": "123 High St.",10"address_line2": "Flat 456",11"city": "London",12"zip": "SW1A 1AA",13"country": "GB"14},15"phone": {16"country_code": "+44",17"number": "1234 567890"18}19}
1{2"type": "card",3"token": "tok_ubfj2q76miwundwlk72vxt2i7q",4"expires_on": "2020-08-27T11:37:30Z",5"expiry_month": 6,6"expiry_year": 2025,7"scheme": "VISA",8"last4": "9996",9"bin": "454347",10"card_type": "CREDIT",11"card_category": "CONSUMER",12"issuer": "Test Bank",13"issuer_country": "US",14"product_id": "F",15"product_type": "CLASSIC",16"billing_address": {17"address_line1": "123 High St.",18"address_line2": "Flat 456",19"city": "London",20"zip": "SW1A 1AA",21"country": "GB"22},23"phone": {24"country_code": "+44",25"number": "1234 567890"26},27"name": "John Smith"28}
If successful, you receive a 201 response containing a card token prefixed with tok_.