TransactionsApi
July 10, 2019 ยท View on GitHub
squareconnect.apis.transactions_api
All endpoints are relative to Square Connect V2 Documentation
| Method | HTTP request |
|---|---|
| capture_transaction | POST /v2/locations/{location_id}/transactions/{transaction_id}/capture |
| charge | POST /v2/locations/{location_id}/transactions |
| create_refund | POST /v2/locations/{location_id}/transactions/{transaction_id}/refund |
| list_refunds | GET /v2/locations/{location_id}/refunds |
| list_transactions | GET /v2/locations/{location_id}/transactions |
| retrieve_transaction | GET /v2/locations/{location_id}/transactions/{transaction_id} |
| void_transaction | POST /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
| Name | Type | Notes | Default Value |
|---|---|---|---|
| location_id | str | ||
| transaction_id | str |
Return type
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
| Name | Type | Notes | Default Value |
|---|---|---|---|
| location_id | str | ||
| body | ChargeRequest |
Return type
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
| Name | Type | Notes | Default Value |
|---|---|---|---|
| location_id | str | ||
| transaction_id | str | ||
| body | CreateRefundRequest |
Return type
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
| Name | Type | Notes | Default Value |
|---|---|---|---|
| location_id | str | ||
| begin_time | str | [optional] | |
| end_time | str | [optional] | |
| sort_order | str | [optional] | |
| cursor | str | [optional] |
Return type
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
| Name | Type | Notes | Default Value |
|---|---|---|---|
| location_id | str | ||
| begin_time | str | [optional] | |
| end_time | str | [optional] | |
| sort_order | str | [optional] | |
| cursor | str | [optional] |
Return type
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
| Name | Type | Notes | Default Value |
|---|---|---|---|
| location_id | str | ||
| transaction_id | str |
Return type
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
| Name | Type | Notes | Default Value |
|---|---|---|---|
| location_id | str | ||
| transaction_id | str |
Return type
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]