Skip to content

Latest commit

 

History

History
145 lines (103 loc) · 4.14 KB

v1-transactions.md

File metadata and controls

145 lines (103 loc) · 4.14 KB

V1 Transactions

V1TransactionsApi v1TransactionsApi = client.getV1TransactionsApi();

Class Name

V1TransactionsApi

Methods

V1 List Orders

This endpoint is deprecated.

Provides summary information for a merchant's online store orders.

CompletableFuture<List<V1Order>> v1ListOrdersAsync(
    final String locationId,
    final String order,
    final Integer limit,
    final String batchToken)

Parameters

Parameter Type Tags Description
locationId String Template, Required The ID of the location to list online store orders for.
order String Query, Optional The order in which payments are listed in the response.
limit Integer Query, Optional The maximum number of payments to return in a single response. This value cannot exceed 200.
batchToken String Query, Optional A pagination cursor to retrieve the next set of results for your
original query to the endpoint.

Response Type

List<V1Order>

Example Usage

String locationId = "location_id4";

v1TransactionsApi.v1ListOrdersAsync(locationId, null, null, null).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

V1 Retrieve Order

This endpoint is deprecated.

Provides comprehensive information for a single online store order, including the order's history.

CompletableFuture<V1Order> v1RetrieveOrderAsync(
    final String locationId,
    final String orderId)

Parameters

Parameter Type Tags Description
locationId String Template, Required The ID of the order's associated location.
orderId String Template, Required The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint

Response Type

V1Order

Example Usage

String locationId = "location_id4";
String orderId = "order_id6";

v1TransactionsApi.v1RetrieveOrderAsync(locationId, orderId).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});

V1 Update Order

This endpoint is deprecated.

Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions:

CompletableFuture<V1Order> v1UpdateOrderAsync(
    final String locationId,
    final String orderId,
    final V1UpdateOrderRequest body)

Parameters

Parameter Type Tags Description
locationId String Template, Required The ID of the order's associated location.
orderId String Template, Required The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint
body V1UpdateOrderRequest Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

V1Order

Example Usage

String locationId = "location_id4";
String orderId = "order_id6";
V1UpdateOrderRequest body = new V1UpdateOrderRequest.Builder(
    "REFUND"
)
.build();

v1TransactionsApi.v1UpdateOrderAsync(locationId, orderId, body).thenAccept(result -> {
    // TODO success callback handler
    System.out.println(result);
}).exceptionally(exception -> {
    // TODO failure callback handler
    exception.printStackTrace();
    return null;
});