# Get all Orders

Below you will find the key bindings you have to use to retrieve the value in the response object. The keys will be passed as comma-separated strings against the "**fields**" parameter value.

For example, account,customerOrderNumber,vendorOrderNumber,orderDetails.isCod

| Keys to retrieve                                         | Datatype                                   | Definition                                                                                                                               |
| -------------------------------------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| objectID                                                 | String                                     | Object ID assigned to the transactions.                                                                                                  |
| account                                                  | String                                     | Slug of you Eshopbox workspace.                                                                                                          |
| erpDetails.eshopboxId                                    | String                                     | Unique identified in Eshopbox for each transactions.                                                                                     |
| customerOrderNumber                                      | String                                     | It is the unique ID generated by the channel for fulfillment purpose.                                                                    |
| serialNumber                                             | String                                     | Product serial number of order item.                                                                                                     |
| vendorOrderNumber                                        | String                                     | It is the unique ID generated by the channel to communicate with the customer.                                                           |
| orderItemID                                              | String                                     | Unique ID assigned the each item of the order. For example: If an order has multiple items, each item will be assigned with a unique id. |
| orderStatus                                              | String                                     | Forward journey order status of an order item.                                                                                           |
| returnStatus                                             | String                                     | Reverse journey return status of an order item.                                                                                          |
| transactionStatus                                        | String                                     | Transaction status of the order in Eshopbox. (Open, Invoiced, Refunded, Void)                                                            |
| inventoryItemCode                                        | String                                     | The unique item barcode processed by the FC against this order item. This is applicable only if you have item level traceability.        |
| onHold                                                   | Enum (0, 1)                                | <p>On hold flag to denote if an item is on hold.<br>If onHold is 1, means the the order is on hold.</p>                                  |
| thirdPartyShipping                                       | String                                     | <p>If third-party shipping is enabled.<br>If third party is 0 (disabled), then shipping is managed by Eshopbox.</p>                      |
| customerDetails.shippingCustomerName                     | String                                     | Shipping customer name.                                                                                                                  |
| customerDetails.shippingContactPhone                     | String                                     | Shipping contact phone number.                                                                                                           |
| customerDetails.shippingEmail                            | String                                     | Shipping contact email address.                                                                                                          |
| customerDetails.shippingCity                             | String                                     | Shipping city.                                                                                                                           |
| customerDetails.shippingState                            | String                                     | Shipping state.                                                                                                                          |
| customerDetails.shippingPostalCode                       | String                                     | Shipping pincode.                                                                                                                        |
| customerDetails.billingCustomerName                      | String                                     | Billing customer name.                                                                                                                   |
| customerDetails.billingEmail                             | String                                     | Billing contact phone number.                                                                                                            |
| customerDetails.billingContactPhone                      | String                                     | Billing contact email address.                                                                                                           |
| customerDetails.billingCity                              | String                                     | Billing city.                                                                                                                            |
| customerDetails.billingState                             | String                                     | Billing state.                                                                                                                           |
| customerDetails.billingPostalCode                        | String                                     | Billing pincode.                                                                                                                         |
| orderDetails.portalName                                  | String                                     | Portal name.                                                                                                                             |
| orderDetails.saleChannel                                 | String                                     | Sale channel code.                                                                                                                       |
| orderDetails.isCod                                       | Enum (0, 1)                                | Flag to denote whether order is Prepaid (0) or COD (1)                                                                                   |
| orderDetails.orderDate                                   | Long                                       | Timestamp (in milliseconds) of when order was placed on the sales channel.                                                               |
| orderItemDetails.productName                             | String                                     | Name of the product.                                                                                                                     |
| orderItemDetails.ean                                     | String                                     | EAN.                                                                                                                                     |
| orderItemDetails.hsn                                     | String                                     | HSN code                                                                                                                                 |
| orderItemDetails.combo                                   | Enum (Yes, No)                             | If order item is a virtual kit.                                                                                                          |
| orderItemDetails.esin                                    | String                                     | ESIN (Unique product identifier in Eshopbox system).                                                                                     |
| orderItemDetails.sku                                     | String                                     | SKU of the product.                                                                                                                      |
| orderItemDetails.brand                                   | String                                     | Brand.                                                                                                                                   |
| orderItemDetails.mrp                                     | String                                     | Product MRP.                                                                                                                             |
| vkComponents.ean                                         | String                                     | EAN of the virtual kit component                                                                                                         |
| shipmentDetails.facilityCode                             | String                                     | Fulfillment center code.                                                                                                                 |
| shipmentDetails.invoiceTotal                             | String                                     | Invoice total of the order item.                                                                                                         |
| shipmentDetails.shipmentNumber                           | String                                     | Shipment unique identifier in Eshopbox.                                                                                                  |
| shipmentDetails.region                                   | String                                     | Shipping zone.                                                                                                                           |
| shipmentDetails.trackingId                               | String                                     | Shipment tracking ID.                                                                                                                    |
| shipmentDetails.courierName                              | String                                     | Courier name.                                                                                                                            |
| shipmentDetails.weight                                   | String                                     | Weight of the shipment in kilograms.                                                                                                     |
| shipmentDetails.invoiceNumber                            | String                                     | Shipment invoice number.                                                                                                                 |
| shipmentDetails.invoiceDate                              | String                                     | Invoice date on channel.                                                                                                                 |
| shipmentTrackingDetails.expectedHandoverDate             | String                                     | Expected date of Handover                                                                                                                |
| shipmentTrackingDetails.deliveredTimestamp               | Long                                       | Timestamp (in milliseconds) of when shipment was delivered.                                                                              |
| shipmentTrackingDetails.delayedDeliveryTag               | Enum(On time, Delayed, Failed)             | Tag denoting whether delivery was delayed or not                                                                                         |
| shipmentTrackingDetails.location                         | String                                     | Shipment current location.                                                                                                               |
| shipmentTrackingDetails.slaResolution                    | Enum(Yes, No, SLA not applicable)          | SLA of shipment delivery.                                                                                                                |
| shipmentTrackingDetails.expectedDeliveryDate             | Long                                       | Expected date of delivery.                                                                                                               |
| shipmentTrackingDetails.packedTimestamp                  | Long                                       | Timestamp (in milliseconds) of when items were packed.                                                                                   |
| shipmentTrackingDetails.outForDeliveryAttempts           | Integer                                    | Number of delivery attempts.                                                                                                             |
| orderNewTimestamp                                        | Long                                       | When order item was set as New in Eshopbox workspace.                                                                                    |
| orderProcessingTimestamp                                 | Long                                       | When order item was set as Processing in Eshopbox workspace.                                                                             |
| orderReadyToShipTimestamp                                | Long                                       | When order item was set as ReadyToShip in Eshopbox workspace.                                                                            |
| orderOnTheWayTimestamp                                   | Long                                       | When order item was set as OnTheWay in Eshopbox workspace.                                                                               |
| orderOutForDeliveryTimestamp                             | Long                                       | When order item was set as OutForDelivery in Eshopbox workspace.                                                                         |
| orderDeliveredTimestamp                                  | Long                                       | When order item was set as Delivered in Eshopbox workspace.                                                                              |
| rtsTag                                                   | String                                     | Order ready to ship tag.                                                                                                                 |
| expectedShipDate                                         | Long                                       | Expected date of ready to ship.                                                                                                          |
| orderReceivedOn                                          | Long                                       | When order was created in Eshopbox system.                                                                                               |
| orderDeliveredOn                                         | Long                                       | When order item was set as Delivered in Eshopbox workspace.                                                                              |
| firstOnTheWayTimestamp                                   | Long                                       | When shipment was marked on the way for the first time.                                                                                  |
| firstOFDTimestamp                                        | Long                                       | When shipment was marked out for delivery for the first time.                                                                            |
| firstRTSTimestamp                                        | Long                                       | When the shipment was marked ready to ship.                                                                                              |
| returns.returnProcessingTimestamp                        | Long                                       | When returns item was set as Processing in Eshopbox workspace.                                                                           |
| returns.returnRestockedTimestamp                         | Long                                       | When returns item was set as Restocked in Eshopbox workspace.                                                                            |
| returns.returnDetails.shippingProvider                   | String                                     | Return shipment courier name.                                                                                                            |
| returns.returnDetails.returnItemCondition                | Enum(Sellable, Non sellable, Item missing) | Return item condition.                                                                                                                   |
| returns.returnDetails.resolution                         | Enum(Exchange, Refund)                     | Return resolution of the return item.                                                                                                    |
| returns.returnDetails.returnItemAction                   | Enum(Restocked, Quarantined, Return Lost)  | Return item action taken while processing in the warehouse.                                                                              |
| returns.returnDetails.trackingId                         | String                                     | Return shipment tracking ID.                                                                                                             |
| returns.returnDetails.type                               | String                                     | Type of return.                                                                                                                          |
| returns.returnDetails.returnReason                       | String                                     | Reason for return.                                                                                                                       |
| returns.returnDetails.returnSubReason                    | String                                     | Additonal reason/remarks for return.                                                                                                     |
| returns.returnDetails.reversePickupCode                  | String                                     | Reverse RP code.                                                                                                                         |
| returns.returnDetails.weight                             | Double                                     | Weight of the return shipment.                                                                                                           |
| returns.returnDetails.length                             | Double                                     | Length of the return shipment.                                                                                                           |
| returns.returnDetails.width                              | Double                                     | Width of the return shipment.                                                                                                            |
| returns.returnDetails.height                             | Double                                     | Height of the return shipment.                                                                                                           |
| returns.returnDetails.completedOnTimestamp               | Long                                       | Timestamp (in millisecond) when return item was processed in the warehouse.                                                              |
| returns.returnDetails.receivedOnTimestamp                | Long                                       | Timestamp (in millisecond) when return item was received at the warhouse.                                                                |
| returns.returnDetails.createdOnTimestamp                 | Long                                       | Timestamp (in millisecond) when return on the item was created in Eshopbox.                                                              |
| returns.returnDetails.totalItems                         | Integer                                    | Total items in the return shipment.                                                                                                      |
| returns.returnTrackingDetails.slaResolution              | String                                     | SLA tag of return shipment delivery.                                                                                                     |
| returns.returnTrackingDetails.returnDeliveredOnTimestamp | Long                                       | When returns item was set as Delivered by courier partner.                                                                               |
| returns.returnTrackingDetails.delayedPickupTag           | String                                     | Tag denoting whether pickup was delayed or not.                                                                                          |
| returns.returnTrackingDetails.expectedPickupDate         | Long                                       | Expected pickup date of the return.                                                                                                      |
| orderItemDetails.newRefundDetails.refundAmount           | Double                                     | Refund amount initiated to the customer. This is available only for Eshopbox payment gateway.                                            |
| updatedAt                                                | Long                                       | Timestamp (in millisecond) when order item was updated in Eshopbox system.                                                               |
| currentOrderStatus                                       | String                                     | Current status of the order item.                                                                                                        |
| transactionStatus                                        | String                                     | Transaction status of the order. (New, Invoiced, Refunded, Void)                                                                         |
| erpDetails.paymentId                                     | String                                     | Payment Id of the order.                                                                                                                 |
| erpDetails.billFrom                                      | String                                     | Bill From. The ERP code configured in Eshopbox provided by you.                                                                          |
| erpDetails.billTo                                        | String                                     | Bill To.  The ERP code configured in Eshopbox provided by you.                                                                           |
| erpDetails.stateGstCode                                  | String                                     | State code.                                                                                                                              |
| erpDetails.invoiceTotal                                  | Double                                     | Invoice Total.                                                                                                                           |
| erpDetails.shippingCharges                               | Double                                     | Shipping Charges.                                                                                                                        |
| erpDetails.sellingPrice                                  | Double                                     | Selling Price.                                                                                                                           |
| erpDetails.taxRate                                       | Double                                     | Tax Rate.                                                                                                                                |
| erpDetails.ugstAmt                                       | Double                                     | Ugst Amt.                                                                                                                                |
| erpDetails.ugstRate                                      | Double                                     | Ugst Rate.                                                                                                                               |
| erpDetails.sgstAmt                                       | Double                                     | Sgst Amt.                                                                                                                                |
| erpDetails.sgstRate                                      | Double                                     | Sgst Rate.                                                                                                                               |
| erpDetails.cgstAmt                                       | Double                                     | Cgst Amt.                                                                                                                                |
| erpDetails.cgstRate                                      | Double                                     | Cgst Rate.                                                                                                                               |
| erpDetails.igstAmt                                       | Double                                     | Igst Amt.                                                                                                                                |
| erpDetails.igstRate                                      | Double                                     | Igst Rate.                                                                                                                               |
| erpDetails.shippingAddress                               | String                                     | Customer shipping address.                                                                                                               |
| erpDetails.billingAddress                                | String                                     | Customer billing address.                                                                                                                |
| erpDetails.shippingStateGstCode                          | String                                     | Shipping state GST code.                                                                                                                 |
| erpDetails.billingStateGstCode                           | String                                     | Billing state GST code.                                                                                                                  |
| lastFailedDeliveryReason                                 | String                                     | Last reason for failed delivery.                                                                                                         |
| cancellationDetails.type                                 | String                                     | Cancellation type                                                                                                                        |
| cancellationDetails.reason                               | String                                     | Cancellation reason                                                                                                                      |
| cancellationDetails.additionalRemarks                    | String                                     | Cancellation reason additional remarks                                                                                                   |

