Sandbox 101: Cards API

Опубликовано: 16 Февраль 2026
на канале: Square Developer
5,833
21

Use the Cards API to save a credit or debit card for a customer. Your application can then charge the card when the customer makes purchases in the future. The API can also be used by a developer-account-registered application to create and charge cards on behalf of a seller account.

The Cards API is used along with the Customers API to store payment cards for a customer in a Square account. To store a card on file, your application must use the Customers API to fetch an existing customer or create a new customer. When your application obtains a customer ID, it can call the CreateCard endpoint with a payment token or payment ID, and the customer ID. After the card is stored on file for the customer, that customer's stored card can be used for payments to the seller account.

Created a Card on File from a Payment ID – https://developer.squareup.com/docs/c...
Create a Card on File and a Payment – https://developer.squareup.com/docs/c...
Shared Card on File – https://developer.squareup.com/docs/c...

Chapters:
0:00 Intro
0:11 Overview of Cards API
0:33 Save a Card Using a Previous Payment
1:53 How shared card on file work?
2:26 Creating a Shared Card on File
4:46 Recap

Square Developer Forums – https://developer.squareup.com/forums
Square Developer Community – https://squ.re/slack
Square Developer Twitter –   / squaredev  
Square Developer Blog – https://developer.squareup.com/blog