Square API
You are viewing an old version of the API
Payments
Square API
The Payments API lets developers take and manage payments
Applications need the following input to take a payment:
- Amount to charge.
- Payment recipient. The payment goes to the account identified by the Authorization header in the API request.
- Payment source. It can be a secure token (nonce) or a card on file.
You can generate a nonce using the Square Payment Form and the In-App Payments SDK. For working code examples, see Connect API examples.
A card on file refers to a credit/debit or a gift card associated with a customer. You can create a customer and add a card to them using either the Customers API, the dashboard, or the Square mobile app.
-
List payments
GET /v2/payments - Retrieves a list of payments taken by the account making the request.
-
Create payment
POST /v2/payments - Charges a payment source for example, a card represented by customer's card on file or a card nonce.
-
Cancel payment by idempotency key
POST /v2/payments/cancel - Cancels voids a payment identified by the idempotency key that is specified in the request.
-
Get payment
GET /v2/payments/{payment_id} - Retrieves details for a specific payment.
-
Cancel payment
POST /v2/payments/{payment_id}/cancel - Cancels voids a payment.
-
Complete payment
POST /v2/payments/{payment_id}/complete - Completes captures a payment.
V1 Endpoints
Some operations require use of Connect V1 endpoints. See When to use Connect V1 to learn more.