Charge a Card on File

Applies to: Reader SDK - Android | Reader SDK - iOS | Customers API | Payments API

Learn how to enable recurring payments and create a seamless purchase experience for returning customers.

Important

The Mobile Payments SDK has launched as the successor of the Reader SDK. To take in-person payments on Square hardware, you should migrate from the Reader SDK to the Mobile Payments SDK.

Link to section

Requirements and limitations

  • You need an access token. If you're using OAuth, you need CUSTOMERS_WRITE permission to save a card on file and PAYMENTS_WRITE permission to process payments with the saved card. Cards on file are automatically updated on a monthly basis to confirm that they're still valid and can be charged.
  • You need to create a Customer object using the Customers API. To create your first Customer object, see Customers API.
  • You need a customer card on file. To save a card with the Reader SDK, see Save a Card on File.
Link to section

Charge a card on file

After you save a card on file, you can use the Payments API and call the CreatePayment endpoint to process the saved card. If you're using OAuth, you need PAYMENTS_WRITE permission.

To charge a saved card, use the Payments API and set the source_id and customer_id fields in the CreatePayment object:

  • Replace {CARD_ID} with an existing card ID.
  • Replace {CUSTOMER_ID} with an existing customer ID.
  • Replace {LOCATION_ID} with an existing location ID.

Create payment