Search code examples
square-connect

Square connect API - Refund from native iOS App


New to Square connect API.

After successful transaction in native iOS, Register app will open my app with some transaction data (transaction_id).

Now Question :

Based on transaction_id, can my native app request for the Refund for that particular transaction ?


Solution

  • You cannot directly request a refund through Register API, but when you process a payment through Register API, you will be provided with a transaction_id for that payment, and you can use that ID to request a refund from the Square Connect APIs.

    Once you have the transaction_id, you can make a request to the Square Connect API RetrieveTransaction endpoint to obtain the tenders used to pay for the transaction: https://docs.connect.squareup.com/api/connect/v2/#endpoint-retrievetransaction. The list of tenders is the list of all the payment methods used to pay for the transaction.

    Once you have the tender IDs, you can call the create refund endpoint with that information: https://docs.connect.squareup.com/api/connect/v2/#endpoint-createrefund.

    Note that Register API does not currently support split tender transactions (i.e. transactions where the customer uses multiple payment methods, like credit card and cash, to pay for the same transaction.) The number of tenders for Register API transactions will generally be only one.