Deprecated
This API is deprecated, see below for guidance on what to use instead.
Testing

Legacy Sandbox Test Values

Values you can use to make test Transactions in the legacy sandbox

Customers API
Transactions API

Important

For information about test values for v2 Sandbox, see Sandbox Test Values.

The legacy sandbox is deprecated. You should use the current v2 Sandbox to test Connect v2 APIs. The set of supported Connect APIs includes all of the Connect v2 APIs supported in the legacy sandbox.

Test credit card
Permalink Get a link to this section

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 informationValue
Card number4111 1111 1111 1111
Expiration date12/21
CVV111

Generating success states
Permalink Get a link to this section

Square payment form test values
Permalink Get a link to this section

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.

BrandNumberCVV
Visa4111 1111 1111 1111111
MasterCard5105 1051 0510 5100111
Discover6011 0000 0000 0004111
Diners Club3000 0000 0000 04111
JCB3569 9900 1009 5841111
American Express3400 000000 000091111
China UnionPay6222 9888 1234 0000123

Other credit card information
Permalink Get a link to this section

  • 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.

Important

Payments in USD (United States), CAD (Canada), or GBP (United Kingdom) also require a valid postal code.

Charge and CreateCustomerCard test values
Permalink Get a link to this section

Important

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 CallField NameValue
Transactions API
(card)
card_noncefake-card-nonce-ok
Transactions API
(card on file)
customer_card_idfake-customer-card-id-ok
Customers API
(save card)
billing_address.postal_code94103

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.

Generating error states
Permalink Get a link to this section

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.

Square payment form test values
Permalink Get a link to this section

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 stateTest values
Card CVV incorrectCVV: 911
Card postal code incorrectPostal code: 99999
Card expiration date incorrectExpiration date: 01/40

CreatePayment and CreateCustomerCard test values
Permalink Get a link to this section

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.

Important

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.

Sandbox
Permalink Get a link to this section

Use the Transactions.Charge endpoint.

Error statecard_noncecustomer_card_id
Bad CVVfake-card-nonce-rejected-cvvfake-customer-card-id-rejected-cvv
Bad postal codefake-card-nonce-rejected-postalcodefake-customer-card-id-rejected-postalcode
Bad expiration datefake-card-nonce-rejected-expirationfake-customer-card-id-rejected-expiration
Card declinedfake-card-nonce-declinedfake-customer-card-id-declined
Card nonce already usedfake-card-nonce-already-usedN/A

You can also trigger a "Card declined" error by using 403 as the amount_money in the Charge request.

Working with sandbox locations
Permalink Get a link to this section

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.