Capture a Transaction

Complete a delayed transaction by capturing all authorized card payments.

Delayed payments can be taken on a mobile device by using the Reader SDK. However, to capture a delayed payment, you need the Transactions API called from an application running on a backend server. Your mobile payment application must be able to provide the backend with the transaction ID of a delayed payment.

For example, a seller might want to authorize funds at the time of purchase and capture funds when an item ships from the warehouse. After the checkout successfully completes, the seller's Reader SDK mobile application associates an order number with the Square transaction ID and location ID and sends this information to a backend server.

When the warehouse notifies the backend that the item has shipped, the backend looks up the order number, retrieves the transaction ID and location ID, and passes both IDs to the CaptureTransaction endpoint to capture the transaction.

Link to section

Prerequisites

  • You need an access token. If you're using OAuth, you need PAYMENTS_WRITE permission.
  • You need to create a delayed payment using the Reader SDK on a mobile device. For more information about creating a delayed payment, see Delay the Capture of Payments.
  • You need a valid location ID and the transaction ID of a delayed payment.
Link to section

Capture a payment

Authorized transactions are voided automatically after 36 hours if the card used for the payment is present with the buyer; otherwise, authorized transactions are voided after 7 days. Sometime within the next 7 days, capture the funds using the transactionID and locationID of the delayed capture transaction and the CaptureTransaction endpoint. CaptureTransaction responds with an empty JavaScript object, {}, on success. To view the finalized transaction, use the RetrieveTransaction endpoint with the saved transaction ID.

Capture transaction

Link to section

Get an order by the transaction ID

Fill the order_ids array with the transaction IDs for payments that you want to capture.

Batch retrieve orders