## Get all Orders

<mark style="color:blue;">`GET`</mark> `https://{{workspace}}.myeshopbox.com/api/v1/orders/erp`

#### Query Parameters

| Name                                      | Type    | Description                                                                       |
| ----------------------------------------- | ------- | --------------------------------------------------------------------------------- |
| filters<mark style="color:red;">\*</mark> | String  | You can add a filter for filtered data                                            |
| page                                      | String  | The number of pages to offset the results by.                                     |
| per\_page                                 | Integer | The number of items to return per page.                                           |
| fields<mark style="color:red;">\*</mark>  | String  | Exhaustive list of fields to be retrieved in response, in comma-separated string. |
| search                                    | String  | Keyword which you'll want to search in records                                    |

#### Headers

| Name                                             | Type   | Description                               |
| ------------------------------------------------ | ------ | ----------------------------------------- |
| Authentication<mark style="color:red;">\*</mark> | String | Bearer token to grant access against API. |

{% tabs %}
{% tab title="200 Order successfully retrieved." %}

```php
{
    "hits": [
        {
            "customerOrderNumber" : "ORD10001",
            "vendorOrderNumber": "CUS-ORD-1001",
            "orderItemID": "12",
            "orderDetails": {
                "isCod": "0"
            }
        },
        {
            "customerOrderNumber" : "ORD10001",
            "vendorOrderNumber": "CUS-ORD-1001",
            "orderItemID": "22",
            "orderDetails": {
                "isCod": "0"
            }
        }
    ],
    "hasNext": true
}
```

