Search code examples
javascriptsquaresquare-connect

What does a Square nonce represent?


I am trying to submit a payment to Square, and am not sure what the card_nonce represents.

In the full API Documentation found here: https://docs.connect.squareup.com/api/connect/v2/#endpoint-createcustomercard

It states, "A card nonce representing the credit card to link to the customer."

However, in the REST payment processing documentation found here: https://docs.connect.squareup.com/articles/processing-payment-rest

It states, "Card nonces expire after 24 hours. The Charge endpoint returns an error if you attempt to charge an expired nonce."

  1. If I am trying to store a card_nonce for recurring billing can I use a card_nonce one time and repeatedly use it for billing?

  2. Will a customer have to enter their card information every time they want to check out?

  3. Does a card_nonce represent the state of the card, or a key that represents a specific card transaction?


Solution

  • A card nonce is a tokenized form of a credit card. You can use it only once, and they do expire. It "represents" a credit card, and all the details that a end user typed into your payment form.

    If you want to use it for reocurring payments, please read the Processing reoccurring payments in Square's documentation.

    You attach the card to a customer, and then use the the customer's card id against charge endpoint for payments without end users having to input their credit card details again.