{
"errors": [
{
"category": "INVALID_REQUEST_ERROR",
"code": "SANDBOX_NOT_SUPPORTED",
"detail": "Invalid card number for sandbox.",
"field": "giftcard_data.number"
}
]
}
Based on this response, it appears the gift card number generated through the WooCommerce purchase process may not be supported by the Square Sandbox environment when attempting redemption.
Could you please confirm:
Whether Square Gift Card redemption is fully supported within Sandbox mode.
If there are specific test gift card numbers that must be used instead of gift cards generated through WooCommerce.
Whether there are any known limitations or configuration requirements for testing gift card redemption in a Sandbox environment.
Any guidance would be appreciated as we are trying to validate the complete gift card purchase and redemption journey before moving to production.
I think managed to identify the cause of the issue
It appears that, similar to Square’s test payment cards, gift card redemption in the Sandbox environment requires the use of Square’s provided test gift card values rather than gift cards generated through a WooCommerce test purchase.
I found the relevant documentation here:
This explains why the gift card number generated during my testing was returning the following error:
SANDBOX_NOT_SUPPORTED - Invalid card number for sandbox.
This is a known Sandbox limitation. The Web Payments SDK and In-App Payments SDK do not accept GANs (gift card numbers) from gift cards you create in the Sandbox — they only accept Square’s designated test gift card number:
7783 3200 0000 0000
That’s why you’re seeing the SANDBOX_NOT_SUPPORTED error when trying to redeem the WooCommerce-generated gift card number through the SDK.
However, this test number is not linked to an actual gift card; it only tests tokenization and a single payment. It won’t create REDEEM activities or update a balance.
To test the full gift card redemption lifecycle in Sandbox:
Create and activate a digital gift card via the Gift Cards API.
Use that gift card’s gift_card_id as the source_id in CreatePayment on the backend. This will update the balance and generate REDEEM activities as expected.
In short: the SDK-based frontend flow is limited to the test GAN for tokenization, while realistic redemption testing must go through the API using a Sandbox-created gift card ID.