> For new integrations, EasyParcel recommends the NextGen API: https://developer.easyparcel.com/

# Get Parcel Category

> EasyParcel API · Malaysia · MarketPlace · version 1.4.0.0
> Page: https://developers.easyparcel.com/my/marketplace/get-parcel-category · Markdown: https://developers.easyparcel.com/my/marketplace/get-parcel-category.md · PDF: https://developers.easyparcel.com/pdf/Malaysia_MarketPlace_1.4.0.0.pdf

This endpoint is designed to get the parcel category id for orders

## Endpoint

- Method: `POST`
- Demo URL: `https://demo.connect.easyparcel.my/?ac=EPGetParcelCategory`
- Live URL: `https://connect.easyparcel.my/?ac=EPGetParcelCategory`
- Body: `application/x-www-form-urlencoded`. Nested fields use PHP `http_build_query` names, e.g. `bulk[0][pick_code]`.
- Action: `EPGetParcelCategory`

## Request parameters

### Request L1

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `api` | string(25) | Yes | Obtain from registered account. |

## Sample code

### PHP

```php
<?php
$domain = "https://demo.connect.easyparcel.my/?ac=";

$action = "EPGetParcelCategory";
$postparam = array(
    'api' => 'xxxxxx',
);

$url = $domain.$action;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postparam));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

ob_start();
$return = curl_exec($ch);
ob_end_clean();
curl_close($ch);

$json = json_decode($return);
echo "<pre>"; print_r($json); echo "</pre>";
?>
```

### cURL

```bash
curl -X POST 'https://demo.connect.easyparcel.my/?ac=EPGetParcelCategory' \
  --data-urlencode 'api=xxxxxx'
```

## Response

### Response L1

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `api_status` | string(10) | Validation result |  |
| `error_code` | int(5) | Error code |  |
| `error_remark` | string(100) | Error message |  |
| `result` |  | Result for making order |  |

### Response L2

| Field | Type | Description | Remarks |
| --- | --- | --- | --- |
| `parcel_category_id` | int(5) | used when creating order with tax and duty |  |
| `parcel_category` | string(100) | parcel description |  |

## Response samples

### Success

```json
{
  "api_status":"Success",
  "error_code":"0",
  "error_remark":"",
  "result":[
    {
      "parcel_category_id":1,
      "parcel_category":"Bags & Luggages"
    },
    {
      "parcel_category_id":2,
      "parcel_category":"Board Games"
    },
    {
      "parcel_category_id":4,
      "parcel_category":"Cameras"
    },
    {
      "parcel_category_id":5,
      "parcel_category":"Books"
    },
    {
      "parcel_category_id":9,
      "parcel_category":"Gaming"
    },
    {
      "parcel_category_id":11,
      "parcel_category":"Home Appliances"
    },
    {
      "parcel_category_id":12,
      "parcel_category":"Home Decor"
    },
    {
      "parcel_category_id":13,
      "parcel_category":"Jewelry"
    },
    {
      "parcel_category_id":15,
      "parcel_category":"Pet Accessory"
    },
    {
      "parcel_category_id":17,
      "parcel_category":"Sport & Leisure"
    },
    {
      "parcel_category_id":19,
      "parcel_category":"Toys"
    },
    {
      "parcel_category_id":20,
      "parcel_category":"Watches"
    },
    {
      "parcel_category_id":21,
      "parcel_category":"Automotive Accessories"
    },
    {
      "parcel_category_id":22,
      "parcel_category":"Document"
    },
    {
      "parcel_category_id":23,
      "parcel_category":"Bird\u2019s Nest"
    },
    {
      "parcel_category_id":24,
      "parcel_category":"Computers And Parts \/ Telecommunication Parts And Equipments"
    },
    {
      "parcel_category_id":25,
      "parcel_category":"Food Enhancers\/Stabilizers\/Supplements"
    },
    {
      "parcel_category_id":26,
      "parcel_category":"Perishable Food"
    },
    {
      "parcel_category_id":27,
      "parcel_category":"Non Perishable Food"
    },
    {
      "parcel_category_id":28,
      "parcel_category":"Fashion And Accessories"
    },
    {
      "parcel_category_id":29,
      "parcel_category":"Cosmetic And Beauty Product"
    },
    {
      "parcel_category_id":30,
      "parcel_category":"Pesticides"
    },
    {
      "parcel_category_id":31,
      "parcel_category":"Health Supplements"
    },
    {
      "parcel_category_id":32,
      "parcel_category":"Plant"
    },
    {
      "parcel_category_id":33,
      "parcel_category":"Accessories"
    },
    {
      "parcel_category_id":34,
      "parcel_category":"Bag"
    },
    {
      "parcel_category_id":35,
      "parcel_category":"Face Mask"
    },
    {
      "parcel_category_id":36,
      "parcel_category":"Garments"
    },
    {
      "parcel_category_id":37,
      "parcel_category":"Gifts"
    },
    {
      "parcel_category_id":38,
      "parcel_category":"Household Products"
    },
    {
      "parcel_category_id":39,
      "parcel_category":"Printed Material"
    },
    {
      "parcel_category_id":40,
      "parcel_category":"Snacks"
    },
    {
      "parcel_category_id":41,
      "parcel_category":"Pillow"
    },
    {
      "parcel_category_id":42,
      "parcel_category":"Shoes"
    },
    {
      "parcel_category_id":43,
      "parcel_category":"Toiletries"
    },
    {
      "parcel_category_id":44,
      "parcel_category":"Kitchenware"
    }
  ]
}
```

### Fail

```json
{
  "api_status":"Error",
  "error_code":"3",
  "error_remark":"Required api key",
  "result":[
    
  ]
}
```

Support: WhatsApp EasyParcel API Support — https://api.whatsapp.com/send/?phone=6042023160

Published by EasyParcel Sdn Bhd (1028666-H).
