TransactionsApi

July 10, 2019 ยท View on GitHub

squareconnect.apis.transactions_api

All endpoints are relative to Square Connect V2 Documentation

MethodHTTP request
capture_transactionPOST /v2/locations/{location_id}/transactions/{transaction_id}/capture
chargePOST /v2/locations/{location_id}/transactions
create_refundPOST /v2/locations/{location_id}/transactions/{transaction_id}/refund
list_refundsGET /v2/locations/{location_id}/refunds
list_transactionsGET /v2/locations/{location_id}/transactions
retrieve_transactionGET /v2/locations/{location_id}/transactions/{transaction_id}
void_transactionPOST /v2/locations/{location_id}/transactions/{transaction_id}/void

capture_transaction

CaptureTransactionResponse capture_transaction(location_id, transaction_id)

Description

Captures a transaction that was created with the Charge endpoint with a delay_capture value of true. See the Delay Capture of Funds recipe for more information.

Parameters

NameTypeNotesDefault Value
location_idstr
transaction_idstr

Return type

CaptureTransactionResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

charge

ChargeResponse charge(location_id, body)

Description

Charges a card represented by a card nonce or a customer's card on file. Your request to this endpoint must include either: - A value for the card_nonce parameter (to charge a card nonce generated with the SqPaymentForm) - Values for the customer_card_id and customer_id parameters (to charge a customer's card on file) When this response is returned, the amount of Square's processing fee might not yet be calculated. To obtain the processing fee, wait about ten seconds and call RetrieveTransaction. See the processing_fee_money field of each Tender included in the transaction.

Parameters

NameTypeNotesDefault Value
location_idstr
bodyChargeRequest

Return type

ChargeResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_refund

CreateRefundResponse create_refund(location_id, transaction_id, body)

Description

Initiates a refund for a previously charged tender. You must issue a refund within 120 days of the associated payment. See this article for more information on refund behavior. NOTE: Card-present transactions with Interac credit cards cannot be refunded using the Connect API. Interac transactions must refunded in-person (e.g., dipping the card using POS app).

Parameters

NameTypeNotesDefault Value
location_idstr
transaction_idstr
bodyCreateRefundRequest

Return type

CreateRefundResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_refunds

ListRefundsResponse list_refunds(location_id, begin_time=begin_time, end_time=end_time, sort_order=sort_order, cursor=cursor)

Description

Lists refunds for one of a business's locations. In addition to full or partial tender refunds processed through Square APIs, refunds may result from itemized returns or exchanges through Square's Point of Sale applications. Refunds with a status of PENDING are not currently included in this endpoint's response. Max results per page: 50

Parameters

NameTypeNotesDefault Value
location_idstr
begin_timestr[optional]
end_timestr[optional]
sort_orderstr[optional]
cursorstr[optional]

Return type

ListRefundsResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_transactions

ListTransactionsResponse list_transactions(location_id, begin_time=begin_time, end_time=end_time, sort_order=sort_order, cursor=cursor)

Description

Lists transactions for a particular location. Transactions include payment information from sales and exchanges and refund information from returns and exchanges. Max results per page: 50

Parameters

NameTypeNotesDefault Value
location_idstr
begin_timestr[optional]
end_timestr[optional]
sort_orderstr[optional]
cursorstr[optional]

Return type

ListTransactionsResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieve_transaction

RetrieveTransactionResponse retrieve_transaction(location_id, transaction_id)

Description

Retrieves details for a single transaction.

Parameters

NameTypeNotesDefault Value
location_idstr
transaction_idstr

Return type

RetrieveTransactionResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

void_transaction

VoidTransactionResponse void_transaction(location_id, transaction_id)

Description

Cancels a transaction that was created with the Charge endpoint with a delay_capture value of true. See the Delay Capture of Funds recipe for more information.

Parameters

NameTypeNotesDefault Value
location_idstr
transaction_idstr

Return type

VoidTransactionResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]