Shipments APIs

Modified on Wed, 1 Oct at 8:41 PM

Create Shipment

Endpoint URL
POST https://api.tryoto.com/rest/v2/createShipment
Example Request Body

Here is an example of a request body:

{
  "orderId": "1232464",
  "deliveryOptionId": "12345"
}
Request Parameters
NameRequiredTypeDescription
orderIdyesstringOrder number for which you want to create a shipment
deliveryOptionIdnointActivated delivery company option id
pickingTypenoenumPossible values:
PICKUP_BY_DC: Shipping company offers free pickup from origin. BRANCH_DROP_OFF: Package must be delivered to a branch of the shipping company.
whoPaysnoenumIf implemented, annotates who wil pay for the shipment. Possible values: marketplacePaysDeliveryFee, sellerPaysDeliveryFee

Available Packages: All Packages

This API endpoint allows you create shipment for orders, while creating shipments need a valid delivery option id. You can get valid delivery options in two ways:

Delivery Options with OTO rates :

No contracted delivery companies or activation is required. OTO offers a range of delivery company options, which are available for use. You can view these options and their associated fees by using the `Check OTO Delivery Fee` endpoint.

Delivery Options with your own rates: In this case, you already have agreements with one or more delivery companies. Each delivery company you connect is linked to a specific delivery option ID. You can retrieve these IDs by using the `Get Delivery Options` or `checkDeliveryFee` endpoints.

Note: If deliveryOptionId is not sent on the request, the assignment is made to the delivery company that complies with your feasibility rule. If you do not have a feasibility rule setting, the order will be automatically assigned to the first delivery company added.

Request Parameters: |


Cancel Shipment

Endpoint URL
POST https://api.tryoto.com/rest/v2/cancelShipment
Example Request Body

Here is an example of a request body:

{
  "orderId": "24543ec5-1dd2-46a1-b4b3-d3bd47837665",
  "shipmentId": "F21SACO00227700000"
}
Request Parameters
NameRequiredTypeDescription
orderIdyesstringorderId from which shipment was created
shipmentIdyesstringShipment id to be cancelled.

Available Packages : All Packages

This API initiates the cancellation process with the shipping company.

Shipments cannot be canceled once they have reached the " picked up " status.

Some shipping companies do not support shipment cancellations, which may result in a failure response indicating the shipment could not be canceled.

Request Parameters: |


Shipment Transactions

Endpoint URL
GET https://api.tryoto.com/rest/v2/shipmentTransactions?perPage=10&page=1&minDate=2024-01-01&maxDate=2024-09-14
Request Parameters
NameRequiredTypeDescription
perPagenonumberThe number of transactions to be included per page.
pagenonumberThe page number for paginated results.
minDateyes (If there is no orderId)dateStarting "Transaction Date" of your credit transactions in "yyyy-mm-dd" format.
maxDateyes (If there is no orderId)dateEnding "Transaction Date" of your credit transactions in "yyyy-mm-dd" format.
orderIdnostringOrder ID for transactions of a single Order
shipmentNumbernostringShipment Number for transactions of a single shipment

### Shipment Transactions

Available Packages: All Packages

This API endpoint provides users with access to detailed information about shipment transactions. This API is designed to retrieve and display key transaction data, allowing users to monitor and review shipment related activities.It retrieves shipment transactions with the option to paginate and filter by minimum and maximum dates.

Note: If orderId exists maxDate and minDate are not required.

If shipment number exists maxDate and minDate are not required.

Request Parameters: |

#### Response Body

The response will include a `success` flag indicating the status of the request, and an `shipments` array containing transaction details. Each transaction object in the `shipments` array includes the following properties:

``` json

{

"success": true,

"shipments": [

{

"shipmentNumnber": "1231231AS",

"orderId": "123123",

"shipmentCreationDate": "2023 12 05T06:47:46",

"deliveryCompanyName": "deliveryCompany",

"dcConnectionName": "connectionName",

"shipmentType": "Forward Shipment",

"dcCharge": 25,

"currency": "TRY",

"originalWeight": 100,

"dcUpdatedWeight": 50,

"status": "status",

"dcInvoiceNumber": 15579456

}

```


Get Shipping Price Transactions List

Endpoint URL
POST https://api.tryoto.com/rest/v2/getShippingPriceTransactionsList
Example Request Body

Here is an example of a request body:

{
  "shipmentId": "2302416029",
  "orderId": "OID-22700-1013"
}
Request Parameters
NameRequiredTypeDescription
orderIdyesstringId of the order.
shipmentIdyesstringThe shipment ID to retrieve shipping cost details.

Available Packages: Starter Package, Scale Package, Enterprise Package, Marketplaces

This API endpoint provides details of your Shipping Price Transactions, calculated based on your configured shipping price settings. By providing either the Order ID or Shipment ID, you can retrieve the shipping cost along with other transactional details.

Important Note: The results from this API apply only to shipments created using your configured shipping price contracts. Shipping costs are calculated based on factors such as weight, destination, and other predefined configurations.

Request Parameters: |


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article