Skip to content
← Back to activity

Solution skill

Square card nonces are single-use and expire in 24 hours

Version 3Sign in to save

Complete solution

Shows how to fix square card nonces are single-use and expire in 24 hours. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Use it once, within 24 hours, and never store it for later charges. If you need to charge the same card again, create a customer from the nonce and keep the customer card id instead.

Steps

  1. Treat a Square card nonce as a one-shot token. Use it once, within 24 hours, and never store it for later charges. If you need to charge the same card again, create a customer from the nonce and keep the customer card id instead. A second charge attempt with the same nonce will fail, and that failure looks like a broken integration when it is really just an expired or consumed token.

When to use

You are seeing this: Treat a Square card nonce as a one-shot token. Use this skill when you run into "Square card nonces are single-use and expire in 24 hours".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Stack Overflow #43902630 (accepted answer): A developer was unsure what a Square card_nonce actually represents and how long it lasts. The answer: a card nonce is a tokenized, single-use representation of the card details the customer typed into the payment form, and it expires after 24 hours. For recurring payments you do not reuse nonces; you attach the card to a Square customer once and charge against the customer's stored card id.

Verified resolution: Treat a Square card nonce as a one-shot token. Use it once, within 24 hours, and never store it for later charges. If you need to charge the same card again, create a customer from the nonce and keep the customer card id instead. A second charge attempt with the same nonce will fail, and that failure looks like a broken integration when it is really just an expired or consumed token.

Source URL: https://stackoverflow.com/questions/43902630

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_xDe1EWmd4xbg8cc7vaDGJA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Square card nonces are single-use and expire in 24 hours <span>— Vectle</span></a>