{% endtab %}

{% tab title="200: OK Keys to retrieve as a reference." %}

```javascript
{
	"objectID": "2164|4901932564674|4901932564674-27822889",
	"account": "testing_brand_party",
	"customerOrderNumber": "4901932564674",
	"vendorOrderNumber": "#3012",
	"serialNumber": "APLHa728173",
	"orderItemID": "4901932564674-27822889",
	"orderItemId_PK": "27822889",
	"orderStatus": "Delivery cancelled",
	"returnStatus": "Restocked",
	"inventoryItemCode": "T-IB016057",
	"orderItemStatus": "CREATED",
	"onHold": "0",
	"thirdPartyShipping": "0",
	"ordersSyncLastPublishedOn": "1671108609241",
	"ordersHistoricSyncLastPublishedOn": "1672303883963",
	"serialNumber": "ASHT12",
	"customerDetails": {
		"shippingCustomerName": "rekha dhankher",
		"shippingContactPhone": "8178431593",
		"shippingEmail": "rekha.dhankher@eshopbox.com",
		"shippingCity": "Gurugram",
		"shippingState": "Haryana",
		"shippingPostalCode": "122001",
		"billingCustomerName": "rekha dhankher",
		"billingEmail": "rekha.dhankher@eshopbox.com",
		"billingContactPhone": "918178431593",
		"billingCity": "Gurugram",
		"billingState": "Haryana",
		"billingPostalCode": "122001"
	},
	"orderDetails": {
		"portalName": "Shopify",
		"channelId": "2164",
		"saleChannel": "CH2164",
		"subChannel": "CH2164",
		"orderId": "46221211",
		"integrationType": "7",
		"isCod": "1",
		"orderDate": "1671108170000",
		"paymentId": "n3xH7RUL6VwqgH8mVMubCaIYf"
	},
	"orderItemDetails": {
		"productFound": "Yes",
		"channelListingId": "44697143345346",
		"productName": "Notebook",
		"orderItemSku": "OK1ZX3H8E5M",
		"hsn": "123456",
		"itemImageLink": "https://cdn.filestackcontent.com/w5HeRlTGSolAtfJlBWrj",
		"combo": "No",
		"esin": "OK1ZX3H8E5M",
		"sku": "notebook",
		"brand": "DummyBrand",
		"mrp": 200.0
	},
	"shipmentDetails": {
		"shipmentId": "14280324",
		"facilityCode": "Test_FC",
		"invoiceTotal": 799.0,
		"shipmentNumber": "4901932564674-76842",
		"region": "Local",
		"trackingId": "I69320686",
		"courierName": "Eshopbox",
		"weight": 0.1,
		"warehouseName": "Test FC (TFC)",
		"warehouseId": "646",
		"invoiceNumber": "INVTESHY3482",
		"invoiceDate": "1671108629000",
		"partyId": "1570",
		"billingPartyId": "tes1570",
		"referenceBillingPartyId": "Test_FC"
	},
	"shipmentTrackingDetails": {
		"status": "rto_delivered_warehouse",
		"delayedDeliveryTag": "On time",
		"createdTimestamp": "1671108624000",
		"remarks": "synced",
		"slaResolution": "No",
		"packedTimestamp": "1671172099000",
		"outForDeliveryAttempts": 0
	},
	"orderNewTimestamp": "1671108187000",
	"orderProcessingTimestamp": "1671172052000",
	"orderReadyToShipTimestamp": "1671172099000",
	"orderDeliveryCancelledTimestamp": "1671173669000",
	"rtsTag": "On time",
	"expectedShipDate": "1671172200000",
	"orderReceivedOn": "1671108183000",
	"firstRTSTimestamp": "1671172099000",
	"currentTimestamp": "1672382391000",
	"returns": {
		"returnAwaitingPickupTimestamp": "1671108187000",
		"returnOnTheWayTimestamp": "1671173669000",
		"returnProcessingTimestamp": "1671173669000",
		"returnRestockedTimestamp": "1671181715000",
		"returnDetails": {
			"shippingProvider": "DTDC",
			"returnItemCondition": "Sellable",
			"returnItemAction": "Restocked",
			"trackingId": "I69320686",
			"type": "Courier initated return",
			"returnReason": "",
			"reversePickupCode": "T_EIIRID004393",
			"completedOnTimestamp": "1671181715000",
			"receivedOnTimestamp": "1671173669000",
			"createdOnTimestamp": "1671173669000"
		},
		"returnTrackingDetails": {
			"status": "rto_delivered_warehouse",
			"outForPickupAttempts": 0,
			"deliveryAttempts": 0,
			"returnDeliveredOnTimestamp": "1671173669000",
			"returnInTransitTimestamp": "1671173669000"
		},
		"unexpectedItemDetails": {
			"unexpectedItemQcRejectionReason": [
				"Wrong product received"
			],
			"unexpectedItemQty": "4",
			"unexpectedItemSKUs": [
				"notebook",
				"dfhfxgh",
				"Unknown product",
				"Unknown product"
			]
		}
	},
	"updatedAt": "1671173669000",
	"returnFlag": "1",
	"currentOrderStatus": "Restocked",
	"erpDetails": {
                "ugstRate": 0.0,
                "shippingCharges": 0.0,
                "sgstAmt": 0.0,
                "invoiceTotal": 29390.0,
                "billFrom": "Test_FC",
                "sellingPrice": 29390.0,
                "igstAmt": 4483.220338983051,
                "ugstAmt": 0.0,
                "shippingStateGstCode": "24",
                "cgstAmt": 0.0,
                "billTo": null,
                "cgstRate": 0.0,
                "billingStateGstCode": "24",
                "shippingAddress": "FP12-TP50, BODAKDEV, OFF. SG HIGHWAY",
                "sgstRate": 0.0,
                "billingAddress": "FP12-TP50, BODAKDEV, OFF. SG HIGHWAY",
                "igstRate": 18.0
        }
}
```

