const terminalApi = client.terminalApi;
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.
async createTerminalAction( body: CreateTerminalActionRequest,
requestOptions?: RequestOptions): Promise<ApiResponse<CreateTerminalActionResponse>>
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const body: CreateTerminalActionRequest = {
idempotencyKey: 'thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e',
action: {
deviceId: '{{DEVICE_ID}}',
deadlineDuration: 'PT5M',
type: 'SAVE_CARD',
saveCardOptions: {
customerId: '{{CUSTOMER_ID}}',
referenceId: 'user-id-1',
},
},
};
try {
const { result, ...httpResponse } = await terminalApi.createTerminalAction(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days.
async searchTerminalActions( body: SearchTerminalActionsRequest,
requestOptions?: RequestOptions): Promise<ApiResponse<SearchTerminalActionsResponse>>
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const body: SearchTerminalActionsRequest = {
query: {
filter: {
createdAt: {
startAt: '2022-04-01T00:00:00.000Z',
},
},
sort: {
sortOrder: 'DESC',
},
},
limit: 2,
};
try {
const { result, ...httpResponse } = await terminalApi.searchTerminalActions(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Retrieves a Terminal action request by action_id
. Terminal action requests are available for 30 days.
async getTerminalAction( actionId: string,
requestOptions?: RequestOptions): Promise<ApiResponse<GetTerminalActionResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
actionId |
string |
Template, Required | Unique ID for the desired TerminalAction . |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const actionId = 'action_id6';
try {
const { result, ...httpResponse } = await terminalApi.getTerminalAction(actionId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Cancels a Terminal action request if the status of the request permits it.
async cancelTerminalAction( actionId: string,
requestOptions?: RequestOptions): Promise<ApiResponse<CancelTerminalActionResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
actionId |
string |
Template, Required | Unique ID for the desired TerminalAction . |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const actionId = 'action_id6';
try {
const { result, ...httpResponse } = await terminalApi.cancelTerminalAction(actionId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Dismisses a Terminal action request if the status and type of the request permits it.
See Link and Dismiss Actions for more details.
async dismissTerminalAction( actionId: string,
requestOptions?: RequestOptions): Promise<ApiResponse<DismissTerminalActionResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
actionId |
string |
Template, Required | Unique ID for the TerminalAction associated with the action to be dismissed. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const actionId = 'action_id6';
try {
const { result, ...httpResponse } = await terminalApi.dismissTerminalAction(actionId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Creates a Terminal checkout request and sends it to the specified device to take a payment for the requested amount.
async createTerminalCheckout( body: CreateTerminalCheckoutRequest,
requestOptions?: RequestOptions): Promise<ApiResponse<CreateTerminalCheckoutResponse>>
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
CreateTerminalCheckoutResponse
const body: CreateTerminalCheckoutRequest = {
idempotencyKey: '28a0c3bc-7839-11ea-bc55-0242ac130003',
checkout: {
amountMoney: {
amount: BigInt(2610),
currency: 'USD',
},
deviceOptions: {
deviceId: 'dbb5d83a-7838-11ea-bc55-0242ac130003',
},
referenceId: 'id11572',
note: 'A brief note',
},
};
try {
const { result, ...httpResponse } = await terminalApi.createTerminalCheckout(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
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.
async searchTerminalCheckouts( body: SearchTerminalCheckoutsRequest,
requestOptions?: RequestOptions): Promise<ApiResponse<SearchTerminalCheckoutsResponse>>
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
SearchTerminalCheckoutsResponse
const body: SearchTerminalCheckoutsRequest = {
query: {
filter: {
status: 'COMPLETED',
},
},
limit: 2,
};
try {
const { result, ...httpResponse } = await terminalApi.searchTerminalCheckouts(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Retrieves a Terminal checkout request by checkout_id
. Terminal checkout requests are available for 30 days.
async getTerminalCheckout( checkoutId: string,
requestOptions?: RequestOptions): Promise<ApiResponse<GetTerminalCheckoutResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
checkoutId |
string |
Template, Required | The unique ID for the desired TerminalCheckout . |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const checkoutId = 'checkout_id8';
try {
const { result, ...httpResponse } = await terminalApi.getTerminalCheckout(checkoutId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Cancels a Terminal checkout request if the status of the request permits it.
async cancelTerminalCheckout( checkoutId: string,
requestOptions?: RequestOptions): Promise<ApiResponse<CancelTerminalCheckoutResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
checkoutId |
string |
Template, Required | The unique ID for the desired TerminalCheckout . |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
CancelTerminalCheckoutResponse
const checkoutId = 'checkout_id8';
try {
const { result, ...httpResponse } = await terminalApi.cancelTerminalCheckout(checkoutId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Dismisses a Terminal checkout request if the status and type of the request permits it.
async dismissTerminalCheckout( checkoutId: string,
requestOptions?: RequestOptions): Promise<ApiResponse<DismissTerminalCheckoutResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
checkoutId |
string |
Template, Required | Unique ID for the TerminalCheckout associated with the checkout to be dismissed. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
DismissTerminalCheckoutResponse
const checkoutId = 'checkout_id8';
try {
const { result, ...httpResponse } = await terminalApi.dismissTerminalCheckout(checkoutId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
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.
async createTerminalRefund( body: CreateTerminalRefundRequest,
requestOptions?: RequestOptions): Promise<ApiResponse<CreateTerminalRefundResponse>>
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const body: CreateTerminalRefundRequest = {
idempotencyKey: '402a640b-b26f-401f-b406-46f839590c04',
refund: {
paymentId: '5O5OvgkcNUhl7JBuINflcjKqUzXZY',
amountMoney: {
amount: BigInt(111),
currency: 'CAD',
},
reason: 'Returning items',
deviceId: 'f72dfb8e-4d65-4e56-aade-ec3fb8d33291',
},
};
try {
const { result, ...httpResponse } = await terminalApi.createTerminalRefund(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days.
async searchTerminalRefunds( body: SearchTerminalRefundsRequest,
requestOptions?: RequestOptions): Promise<ApiResponse<SearchTerminalRefundsResponse>>
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. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const body: SearchTerminalRefundsRequest = {
query: {
filter: {
status: 'COMPLETED',
},
},
limit: 1,
};
try {
const { result, ...httpResponse } = await terminalApi.searchTerminalRefunds(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days.
async getTerminalRefund( terminalRefundId: string,
requestOptions?: RequestOptions): Promise<ApiResponse<GetTerminalRefundResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
terminalRefundId |
string |
Template, Required | The unique ID for the desired TerminalRefund . |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const terminalRefundId = 'terminal_refund_id0';
try {
const { result, ...httpResponse } = await terminalApi.getTerminalRefund(terminalRefundId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it.
async cancelTerminalRefund( terminalRefundId: string,
requestOptions?: RequestOptions): Promise<ApiResponse<CancelTerminalRefundResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
terminalRefundId |
string |
Template, Required | The unique ID for the desired TerminalRefund . |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const terminalRefundId = 'terminal_refund_id0';
try {
const { result, ...httpResponse } = await terminalApi.cancelTerminalRefund(terminalRefundId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Dismisses a Terminal refund request if the status and type of the request permits it.
async dismissTerminalRefund( terminalRefundId: string,
requestOptions?: RequestOptions): Promise<ApiResponse<DismissTerminalRefundResponse>>
Parameter | Type | Tags | Description |
---|---|---|---|
terminalRefundId |
string |
Template, Required | Unique ID for the TerminalRefund associated with the refund to be dismissed. |
requestOptions |
RequestOptions | undefined |
Optional | Pass additional request options. |
const terminalRefundId = 'terminal_refund_id0';
try {
const { result, ...httpResponse } = await terminalApi.dismissTerminalRefund(terminalRefundId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}