Our API allows you to retrieve detailed shipment transaction records, including financial details, using the getShipmentTransactions endpoint. This guide explains how to fetch shipment transactions efficiently.
Instructions
Step 1: API Endpoint
- To get shipment transactions, use the following GET endpoint:
https://api.tryoto.com/rest/v2/getShipmentTransactions
Step 2: Authorization
- A valid Bearer Token must be included in the request headers for authentication
Step 3: Request Body Parameters
- The request body should be in JSON format and must include at least one date filter.
| Name | Required | Type | Description |
|---|---|---|---|
| perPage | yes | number | Credit transaction count in the response. Max limit 100 |
| page | yes | number | Pagination number. You can iterate this field to get all items. |
| minDate | yes (If there is no orderId) | date | Starting "Transaction Date" of your credit transactions in "yyyy-mm-dd" format. |
| maxDate | yes (If there is no orderId) | date | Ending "Transaction Date" of your credit transactions in "yyyy-mm-dd" format. |
| orderId | no | string | Order ID for transactions of a single Order |
| shipmentNumber | no | string | Shipment Number for transactions of a single shipment |
Step 4: Example Request
Below is an example request to retrieve shipment transactions within a specific date range:
Using cURL:
curl --location 'https://api.tryoto.com/rest/v2/shipmentTransactions?perPage=10&page=1&minDate=2024-01-01&maxDate=2024-09-14'
Step 5: Example Response
- A successful response will return the shipment transaction details:
{ "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 }, { "shipmentNumnber": "12435356", "orderId": "342324234", "shipmentCreationDate": "2023-12-05T06:47:46", "deliveryCompanyName": "deliveryCompany", "dcConnectionName": "connectionName", "shipmentType": "Forward Shipment", "dcCharge": 40, "currency": "TRY", "originalWeight": 40, "dcUpdatedWeight": 5, "status": "status", "dcInvoiceNumber": 21626353729823 }, { "shipmentNumnber": "657567", "orderId": "34534534", "shipmentCreationDate": "2023-12-05T06:47:46", "deliveryCompanyName": "deliveryCompany", "dcConnectionName": "connectionName", "shipmentType": "Forward Shipment", "dcCharge": 60, "currency": "TRY", "originalWeight": 80, "dcUpdatedWeight": 80, "status": "status", "dcInvoiceNumber": 21626353729823120000 }, { "shipmentNumnber": "5423423", "orderId": "14335213", "shipmentCreationDate": "2023-12-05T06:47:46", "deliveryCompanyName": "deliveryCompany", "dcConnectionName": "connectionName", "shipmentType": "Forward Shipment", "dcCharge": 25, "currency": "TRY", "originalWeight": 100, "dcUpdatedWeight": 50, "status": "status", "dcInvoiceNumber": 2162635372 } ] }
In case of an empty result, the shipments array will be empty with a success flag set to true.