{% endtab %}
{% endtabs %}

## Get Invoiced Orders

<mark style="color:blue;">`GET`</mark> `https://{{workspace}}.myeshopbox.com/api/v1/orders/erp`

The below "filters" fetches Invoiced order items. You can add or remove the fields based on the requirement. This is a sample request for your reference.

#### Query Parameters

| Name                                      | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filters<mark style="color:red;">\*</mark> | String  | (orderReadyToShipTimestamp >= 1674671400000 AND orderReadyToShipTimestamp <= 1674757799999)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| page                                      | String  | 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| per\_page                                 | Integer | 100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| fields<mark style="color:red;">\*</mark>  | String  | vendorOrderNumber,serialNumber,orderDetails.saleChannel,erpDetails.billTo,erpDetails.billFrom,customerDetails.shippingState,erpDetails.stateGstCode,shipmentDetails.courierName,orderDetails.isCod,shipmentDetails.trackingId,orderItemDetails.channelListingId,orderItemDetails.brand,erpDetails.invoiceTotal,erpDetails.sellingPrice,erpDetails.shippingCharges,orderItemID,transactionStatus,shipmentDetails.warehouseName,customerDetails.shippingCity,customerDetails.shippingPostalCode,customerDetails.shippingContactPhone,orderReceivedOn,shipmentDetails.invoiceNumber,customerDetails.shippingCustomerName,orderItemDetails.hsn,customerOrderNumber,orderDetails.portalName,erpDetails.igstAmt,erpDetails.igstRate,erpDetails.cgstAmt,erpDetails.cgstRate,erpDetails.sgstAmt,erpDetails.sgstRate,erpDetails.ugstAmt,erpDetails.ugstRate,erpDetails.shippingAddress,erpDetails.billingAddress,erpDetails.shippingStateGstCode,erpDetails.billingStateGstCode |
| search                                    | String  | John Doe                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

