# Query

Query on status of declaration

## Endpoint

/api/declaration/query

## Request

**Request Parameter**

| Name | Mandatory | Description    | Type    | Default |
| ---- | :-------: | -------------- | ------- | ------- |
| id   |     Y     | Declaration ID | integer |         |

**Example Request:**

```
{
  "id": 123
}
```

## Response

**Successful Response Params**

| **Name**    | **Description** | **Type**          |
| ----------- | --------------- | ----------------- |
| declaration | Declaration     | Declaration Model |

**Example Response (VIP):**

```
{
    "status": "SUCCESS",
    "declaration": {
        "id": 123,
        "type": "C",
        "user": "marketplace_a_apple",
        "consignment_note": "TESTCN123456",
        "status": "A",
        "cover_date": "20181225",
        "from_country": "MYS",
        "to_country": "MYS",
        "from_address": "Shah Alam",
        "to_address": "12, Apartment Setia, Jalan ABC 123/2, 23400 PJ, Selangor",
        "goods_description": "1 x Samsung J5, 2 x USB Cable",
        "total_value": 2130.20,
        "courier_code": "OTHERS",
        "courier_others": "Jumbo",
        "total_surcharge": 42.60,
        "tax": 2.56,
        "total_charge": 45.16,
        "created_at": 1443349532,
        "cover_note_url": "https://xc-connect-sit.xpresscover.com/api/declaration/pdf/123/65c9041247ca616cc16ee45a11970136b5604725"
    }
}
```

**Example Response (Normal):**

```
{
    "status": "SUCCESS",
    "declaration": {
        "id": 124,
        "type": "N",
        "user": "marketplace_a_apple",
        "consignment_note": "TESTCN123457",
        "status": "A",
        "cover_date": "20181225",
        "from_country": "MYS",
        "to_country": "MYS",
        "from_city": "Shah Alam",
        "to_city": "Kepong",
        "total_value": 7000.00,
        "courier_code": "OTHERS",
        "courier_others": "Jumbo",
        "total_surcharge": 140.00,
        "tax": 8.40,
        "total_charge": 148.40,
        "created_at": 1443349532,
        "cover_note_url": "https://xc-connect-sit.xpresscover.com/api/declaration/pdf/123/65c9041247ca616cc16ee45a11970136b5604725",
        "items": [
            {
                "no": 1,
                "desciptions": "iPhone 6",
                "quantity": 1,
                "price": 3000.00,
                "subtotal": 3000.00,
                "commodity_code": "1002",
                "rate": 2.00,
                "surcharge": 60.00
            },
            {
                "no": 2,
                "desciptions": "iPhone 7",
                "quantity": 1,
                "price": 4000.00,
                "subtotal": 4000.00,
                "commodity_code": "1002",
                "rate": 2.00,
                "surcharge": 80.00
            }
        ]
    }
}
```
