TerminalApi terminalApi = client.getTerminalApi();
TerminalApi
- Create Terminal Action
- Search Terminal Actions
- Get Terminal Action
- Cancel Terminal Action
- Dismiss Terminal Action
- Create Terminal Checkout
- Search Terminal Checkouts
- Get Terminal Checkout
- Cancel Terminal Checkout
- Dismiss Terminal Checkout
- Create Terminal Refund
- Search Terminal Refunds
- Get Terminal Refund
- Cancel Terminal Refund
- Dismiss Terminal Refund
Creates a Terminal action request and sends it to the specified device.
CompletableFuture<CreateTerminalActionResponse> createTerminalActionAsync(
final CreateTerminalActionRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
CreateTerminalActionRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
CreateTerminalActionRequest body = new CreateTerminalActionRequest.Builder(
"thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e",
new TerminalAction.Builder()
.deviceId("{{DEVICE_ID}}")
.deadlineDuration("PT5M")
.type("SAVE_CARD")
.saveCardOptions(new SaveCardOptions.Builder(
"{{CUSTOMER_ID}}"
)
.referenceId("user-id-1")
.build())
.build()
)
.build();
terminalApi.createTerminalActionAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days.
CompletableFuture<SearchTerminalActionsResponse> searchTerminalActionsAsync(
final SearchTerminalActionsRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
SearchTerminalActionsRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
SearchTerminalActionsRequest body = new SearchTerminalActionsRequest.Builder()
.query(new TerminalActionQuery.Builder()
.filter(new TerminalActionQueryFilter.Builder()
.createdAt(new TimeRange.Builder()
.startAt("2022-04-01T00:00:00.000Z")
.build())
.build())
.sort(new TerminalActionQuerySort.Builder()
.sortOrder("DESC")
.build())
.build())
.limit(2)
.build();
terminalApi.searchTerminalActionsAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Retrieves a Terminal action request by action_id
. Terminal action requests are available for 30 days.
CompletableFuture<GetTerminalActionResponse> getTerminalActionAsync(
final String actionId)
Parameter | Type | Tags | Description |
---|---|---|---|
actionId |
String |
Template, Required | Unique ID for the desired TerminalAction . |
String actionId = "action_id6";
terminalApi.getTerminalActionAsync(actionId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Cancels a Terminal action request if the status of the request permits it.
CompletableFuture<CancelTerminalActionResponse> cancelTerminalActionAsync(
final String actionId)
Parameter | Type | Tags | Description |
---|---|---|---|
actionId |
String |
Template, Required | Unique ID for the desired TerminalAction . |
String actionId = "action_id6";
terminalApi.cancelTerminalActionAsync(actionId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Dismisses a Terminal action request if the status and type of the request permits it.
See Link and Dismiss Actions for more details.
CompletableFuture<DismissTerminalActionResponse> dismissTerminalActionAsync(
final String actionId)
Parameter | Type | Tags | Description |
---|---|---|---|
actionId |
String |
Template, Required | Unique ID for the TerminalAction associated with the action to be dismissed. |
String actionId = "action_id6";
terminalApi.dismissTerminalActionAsync(actionId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Creates a Terminal checkout request and sends it to the specified device to take a payment for the requested amount.
CompletableFuture<CreateTerminalCheckoutResponse> createTerminalCheckoutAsync(
final CreateTerminalCheckoutRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
CreateTerminalCheckoutRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
CreateTerminalCheckoutResponse
CreateTerminalCheckoutRequest body = new CreateTerminalCheckoutRequest.Builder(
"28a0c3bc-7839-11ea-bc55-0242ac130003",
new TerminalCheckout.Builder(
new Money.Builder()
.amount(2610L)
.currency("USD")
.build(),
new DeviceCheckoutOptions.Builder(
"dbb5d83a-7838-11ea-bc55-0242ac130003"
)
.build()
)
.referenceId("id11572")
.note("A brief note")
.build()
)
.build();
terminalApi.createTerminalCheckoutAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Returns a filtered list of Terminal checkout requests created by the application making the request. Only Terminal checkout requests created for the merchant scoped to the OAuth token are returned. Terminal checkout requests are available for 30 days.
CompletableFuture<SearchTerminalCheckoutsResponse> searchTerminalCheckoutsAsync(
final SearchTerminalCheckoutsRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
SearchTerminalCheckoutsRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
SearchTerminalCheckoutsResponse
SearchTerminalCheckoutsRequest body = new SearchTerminalCheckoutsRequest.Builder()
.query(new TerminalCheckoutQuery.Builder()
.filter(new TerminalCheckoutQueryFilter.Builder()
.status("COMPLETED")
.build())
.build())
.limit(2)
.build();
terminalApi.searchTerminalCheckoutsAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Retrieves a Terminal checkout request by checkout_id
. Terminal checkout requests are available for 30 days.
CompletableFuture<GetTerminalCheckoutResponse> getTerminalCheckoutAsync(
final String checkoutId)
Parameter | Type | Tags | Description |
---|---|---|---|
checkoutId |
String |
Template, Required | The unique ID for the desired TerminalCheckout . |
String checkoutId = "checkout_id8";
terminalApi.getTerminalCheckoutAsync(checkoutId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Cancels a Terminal checkout request if the status of the request permits it.
CompletableFuture<CancelTerminalCheckoutResponse> cancelTerminalCheckoutAsync(
final String checkoutId)
Parameter | Type | Tags | Description |
---|---|---|---|
checkoutId |
String |
Template, Required | The unique ID for the desired TerminalCheckout . |
CancelTerminalCheckoutResponse
String checkoutId = "checkout_id8";
terminalApi.cancelTerminalCheckoutAsync(checkoutId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Dismisses a Terminal checkout request if the status and type of the request permits it.
CompletableFuture<DismissTerminalCheckoutResponse> dismissTerminalCheckoutAsync(
final String checkoutId)
Parameter | Type | Tags | Description |
---|---|---|---|
checkoutId |
String |
Template, Required | Unique ID for the TerminalCheckout associated with the checkout to be dismissed. |
DismissTerminalCheckoutResponse
String checkoutId = "checkout_id8";
terminalApi.dismissTerminalCheckoutAsync(checkoutId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Creates a request to refund an Interac payment completed on a Square Terminal. Refunds for Interac payments on a Square Terminal are supported only for Interac debit cards in Canada. Other refunds for Terminal payments should use the Refunds API. For more information, see Refunds API.
CompletableFuture<CreateTerminalRefundResponse> createTerminalRefundAsync(
final CreateTerminalRefundRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
CreateTerminalRefundRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
CreateTerminalRefundRequest body = new CreateTerminalRefundRequest.Builder(
"402a640b-b26f-401f-b406-46f839590c04"
)
.refund(new TerminalRefund.Builder(
"5O5OvgkcNUhl7JBuINflcjKqUzXZY",
new Money.Builder()
.amount(111L)
.currency("CAD")
.build(),
"Returning items",
"f72dfb8e-4d65-4e56-aade-ec3fb8d33291"
)
.build())
.build();
terminalApi.createTerminalRefundAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days.
CompletableFuture<SearchTerminalRefundsResponse> searchTerminalRefundsAsync(
final SearchTerminalRefundsRequest body)
Parameter | Type | Tags | Description |
---|---|---|---|
body |
SearchTerminalRefundsRequest |
Body, Required | An object containing the fields to POST for the request. See the corresponding object definition for field details. |
SearchTerminalRefundsRequest body = new SearchTerminalRefundsRequest.Builder()
.query(new TerminalRefundQuery.Builder()
.filter(new TerminalRefundQueryFilter.Builder()
.status("COMPLETED")
.build())
.build())
.limit(1)
.build();
terminalApi.searchTerminalRefundsAsync(body).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days.
CompletableFuture<GetTerminalRefundResponse> getTerminalRefundAsync(
final String terminalRefundId)
Parameter | Type | Tags | Description |
---|---|---|---|
terminalRefundId |
String |
Template, Required | The unique ID for the desired TerminalRefund . |
String terminalRefundId = "terminal_refund_id0";
terminalApi.getTerminalRefundAsync(terminalRefundId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it.
CompletableFuture<CancelTerminalRefundResponse> cancelTerminalRefundAsync(
final String terminalRefundId)
Parameter | Type | Tags | Description |
---|---|---|---|
terminalRefundId |
String |
Template, Required | The unique ID for the desired TerminalRefund . |
String terminalRefundId = "terminal_refund_id0";
terminalApi.cancelTerminalRefundAsync(terminalRefundId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});
Dismisses a Terminal refund request if the status and type of the request permits it.
CompletableFuture<DismissTerminalRefundResponse> dismissTerminalRefundAsync(
final String terminalRefundId)
Parameter | Type | Tags | Description |
---|---|---|---|
terminalRefundId |
String |
Template, Required | Unique ID for the TerminalRefund associated with the refund to be dismissed. |
String terminalRefundId = "terminal_refund_id0";
terminalApi.dismissTerminalRefundAsync(terminalRefundId).thenAccept(result -> {
// TODO success callback handler
System.out.println(result);
}).exceptionally(exception -> {
// TODO failure callback handler
exception.printStackTrace();
return null;
});