#### Headers

| Name                                             | Type   | Description           |
| ------------------------------------------------ | ------ | --------------------- |
| Authentication<mark style="color:red;">\*</mark> | String | Bearer {{auth0Token}} |

{% tabs %}
{% tab title="200 Invoiced Order successfully retrieved." %}

```json
{
    "hasNext": true,
    "hits": [
        {
            "objectID": "2239|5164920864855|5164920864855-29118927",
            "customerOrderNumber": "5164920864855",
            "vendorOrderNumber": "SYM1160",
            "orderItemID": "5164920864855-29118927",
            "orderItemId_PK": "29118927",
            "customerDetails": {
                "shippingCustomerName": "Ashwin Prajapati",
                "shippingContactPhone": "7020983520",
                "shippingCity": "ahmedabad",
                "shippingState": "GUJARAT",
                "shippingPostalCode": "382418"
            },
            "orderDetails": {
                "portalName": "Shopify",
                "saleChannel": "CH2239",
                "isCod": "0"
            },
            "orderItemDetails": {
                "channelListingId": "41568449200215",
                "hsn": "84796000"
            },
            "shipmentDetails": {
                "trackingId": "19539155",
                "courierName": "Eshopbox",
                "warehouseName": "Test FC (TFC)",
                "invoiceNumber": "GT22730018"
            },
            "orderReceivedOn": "1676464155000",
            "erpDetails": {
                "ugstRate": 0.0,
                "shippingCharges": 0.0,
                "sgstAmt": 0.0,
                "invoiceTotal": 29390.0,
                "billFrom": "Test_FC",
                "sellingPrice": 29390.0,
                "igstAmt": 4483.220338983051,
                "ugstAmt": 0.0,
                "shippingStateGstCode": "24",
                "cgstAmt": 0.0,
                "billTo": null,
                "cgstRate": 0.0,
                "billingStateGstCode": "24",
                "shippingAddress": "FP12-TP50, BODAKDEV, OFF. SG HIGHWAY",
                "sgstRate": 0.0,
                "billingAddress": "FP12-TP50, BODAKDEV, OFF. SG HIGHWAY",
                "igstRate": 18.0
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get Credit Note Orders

<mark style="color:blue;">`GET`</mark> `https://{{workspace}}.myeshopbox.com/api/v1/orders/erp`

