Legacy Sandbox Test Values
Values you can use to make test Transactions in the legacy sandbox
On this page
The sandbox supports a collection of special credit card values you can use to simulate payment scenarios.
Use the information below to get started quickly to generate a valid sandbox nonce with the Square payment form or In-App Payments SDK.
|Card number||4111 1111 1111 1111|
You can use the following test credit card numbers to generate a sandbox card nonce with the Square payment form or In-App Payments SDK.
|Visa||4111 1111 1111 1111||111|
|MasterCard||5105 1051 0510 5100||111|
|Discover||6011 0000 0000 0004||111|
|Diners Club||3000 0000 0000 04||111|
|JCB||3569 9900 1009 5841||111|
|American Express||3400 000000 00009||1111|
|China UnionPay||6222 9888 1234 0000||123|
To test a successful payment, provide any future-dated expiration date, and non-sequential CVV (other than those in Generating error states.
American Express cards have four digit CVVs.
Payments in USD (United States), CAD (Canada), or GBP (United Kingdom) also require a valid postal code.
The Transactions API is deprecated. You should migrate your code to use the Payments API to take payments.
If you do not want to generate a nonce with the Square Payment Form or In-App Payments SDK, you can generate a successful response from the payment endpoint supported in the sandbox that you are using.
The deprecated Transactions.Charge endpoint is used for card and card on file (CoF) payments with the following test values:
|API Call||Field Name||Value|
|Transactions API |
|Transactions API |
(card on file)
|Customers API |
If you provide a sandbox nonce value to the CreateCustomerCard endpoint, you must provide "94103" as the postal code in the
billing_address field or the request will fail and return an with an invalid postal code error.
You can reproduce certain error states in the sandbox by providing special values in the Square payment form, In-App Payments SDK, or the Transactions.Charge endpoint.
If you use one of the following values in the Square payment form or In-App Payments SDK, the nonce returned will trigger an error when it is processed by the Transactions.Charge endpoint:
|Desired error state||Test values|
|Card CVV incorrect||CVV: 911|
|Card postal code incorrect||Postal code: 99999|
|Card expiration date incorrect||Expiration date: 01/40|
If you do not want to generate a nonce with the Square payment form or In-App Payments SDK, you can generate errors directly in your request to the Transactions.Charge endpoint.
If you send a sandbox
card_nonce value to CreateCustomerCard, you must provide 94103 as the postal code in the
billing_address field or the request will fail and return an invalid postal code error.
Use the Transactions.Charge endpoint.
|Bad postal code||fake-card-nonce-rejected-postalcode||fake-customer-card-id-rejected-postalcode|
|Bad expiration date||fake-card-nonce-rejected-expiration||fake-customer-card-id-rejected-expiration|
|Card nonce already used||fake-card-nonce-already-used||N/A|
You can also trigger a "Card declined" error by using 403 as the
amount_money in the Charge request.
Your sandbox account comes with a collection of mock locations. These locations are application-specific and unrelated to the production locations listed in the Square Dashboard.
The sandbox location IDs for a given application is listed on the Locations tab of the application control panel in the Application Dashboard. You can also fetch the location ID programmatically by calling ListLocations with a sandbox access token.