Sandbox test values

Values you can use to make test payments.

Test credit card

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.

Card number: 4111 1111 1111 1111
Expiration date: 12/21
CVV: 111

Generating success states

Square payment form test values

You can use the following test credit card numbers to generate a sandbox card nonce with the Square payment form.

Brand Number CVV
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

Other credit card information

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

Charge and CreateCustomerCard endpoint test values

If you do not want to generate a nonce with the Square payment form, you can generate a successful response from the Transaction API's Charge endpoint with the following test values:

API Call Field Name Value
Transactions API
(credit card payment)
card_nonce fake-card-nonce-ok
Transactions API
(card on file payment)
customer_card_id fake-customer-card-id-ok
Customers API (save customer card) billing_address.postal_code 94103

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

You can reproduce certain error states in the sandbox by providing special values in the Square payment form or the Charge endpoint.

Square payment form test values

If you use one of the following values in the Square payment form, the nonce returned will trigger an error when it is processed by the Charge endpoint:

Desired error state Test values
Card CVV incorrect Use 911 as the CVV
Card postal code incorrect Use 99999 as the postal code
Card expiration date incorrect Use 01/40 as the expiration date

Charge and CreateCustomerCard endpoint test values

If you do not want to generate a nonce with the Square payment form, you can generate errors directly in your request to the Transaction API's Charge endpoint.

Error state card_nonce customer_card_id
Card CVV incorrect fake-card-nonce-rejected-cvv fake-customer-card-id-rejected-cvv
Card postal code incorrect fake-card-nonce-rejected-postalcode fake-customer-card-id-rejected-postalcode
Card expiration date incorrect fake-card-nonce-rejected-expiration fake-customer-card-id-rejected-expiration
Card declined fake-card-nonce-declined fake-customer-card-id-declined
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.

Working with sandbox locations

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 are listed on the Locations tab of the application control panel in the Application Dashboard. You can also fetch the location IDs programmatically by calling
ListLocations endpoint with a sandbox access token.

< Running Local Web Servers
Testing in Unsupported Regions >

Contact Developer Support, join our Slack channel, or ask for help on Stack Overflow