The below "filters" value fetches the Return processed (Credit Note) order items. You can add or remove the fields based on the requirements. This is a sample request for your reference.

#### Query Parameters

| Name                                      | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ----------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filters<mark style="color:red;">\*</mark> | String  | (returns.returnDetails.createdOnTimestamp>=1674671400000)AND(returns.returnDetails.createdOnTimestamp<=1674757799999)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| page                                      | String  | 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| per\_page                                 | Integer | 100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| fields<mark style="color:red;">\*</mark>  | String  | vendorOrderNumber,serialNumber,orderDetails.saleChannel,erpDetails.billTo,erpDetails.billFrom,customerDetails.shippingState,erpDetails.stateGstCode,shipmentDetails.courierName,orderDetails.isCod,shipmentDetails.trackingId,orderItemDetails.channelListingId,orderItemDetails.brand,erpDetails.invoiceTotal,erpDetails.sellingPrice,erpDetails.shippingCharges,orderItemID,shipmentDetails.warehouseName,customerDetails.shippingCity,customerDetails.shippingPostalCode,customerDetails.shippingContactPhone,orderReceivedOn,shipmentDetails.invoiceNumber,customerDetails.shippingCustomerName,orderItemDetails.hsn,customerOrderNumber,orderDetails.portalName,erpDetails.igstAmt,erpDetails.igstRate,erpDetails.cgstAmt,erpDetails.cgstRate,erpDetails.sgstAmt,erpDetails.sgstRate,erpDetails.ugstAmt,erpDetails.ugstRate,erpDetails.shippingAddress,erpDetails.billingAddress,erpDetails.shippingStateGstCode,erpDetails.billingStateGstCode |
| search                                    | String  | John Doe                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

