# Export Job

The jobs endpoint provides a programmatic way of running long running background tasks with Eshopbox.

The process of downloading a file can take a long time which should not block user's experience. Hence to carry process in background we have Jobs.&#x20;

{% tabs %}
{% tab title="Attributes" %}

| Attribute       | Type     | Description                                                                                                    |
| --------------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `id`            | `number` | Id to define the export job uniquely                                                                           |
| `jobType`       | `string` | Export Job for different modules .For details refer the [The Job Type Object](#the-job-type-object)            |
| `channelId`     | `number` | The channel for which file has been downloaded.                                                                |
| `fileType`      | `string` | Different export type formats  eg.  `CSV`                                                                      |
| `exportFilters` | `object` | Filter parameters required while downloading the respective file                                               |
| `filePath`      | `string` | Path file of downloaded file                                                                                   |
| `status`        | `string` | Status to track the progress of downloaded file. For details refer the [The Status Object](#the-status-object) |
| `userId`        | `number` | Id to define the export job uniquely                                                                           |
| `createdAt`     | `string` | Creation date and time                                                                                         |
| `updatedAt`     | `string` | Updation date and time                                                                                         |
| {% endtab %}    |          |                                                                                                                |

{% tab title="Sample Json" %}

```
{
    "id": "3675",
    "jobType": "order_return",
    "channelId": "0",
    "fileType": "CSV",
    "exportFilters": {
        "orderCreatedDateRange": "{}",
        "skuStyleCodeEanDropdown": "",
        "orderItemID": "",
        "channel": "",
        "combo": "NO",
        "invoiceDateRange": "{}",
        "vertical": "",
        "styleCode": "",
        "customerOrderNumber": "",
        "warehouseName": "",
        "skuStyleCodeEanDropdownValue": "",
        "ean": "",
        "portalName": "",
        "paymentMethod": "COD",
        "orderShipedDateRange": "{}",
        "sku": "",
        "brand": "",
        "status": "CREATED"
    },
    "filePath": "",
    "status": "0",
    "userId": "70", 
    "createdAt": "2019-12-19T19:16:25.000Z",
    "updatedAt": "2019-12-19T19:16:25.000Z"
}
```

{% endtab %}
{% endtabs %}

## The Job Type Object

| Job Type                  | Description                                                       |
| ------------------------- | ----------------------------------------------------------------- |
| `get_listing`             |                                                                   |
| `get_inventory`           | Download inventories for amazon wholesale                         |
| `fee_rule`                | Download charge rules of a particular fee                         |
| `grn_items`               | Download inward consignment items                                 |
| `order_return`            | Download order return items                                       |
| `rejected_grn_items`      | Download rejected inward consignment items                        |
| `gatepass_items`          | Download packed recall consignment items                          |
| `activity_payment_report` | Download payout report after reconciliation                       |
| `payment_report`          | Download original payout report                                   |
| `fee_return`              |                                                                   |
| `statement`               |                                                                   |
| `previous_payment`        | Download payment report                                           |
| `invoice_event`           | Download receivables details                                      |
| `expense_event`           | Download payables details                                         |
| `product`                 | Download Products with inventory and product availability details |

## The Status Object

| Status Value | Description                                          |
| ------------ | ---------------------------------------------------- |
| `processing` | The job is currently running.                        |
| `completed`  | The job is completed and file is ready for download. |
| `failed`     | The job couldn't be completed due to some error.     |
