PHP code example of mehr-it / otto-orders-api-client
1. Go to this page and download the library: Download mehr-it/otto-orders-api-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mehr-it / otto-orders-api-client example snippets
Instance = new MehrIt\OttoOrdersApiClient\Api\ALLApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$sales_order_id = "sales_order_id_example"; // string | The Sales Order Id of the order to cancel
$position_item_id = array("position_item_id_example"); // string[] | The ids of the PositionItems to cancel
try {
$apiInstance->cancelPartnerOrderPositionItems($sales_order_id, $position_item_id);
} catch (Exception $e) {
echo 'Exception when calling ALLApi->cancelPartnerOrderPositionItems: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new MehrIt\OttoOrdersApiClient\Api\ALLApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$sales_order_id = array("sales_order_id_example"); // string[] | The Sales Order Id of the order to cancel
try {
$apiInstance->cancelPartnerOrders($sales_order_id);
} catch (Exception $e) {
echo 'Exception when calling ALLApi->cancelPartnerOrders: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new MehrIt\OttoOrdersApiClient\Api\ALLApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$from_date = "from_date_example"; // string | Defines, which minimum change date the returned order should have. In ISO 8601 format.
$from_order_date = "from_order_date_example"; // string | Lower boundary of filter by order date: Only orders newer than the date specified will be returned. In ISO 8601 format.
$to_order_date = "to_order_date_example"; // string | Upper boundary of filter by order date: Only orders older than the date specified will be returned. In ISO 8601 format.
$fulfillment_status = "fulfillment_status_example"; // string | Defines, which minimum state the returned orders should have.<br>If ANNOUNCED is given, all orders, which have at least one PositionItem in ANNOUNCED state are returned.<br>If PROCESSABLE is given, all orders, which have at least one PositionItem in PROCESSABLE state and none in ANNOUNCED state are returned.<br>If SENT is given, all orders, which have at least one PositionItem in SENT state and none in either ANNOUNCED or PROCESSABLE state are returned.<br>If RETURNED is given, all orders, which have at least one PositionItem in RETURNED state and none in either ANNOUNCED or PROCESSABLE or SENT state are returned.<br>If CANCELLED_BY_PARTNER is given, all orders, which have at least one PositionItem in CANCELLED_BY_PARTNER state are returned.<br>If CANCELLED_BY_MARKETPLACE is given, all orders, which have at least one PositionItem in CANCELLED_BY_MARKETPLACE state are returned.<br>If none is provided, all status will be returned.<br>Several values can be passed via request param array, when multiple values passed, search result will be combination of multiple fulfillmentStatuses - no duplicates will appear.<br>Example: ?fulfillmentStatus=PROCESSABLE&fulfillmentStatus=CANCELLED_BY_MARKETPLACE - will return orders in these 3 fulfillmentStatuses.<br>Alternatively, mode can be passed for a different search type. BUCKET/AT_LEAST_ONE, where BUCKET is default behaviour explained above and AT_LEAST_ONE checks if there is at least 1 PositionItem with passed fulfillmentStatus/fulfillmentStatuses.
$limit = 128; // int | The maximum amount of returned orders
$order_direction = "ASC"; // string |
$order_column_type = "ORDER_LIFECYCLE_DATE"; // string |
$mode = "BUCKET"; // string | The search mode. Default search mode is bucket search
$nextcursor = "nextcursor_example"; // string | For paging request this cursor is
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.