#### Headers

| Name                                             | Type   | Description           |
| ------------------------------------------------ | ------ | --------------------- |
| Authentication<mark style="color:red;">\*</mark> | String | Bearer {{auth0Token}} |

{% tabs %}
{% tab title="200 Credit Note Order successfully retrieved." %}

```
{
    "hasNext": true,
    "hits": [
        {
            "objectID": "2239|5164920864855|5164920864855-29118927",
            "customerOrderNumber": "5164920864855",
            "vendorOrderNumber": "SYM1160",
            "orderItemID": "5164920864855-29118927",
            "orderItemId_PK": "29118927",
            "customerDetails": {
                "shippingCustomerName": "Ashwin Prajapati",
                "shippingContactPhone": "7020983520",
                "shippingCity": "ahmedabad",
                "shippingState": "GUJARAT",
                "shippingPostalCode": "382418"
            },
            "orderDetails": {
                "portalName": "Shopify",
                "saleChannel": "CH2239",
                "isCod": "0"
            },
            "orderItemDetails": {
                "channelListingId": "41568449200215",
                "hsn": "84796000"
            },
            "shipmentDetails": {
                "trackingId": "19539155",
                "courierName": "Eshopbox",
                "warehouseName": "Test FC (TFC)",
                "invoiceNumber": "GT22730018"
            },
            "orderReceivedOn": "1676464155000",
            "erpDetails": {
                "ugstRate": 0.0,
                "shippingCharges": 0.0,
                "sgstAmt": 0.0,
                "invoiceTotal": 29390.0,
                "billFrom": "Test_FC",
                "sellingPrice": 29390.0,
                "igstAmt": 4483.220338983051,
                "ugstAmt": 0.0,
                "shippingStateGstCode": "24",
                "cgstAmt": 0.0,
                "billTo": null,
                "cgstRate": 0.0,
                "billingStateGstCode": "24",
                "shippingAddress": "FP12-TP50, BODAKDEV, OFF. SG HIGHWAY",
                "sgstRate": 0.0,
                "billingAddress": "FP12-TP50, BODAKDEV, OFF. SG HIGHWAY",
                "igstRate": 18.0
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get Orders cancelled after Ready to ship

<mark style="color:blue;">`GET`</mark> `https://{{workspace}}.myeshopbox.com/api/v1/orders/erp`

The below "filters" fetches order items which are cancelled after RTS. You can add or remove the fields based on the requirement. This is a sample request for your reference.

#### Query Parameters

| Name                                      | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ----------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filters<mark style="color:red;">\*</mark> | String  | shipmentTrackingDetails.cancelledTimestamp >= 1745134563000 AND shipmentTrackingDetails.cancelledTimestamp <= 1745480163000 AND orderReadyToShipTimestamp > 0 AND currentOrderStatus: "Cancelled"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| page                                      | String  | 0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| per\_page                                 | Integer | 100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| fields<mark style="color:red;">\*</mark>  | String  | vendorOrderNumber,serialNumber,orderDetails.saleChannel,erpDetails.billTo,erpDetails.billFrom,customerDetails.shippingState,erpDetails.stateGstCode,shipmentDetails.courierName,orderDetails.isCod,shipmentDetails.trackingId,orderItemDetails.channelListingId,orderItemDetails.brand,erpDetails.invoiceTotal,erpDetails.sellingPrice,erpDetails.shippingCharges,orderItemID,shipmentDetails.warehouseName,customerDetails.shippingCity,customerDetails.shippingPostalCode,customerDetails.shippingContactPhone,orderReceivedOn,shipmentDetails.invoiceNumber,customerDetails.shippingCustomerName,orderItemDetails.hsn,customerOrderNumber,orderDetails.portalName,erpDetails.igstAmt,erpDetails.igstRate,erpDetails.cgstAmt,erpDetails.cgstRate,erpDetails.sgstAmt,erpDetails.sgstRate,erpDetails.ugstAmt,erpDetails.ugstRate,erpDetails.shippingAddress,erpDetails.billingAddress,erpDetails.shippingStateGstCode,erpDetails.billingStateGstCode,orderReadyToShipTimestamp,currentOrderStatus |
| search                                    | String  | John Doe                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

#### Headers

| Name                                             | Type   | Description           |
| ------------------------------------------------ | ------ | --------------------- |
| Authentication<mark style="color:red;">\*</mark> | String | Bearer {{auth0Token}} |

