Package io.voucherify.client.api
Class OrdersApi
java.lang.Object
io.voucherify.client.api.OrdersApi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateOrder(OrdersCreateRequestBody ordersCreateRequestBody) Create Order Creates an order object and triggers an order creation event.okhttp3.CallcreateOrderAsync(OrdersCreateRequestBody ordersCreateRequestBody, ApiCallback<OrdersCreateResponseBody> _callback) Create Order (asynchronously) Creates an order object and triggers an order creation event.okhttp3.CallcreateOrderCall(OrdersCreateRequestBody ordersCreateRequestBody, ApiCallback _callback) Build call for createOrdercreateOrderExport(OrdersExportCreateRequestBody ordersExportCreateRequestBody) Create Orders Export Creates a downloadable CSV file containing a list of orders.okhttp3.CallcreateOrderExportAsync(OrdersExportCreateRequestBody ordersExportCreateRequestBody, ApiCallback<OrdersExportCreateResponseBody> _callback) Create Orders Export (asynchronously) Creates a downloadable CSV file containing a list of orders.okhttp3.CallcreateOrderExportCall(OrdersExportCreateRequestBody ordersExportCreateRequestBody, ApiCallback _callback) Build call for createOrderExportcreateOrderExportWithHttpInfo(OrdersExportCreateRequestBody ordersExportCreateRequestBody) Create Orders Export Creates a downloadable CSV file containing a list of orders.createOrderWithHttpInfo(OrdersCreateRequestBody ordersCreateRequestBody) Create Order Creates an order object and triggers an order creation event.intGet Order Retrieve an order.okhttp3.CallgetOrderAsync(String orderId, ApiCallback<OrdersGetResponseBody> _callback) Get Order (asynchronously) Retrieve an order.okhttp3.CallgetOrderCall(String orderId, ApiCallback _callback) Build call for getOrdergetOrderWithHttpInfo(String orderId) Get Order Retrieve an order.importOrders(List<OrdersImportCreateRequestBodyItem> ordersImportCreateRequestBodyItem) Import Orders 🚧 Historical orders This endpoint should only be used to import historical orders into Voucherify.okhttp3.CallimportOrdersAsync(List<OrdersImportCreateRequestBodyItem> ordersImportCreateRequestBodyItem, ApiCallback<OrdersImportCreateResponseBody> _callback) Import Orders (asynchronously) 🚧 Historical orders This endpoint should only be used to import historical orders into Voucherify.okhttp3.CallimportOrdersCall(List<OrdersImportCreateRequestBodyItem> ordersImportCreateRequestBodyItem, ApiCallback _callback) Build call for importOrdersimportOrdersWithHttpInfo(List<OrdersImportCreateRequestBodyItem> ordersImportCreateRequestBodyItem) Import Orders 🚧 Historical orders This endpoint should only be used to import historical orders into Voucherify.listOrders(Integer limit, Integer page, ParameterOrderListOrders order) List Orders Returns a list of orders.okhttp3.CalllistOrdersAsync(Integer limit, Integer page, ParameterOrderListOrders order, ApiCallback<OrdersListResponseBody> _callback) List Orders (asynchronously) Returns a list of orders.okhttp3.CalllistOrdersCall(Integer limit, Integer page, ParameterOrderListOrders order, ApiCallback _callback) Build call for listOrderslistOrdersWithHttpInfo(Integer limit, Integer page, ParameterOrderListOrders order) List Orders Returns a list of orders.voidsetApiClient(ApiClient apiClient) voidsetCustomBaseUrl(String customBaseUrl) voidsetHostIndex(int hostIndex) updateOrder(String orderId, OrdersUpdateRequestBody ordersUpdateRequestBody) Update Order Updates the specified order by setting the values of the parameters passed in the request body.okhttp3.CallupdateOrderAsync(String orderId, OrdersUpdateRequestBody ordersUpdateRequestBody, ApiCallback<OrdersUpdateResponseBody> _callback) Update Order (asynchronously) Updates the specified order by setting the values of the parameters passed in the request body.okhttp3.CallupdateOrderCall(String orderId, OrdersUpdateRequestBody ordersUpdateRequestBody, ApiCallback _callback) Build call for updateOrderupdateOrderWithHttpInfo(String orderId, OrdersUpdateRequestBody ordersUpdateRequestBody) Update Order Updates the specified order by setting the values of the parameters passed in the request body.
-
Constructor Details
-
OrdersApi
public OrdersApi() -
OrdersApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getHostIndex
public int getHostIndex() -
setHostIndex
public void setHostIndex(int hostIndex) -
getCustomBaseUrl
-
setCustomBaseUrl
-
createOrderCall
public okhttp3.Call createOrderCall(OrdersCreateRequestBody ordersCreateRequestBody, ApiCallback _callback) throws ApiException Build call for createOrder- Parameters:
ordersCreateRequestBody- Specify the order parameters. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
createOrder
public OrdersCreateResponseBody createOrder(OrdersCreateRequestBody ordersCreateRequestBody) throws ApiException Create Order Creates an order object and triggers an order creation event. 📘 Upsert Mode If you pass an id or a source_id that already exists in the order database, Voucherify will return a related order object with updated fields.- Parameters:
ordersCreateRequestBody- Specify the order parameters. (optional)- Returns:
- OrdersCreateResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
createOrderWithHttpInfo
public ApiResponse<OrdersCreateResponseBody> createOrderWithHttpInfo(OrdersCreateRequestBody ordersCreateRequestBody) throws ApiException Create Order Creates an order object and triggers an order creation event. 📘 Upsert Mode If you pass an id or a source_id that already exists in the order database, Voucherify will return a related order object with updated fields.- Parameters:
ordersCreateRequestBody- Specify the order parameters. (optional)- Returns:
- ApiResponse<OrdersCreateResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
createOrderAsync
public okhttp3.Call createOrderAsync(OrdersCreateRequestBody ordersCreateRequestBody, ApiCallback<OrdersCreateResponseBody> _callback) throws ApiException Create Order (asynchronously) Creates an order object and triggers an order creation event. 📘 Upsert Mode If you pass an id or a source_id that already exists in the order database, Voucherify will return a related order object with updated fields.- Parameters:
ordersCreateRequestBody- Specify the order parameters. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
createOrderExportCall
public okhttp3.Call createOrderExportCall(OrdersExportCreateRequestBody ordersExportCreateRequestBody, ApiCallback _callback) throws ApiException Build call for createOrderExport- Parameters:
ordersExportCreateRequestBody- Specify which order parameters you would like to export. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
createOrderExport
public OrdersExportCreateResponseBody createOrderExport(OrdersExportCreateRequestBody ordersExportCreateRequestBody) throws ApiException Create Orders Export Creates a downloadable CSV file containing a list of orders. The parameters listed in the payload resembles headers in the CSV file. To include a parameter to the file, add it to the parameters.fields object in the request body. The available filters are all order object attributes. Additionally, any metadata defined in the metadata schema can be exported. Passing an empty JSON will generate a file containing three default fields: id, source_id, and status. The fields array is an array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:- Parameters:
ordersExportCreateRequestBody- Specify which order parameters you would like to export. (optional)- Returns:
- OrdersExportCreateResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
createOrderExportWithHttpInfo
public ApiResponse<OrdersExportCreateResponseBody> createOrderExportWithHttpInfo(OrdersExportCreateRequestBody ordersExportCreateRequestBody) throws ApiException Create Orders Export Creates a downloadable CSV file containing a list of orders. The parameters listed in the payload resembles headers in the CSV file. To include a parameter to the file, add it to the parameters.fields object in the request body. The available filters are all order object attributes. Additionally, any metadata defined in the metadata schema can be exported. Passing an empty JSON will generate a file containing three default fields: id, source_id, and status. The fields array is an array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:- Parameters:
ordersExportCreateRequestBody- Specify which order parameters you would like to export. (optional)- Returns:
- ApiResponse<OrdersExportCreateResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
createOrderExportAsync
public okhttp3.Call createOrderExportAsync(OrdersExportCreateRequestBody ordersExportCreateRequestBody, ApiCallback<OrdersExportCreateResponseBody> _callback) throws ApiException Create Orders Export (asynchronously) Creates a downloadable CSV file containing a list of orders. The parameters listed in the payload resembles headers in the CSV file. To include a parameter to the file, add it to the parameters.fields object in the request body. The available filters are all order object attributes. Additionally, any metadata defined in the metadata schema can be exported. Passing an empty JSON will generate a file containing three default fields: id, source_id, and status. The fields array is an array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:- Parameters:
ordersExportCreateRequestBody- Specify which order parameters you would like to export. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
getOrderCall
Build call for getOrder- Parameters:
orderId- Unique Voucherify order ID or order source ID. (required)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
getOrder
Get Order Retrieve an order.- Parameters:
orderId- Unique Voucherify order ID or order source ID. (required)- Returns:
- OrdersGetResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
getOrderWithHttpInfo
Get Order Retrieve an order.- Parameters:
orderId- Unique Voucherify order ID or order source ID. (required)- Returns:
- ApiResponse<OrdersGetResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
getOrderAsync
public okhttp3.Call getOrderAsync(String orderId, ApiCallback<OrdersGetResponseBody> _callback) throws ApiException Get Order (asynchronously) Retrieve an order.- Parameters:
orderId- Unique Voucherify order ID or order source ID. (required)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
importOrdersCall
public okhttp3.Call importOrdersCall(List<OrdersImportCreateRequestBodyItem> ordersImportCreateRequestBodyItem, ApiCallback _callback) throws ApiException Build call for importOrders- Parameters:
ordersImportCreateRequestBodyItem- The request body is sent in the form of an array of order objects. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
importOrders
public OrdersImportCreateResponseBody importOrders(List<OrdersImportCreateRequestBodyItem> ordersImportCreateRequestBodyItem) throws ApiException Import Orders 🚧 Historical orders This endpoint should only be used to import historical orders into Voucherify. For on-going synchronization, the create order and update order endpoints should be used. This is critical because this endpoint does not store events or launch distributions. # Limitations ## Import volume There can be only a single on-going order import per tenant per project at a given time. The user can schedule more imports but those extra imports will be scheduled to run in sequence one by one. ## Maximum count of orders in single import There is a 2000 limit but we might decide to change it to a lower / higher value at any given time depending if we find this value is too high or too low with time. # Notifications There are no notifications on the Dashboard because this import is launched via the API. # Triggered actions If you import orders with customers, then a logic will be scheduled responsible for placing these customers into segments and refreshing the segments summary. Consequently, this update will trigger - **customers entering into segments** - **distributions** based on any rules tied to customer entering segment(s) - **earning rules** based on the customer entering segment(s) # What is not triggered 1. No webhooks are triggered during the import of orders - for both orders and upserted products / skus. 2. Distributions based on Order Update, Order Paid, Order Created and Order Cancelled. In other words if you have a distribution based on Order Paid and you import an order with a PAID status, the distribution is not going to be triggered. 3. No events are created during the import of orders - for both orders and upserted products / skus. In other words you wont see any events in the Activity tab in the Dashboard such as Order created or Order paid. If you are additionally upserting products / skus, then you wont see the Product created events listed, etc. 4. Earning rules based on Order Paid wont be triggered. This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.- Parameters:
ordersImportCreateRequestBodyItem- The request body is sent in the form of an array of order objects. (optional)- Returns:
- OrdersImportCreateResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
importOrdersWithHttpInfo
public ApiResponse<OrdersImportCreateResponseBody> importOrdersWithHttpInfo(List<OrdersImportCreateRequestBodyItem> ordersImportCreateRequestBodyItem) throws ApiException Import Orders 🚧 Historical orders This endpoint should only be used to import historical orders into Voucherify. For on-going synchronization, the create order and update order endpoints should be used. This is critical because this endpoint does not store events or launch distributions. # Limitations ## Import volume There can be only a single on-going order import per tenant per project at a given time. The user can schedule more imports but those extra imports will be scheduled to run in sequence one by one. ## Maximum count of orders in single import There is a 2000 limit but we might decide to change it to a lower / higher value at any given time depending if we find this value is too high or too low with time. # Notifications There are no notifications on the Dashboard because this import is launched via the API. # Triggered actions If you import orders with customers, then a logic will be scheduled responsible for placing these customers into segments and refreshing the segments summary. Consequently, this update will trigger - **customers entering into segments** - **distributions** based on any rules tied to customer entering segment(s) - **earning rules** based on the customer entering segment(s) # What is not triggered 1. No webhooks are triggered during the import of orders - for both orders and upserted products / skus. 2. Distributions based on Order Update, Order Paid, Order Created and Order Cancelled. In other words if you have a distribution based on Order Paid and you import an order with a PAID status, the distribution is not going to be triggered. 3. No events are created during the import of orders - for both orders and upserted products / skus. In other words you wont see any events in the Activity tab in the Dashboard such as Order created or Order paid. If you are additionally upserting products / skus, then you wont see the Product created events listed, etc. 4. Earning rules based on Order Paid wont be triggered. This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.- Parameters:
ordersImportCreateRequestBodyItem- The request body is sent in the form of an array of order objects. (optional)- Returns:
- ApiResponse<OrdersImportCreateResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
importOrdersAsync
public okhttp3.Call importOrdersAsync(List<OrdersImportCreateRequestBodyItem> ordersImportCreateRequestBodyItem, ApiCallback<OrdersImportCreateResponseBody> _callback) throws ApiException Import Orders (asynchronously) 🚧 Historical orders This endpoint should only be used to import historical orders into Voucherify. For on-going synchronization, the create order and update order endpoints should be used. This is critical because this endpoint does not store events or launch distributions. # Limitations ## Import volume There can be only a single on-going order import per tenant per project at a given time. The user can schedule more imports but those extra imports will be scheduled to run in sequence one by one. ## Maximum count of orders in single import There is a 2000 limit but we might decide to change it to a lower / higher value at any given time depending if we find this value is too high or too low with time. # Notifications There are no notifications on the Dashboard because this import is launched via the API. # Triggered actions If you import orders with customers, then a logic will be scheduled responsible for placing these customers into segments and refreshing the segments summary. Consequently, this update will trigger - **customers entering into segments** - **distributions** based on any rules tied to customer entering segment(s) - **earning rules** based on the customer entering segment(s) # What is not triggered 1. No webhooks are triggered during the import of orders - for both orders and upserted products / skus. 2. Distributions based on Order Update, Order Paid, Order Created and Order Cancelled. In other words if you have a distribution based on Order Paid and you import an order with a PAID status, the distribution is not going to be triggered. 3. No events are created during the import of orders - for both orders and upserted products / skus. In other words you wont see any events in the Activity tab in the Dashboard such as Order created or Order paid. If you are additionally upserting products / skus, then you wont see the Product created events listed, etc. 4. Earning rules based on Order Paid wont be triggered. This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.- Parameters:
ordersImportCreateRequestBodyItem- The request body is sent in the form of an array of order objects. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
listOrdersCall
public okhttp3.Call listOrdersCall(Integer limit, Integer page, ParameterOrderListOrders order, ApiCallback _callback) throws ApiException Build call for listOrders- Parameters:
limit- Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. (optional)page- Which page of results to return. The lowest value is 1. (optional)order- This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
listOrders
public OrdersListResponseBody listOrders(Integer limit, Integer page, ParameterOrderListOrders order) throws ApiException List Orders Returns a list of orders.- Parameters:
limit- Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. (optional)page- Which page of results to return. The lowest value is 1. (optional)order- This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)- Returns:
- OrdersListResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
listOrdersWithHttpInfo
public ApiResponse<OrdersListResponseBody> listOrdersWithHttpInfo(Integer limit, Integer page, ParameterOrderListOrders order) throws ApiException List Orders Returns a list of orders.- Parameters:
limit- Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. (optional)page- Which page of results to return. The lowest value is 1. (optional)order- This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)- Returns:
- ApiResponse<OrdersListResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
listOrdersAsync
public okhttp3.Call listOrdersAsync(Integer limit, Integer page, ParameterOrderListOrders order, ApiCallback<OrdersListResponseBody> _callback) throws ApiException List Orders (asynchronously) Returns a list of orders.- Parameters:
limit- Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. (optional)page- Which page of results to return. The lowest value is 1. (optional)order- This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
updateOrderCall
public okhttp3.Call updateOrderCall(String orderId, OrdersUpdateRequestBody ordersUpdateRequestBody, ApiCallback _callback) throws ApiException Build call for updateOrder- Parameters:
orderId- Unique Voucherify order ID or order source ID. (required)ordersUpdateRequestBody- Specify the parameters of the order that are to be updated. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
updateOrder
public OrdersUpdateResponseBody updateOrder(String orderId, OrdersUpdateRequestBody ordersUpdateRequestBody) throws ApiException Update Order Updates the specified order by setting the values of the parameters passed in the request body. Any parameters not provided will be left unchanged.- Parameters:
orderId- Unique Voucherify order ID or order source ID. (required)ordersUpdateRequestBody- Specify the parameters of the order that are to be updated. (optional)- Returns:
- OrdersUpdateResponseBody
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
updateOrderWithHttpInfo
public ApiResponse<OrdersUpdateResponseBody> updateOrderWithHttpInfo(String orderId, OrdersUpdateRequestBody ordersUpdateRequestBody) throws ApiException Update Order Updates the specified order by setting the values of the parameters passed in the request body. Any parameters not provided will be left unchanged.- Parameters:
orderId- Unique Voucherify order ID or order source ID. (required)ordersUpdateRequestBody- Specify the parameters of the order that are to be updated. (optional)- Returns:
- ApiResponse<OrdersUpdateResponseBody>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
updateOrderAsync
public okhttp3.Call updateOrderAsync(String orderId, OrdersUpdateRequestBody ordersUpdateRequestBody, ApiCallback<OrdersUpdateResponseBody> _callback) throws ApiException Update Order (asynchronously) Updates the specified order by setting the values of the parameters passed in the request body. Any parameters not provided will be left unchanged.- Parameters:
orderId- Unique Voucherify order ID or order source ID. (required)ordersUpdateRequestBody- Specify the parameters of the order that are to be updated. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-