terminal_api = client.terminalTerminalApi
- Create Terminal Checkout
- Search Terminal Checkouts
- Get Terminal Checkout
- Cancel Terminal Checkout
- Create Terminal Refund
- Search Terminal Refunds
- Get Terminal Refund
- Cancel Terminal Refund
Creates a Terminal checkout request and sends it to the specified device to take a payment for the requested amount.
def create_terminal_checkout(self,
body)| Parameter | Type | Tags | Description |
|---|---|---|---|
body |
Create Terminal Checkout Request |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Create Terminal Checkout Response
body = {}
body['idempotency_key'] = '28a0c3bc-7839-11ea-bc55-0242ac130003'
body['checkout'] = {}
body['checkout']['id'] = 'id8'
body['checkout']['amount_money'] = {}
body['checkout']['amount_money']['amount'] = 2610
body['checkout']['amount_money']['currency'] = 'USD'
body['checkout']['reference_id'] = 'id11572'
body['checkout']['note'] = 'A brief note'
body['checkout']['device_options'] = {}
body['checkout']['device_options']['device_id'] = 'dbb5d83a-7838-11ea-bc55-0242ac130003'
body['checkout']['device_options']['skip_receipt_screen'] = False
body['checkout']['device_options']['tip_settings'] = {}
body['checkout']['device_options']['tip_settings']['allow_tipping'] = False
body['checkout']['device_options']['tip_settings']['separate_tip_screen'] = False
body['checkout']['device_options']['tip_settings']['custom_tip_field'] = False
body['checkout']['device_options']['tip_settings']['tip_percentages'] = [148, 149, 150]
body['checkout']['device_options']['tip_settings']['smart_tipping'] = False
body['checkout']['deadline_duration'] = 'deadline_duration0'
body['checkout']['status'] = 'status0'
result = terminal_api.create_terminal_checkout(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Retrieves a filtered list of Terminal checkout requests created by the account making the request.
def search_terminal_checkouts(self,
body)| Parameter | Type | Tags | Description |
|---|---|---|---|
body |
Search Terminal Checkouts Request |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Search Terminal Checkouts Response
body = {}
body['query'] = {}
body['query']['filter'] = {}
body['query']['filter']['device_id'] = 'device_id8'
body['query']['filter']['created_at'] = {}
body['query']['filter']['created_at']['start_at'] = 'start_at2'
body['query']['filter']['created_at']['end_at'] = 'end_at0'
body['query']['filter']['status'] = 'COMPLETED'
body['query']['sort'] = {}
body['query']['sort']['sort_order'] = 'DESC'
body['cursor'] = 'cursor0'
body['limit'] = 2
result = terminal_api.search_terminal_checkouts(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Retrieves a Terminal checkout request by checkout_id.
def get_terminal_checkout(self,
checkout_id)| Parameter | Type | Tags | Description |
|---|---|---|---|
checkout_id |
string |
Template, Required | The unique ID for the desired TerminalCheckout. |
Get Terminal Checkout Response
checkout_id = 'checkout_id8'
result = terminal_api.get_terminal_checkout(checkout_id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Cancels a Terminal checkout request if the status of the request permits it.
def cancel_terminal_checkout(self,
checkout_id)| Parameter | Type | Tags | Description |
|---|---|---|---|
checkout_id |
string |
Template, Required | The unique ID for the desired TerminalCheckout. |
Cancel Terminal Checkout Response
checkout_id = 'checkout_id8'
result = terminal_api.cancel_terminal_checkout(checkout_id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Creates a request to refund an Interac payment completed on a Square Terminal.
def create_terminal_refund(self,
body)| Parameter | Type | Tags | Description |
|---|---|---|---|
body |
Create Terminal Refund Request |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Create Terminal Refund Response
body = {}
body['idempotency_key'] = '402a640b-b26f-401f-b406-46f839590c04'
body['refund'] = {}
body['refund']['id'] = 'id4'
body['refund']['refund_id'] = 'refund_id8'
body['refund']['payment_id'] = '5O5OvgkcNUhl7JBuINflcjKqUzXZY'
body['refund']['order_id'] = 'order_id8'
body['refund']['amount_money'] = {}
body['refund']['amount_money']['amount'] = 111
body['refund']['amount_money']['currency'] = 'CAD'
body['refund']['reason'] = 'Returning items'
body['refund']['device_id'] = 'f72dfb8e-4d65-4e56-aade-ec3fb8d33291'
result = terminal_api.create_terminal_refund(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request.
def search_terminal_refunds(self,
body)| Parameter | Type | Tags | Description |
|---|---|---|---|
body |
Search Terminal Refunds Request |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
Search Terminal Refunds Response
body = {}
body['query'] = {}
body['query']['filter'] = {}
body['query']['filter']['device_id'] = 'device_id8'
body['query']['filter']['created_at'] = {}
body['query']['filter']['created_at']['start_at'] = 'start_at2'
body['query']['filter']['created_at']['end_at'] = 'end_at0'
body['query']['filter']['status'] = 'COMPLETED'
body['query']['sort'] = {}
body['query']['sort']['sort_order'] = 'sort_order8'
body['cursor'] = 'cursor0'
body['limit'] = 1
result = terminal_api.search_terminal_refunds(body)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Retrieves an Interac Terminal refund object by ID.
def get_terminal_refund(self,
terminal_refund_id)| Parameter | Type | Tags | Description |
|---|---|---|---|
terminal_refund_id |
string |
Template, Required | The unique ID for the desired TerminalRefund. |
terminal_refund_id = 'terminal_refund_id0'
result = terminal_api.get_terminal_refund(terminal_refund_id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it.
def cancel_terminal_refund(self,
terminal_refund_id)| Parameter | Type | Tags | Description |
|---|---|---|---|
terminal_refund_id |
string |
Template, Required | The unique ID for the desired TerminalRefund. |
Cancel Terminal Refund Response
terminal_refund_id = 'terminal_refund_id0'
result = terminal_api.cancel_terminal_refund(terminal_refund_id)
if result.is_success():
print(result.body)
elif result.is_error():
print(result.errors)