{% tabs %}
{% tab title="200 Invoiced Order successfully retrieved." %}

```json
{
    "hasNext": true,
    "hits": [
        {
            "objectID": "1693|5976754618533|5976754618533-43864173",
            "customerOrderNumber": "5976754618533",
            "vendorOrderNumber": "#313488",
            "orderItemID": "5976754618533-43864173",
            "orderItemId_PK": "43864173",
            "customerDetails": {
                "shippingCustomerName": "Tashi Doma Acushla Dorji",
                "shippingContactPhone": "9999999999",
                "shippingCity": "Siliguri",
                "shippingState": "West Bengal",
                "shippingPostalCode": "734003"
            },
            "orderDetails": {
                "portalName": "Shopify",
                "saleChannel": "CH1693",
                "isCod": "0"
            },
            "orderItemDetails": {
                "channelListingId": "47093551497381",
                "hsn": "20081990"
            },
            "shipmentDetails": {
                "trackingId": "32346210404880",
                "courierName": "Eshopbox",
                "warehouseName": "Kolkata (ACCU)",
                "invoiceNumber": "INVFARWS45042"
            },
            "orderReadyToShipTimestamp": "1745379977000",
            "orderReceivedOn": "1745336595000",
            "erpDetails": {
                "ugstRate": 0.0,
                "shippingCharges": 0.0,
                "sgstAmt": 44.841963631766184,
                "invoiceTotal": 837.05,
                "billFrom": "ACCU",
                "sellingPrice": 837.05,
                "igstAmt": 0.0,
                "ugstAmt": 0.0,
                "shippingStateGstCode": "19",
                "cgstAmt": 44.841963631766184,
                "billTo": null,
                "cgstRate": 6.0,
                "billingStateGstCode": "19",
                "shippingAddress": "Flat No. 4B, Heritage Apartments, Meghnath Saha Sarani, Ward 2, Pradhan Nagar",
                "sgstRate": 6.0,
                "billingAddress": "Flat No. 4B, Heritage Apartments, Meghnath Saha Sarani, Ward 2, Pradhan Nagar",
                "igstRate": 0.0
            },
            "override": false,
            "currentOrderStatus": "Cancelled"
        },
        {
            "objectID": "1693|5976754618533|5976754618533-43864172",
            "customerOrderNumber": "5976754618533",
            "vendorOrderNumber": "#313488",
            "orderItemID": "5976754618533-43864172",
            "orderItemId_PK": "43864172",
            "customerDetails": {
                "shippingCustomerName": "Tashi Doma Acushla Dorji",
                "shippingContactPhone": "9999999999",
                "shippingCity": "Siliguri",
                "shippingState": "West Bengal",
                "shippingPostalCode": "734003"
            },
            "orderDetails": {
                "portalName": "Shopify",
                "saleChannel": "CH1693",
                "isCod": "0"
            },
            "orderItemDetails": {
                "channelListingId": "45747381829797",
                "hsn": "08135020"
            },
            "shipmentDetails": {
                "trackingId": "",
                "courierName": "Eshopbox",
                "warehouseName": "Kolkata (ACCU)",
                "invoiceNumber": ""
            },
            "orderReadyToShipTimestamp": "1745379977000",
            "orderReceivedOn": "1745336595000",
            "erpDetails": {
                "ugstRate": 0.0,
                "shippingCharges": 0.0,
                "sgstAmt": 34.30660792759487,
                "invoiceTotal": 640.39,
                "billFrom": "ACCU",
                "sellingPrice": 640.39,
                "igstAmt": 0.0,
                "ugstAmt": 0.0,
                "shippingStateGstCode": "19",
                "cgstAmt": 34.30660792759487,
                "billTo": null,
                "cgstRate": 6.0,
                "billingStateGstCode": "19",
                "shippingAddress": "Flat No. 4B, Heritage Apartments, Meghnath Saha Sarani, Ward 2, Pradhan Nagar",
                "sgstRate": 6.0,
                "billingAddress": "Flat No. 4B, Heritage Apartments, Meghnath Saha Sarani, Ward 2, Pradhan Nagar",
                "igstRate": 0.0
            },
            "override": false,
            "currentOrderStatus": "Cancelled"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

```
curl --location -g --request GET 'https://{{workspace}}.myeshopbox.com/api/v1/orders/erp?fields={{fieldToRetrieve}}&search={{search}}&filters={{filters}}&page={{pageCount}}&per_page={{perPageLimit}}' \
--header 'Authorization: Bearer {{auth0Token}}'
```
