# What responses does the API return?

<table border="1" id="bkmrk-code-scenario-200-su" style="border-collapse: collapse; width: 100%; height: 29.7969px;"><colgroup><col style="width: 50.0596%;"></col><col style="width: 50.0596%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Code**  
</td><td style="height: 29.7969px;">**Scenario**  
</td></tr><tr><td>`200 Success`</td><td>The request was processed successfully.</td></tr><tr><td>`201 Created`  
</td><td>One (or multiple) resources were created.</td></tr><tr><td>`400 Bad Request`   
</td><td>Cannot process request due to client error.</td></tr><tr><td>`401 Unauthorised`  
</td><td>Invalid bearer token provided.</td></tr><tr><td>`404 Not Found`  
</td><td>Endpoint not found.</td></tr><tr><td>`422 Unprocessable Content`  
</td><td>Payload failed validation.</td></tr><tr><td>`500 Internal Server Error`  
</td><td>  
</td></tr></tbody></table>

#### Examples

##### `200 Success`

```
GET /api/orders/{id}
```

```json
{
    "reference": "ABC123",
    "email": "acme@aerocommerce.com",
    "subtotal": {
        "amount": 84166.67,
        "tax": 16833.33
    },
    "shipping": {
        "amount": 83.33,
        "tax": 16.67
    },
    "discount": {
        "amount": 8416.67,
        "tax": 1683.33
    },
    "surcharge": {
        "amount": 0,
        "tax": 0
    },
    "ordered_at": "2023-09-01T09:29:41.000000Z",
    "deliver_on": null,
    "currency": "GBP",
    "status": {
        "id": 3,
        "name": "Successful",
        "state": "successful"
    },
    "customer": {
        "id": 1,
        "name": "Acme",
        "email": "acme@aerocommerce.com"
    },
    "shipping_method": {
        "id": 1,
        "name": "Standard"
    },
    "billing_address": {
        "id": 1,
        "first_name": "Aero",
        "last_name": "Commerce",
        "company": "Aero Commerce",
        "mobile": null,
        "phone": null,
        "line_1": "28-32 Albert Rd",
        "line_2": null,
        "city": "Middlesbrough",
        "zone": null,
        "postcode": "TS1 1QD",
        "reference": null,
        "country": "GB",
        "eori_number": null
    },
    "shipping_address": {
        "id": 1,
        "first_name": "Aero",
        "last_name": "Commerce",
        "company": "Aero Commerce",
        "mobile": null,
        "phone": null,
        "line_1": "28-32 Albert Rd",
        "line_2": null,
        "city": "Middlesbrough",
        "zone": null,
        "postcode": "TS1 1QD",
        "reference": null,
        "country": "GB",
        "eori_number": null
    },
    "items": [
        {
            "id": 1,
            "name": "Test",
            "sku": "TEST-S",
            "product_id": 4,
            "variant_id": 14,
            "shippable": true,
            "quantity": 2,
            "price": {
                "amount": 42083.33,
                "tax": 8416.67
            },
            "discount": {
                "amount": 8416.67,
                "tax": 1683.33
            },
            "full_price": {
                "amount": 42083.33,
                "tax": 8416.67
            },
            "weight": 0,
            "volume": 0
        }
    ]
}
```

##### `201 Created`

```
POS /api/orders
```

```json
{
    "order": {
        "id": 15
    }
}
```

##### `400 Bad Request`

```
GET /api/orders/{id}
```

```json
{
    "message": "Missing order ID"
}
```

##### `401 Unauthorised`

```
GET /api/orders/{id}
```

```json
{
    "message": "Unauthorized: Bearer token missing."
}
```

##### `404 Not Found`

```
GET /api/orders/{id}
```

```json
{
    "message": "The requested order with ID {id} could not be found."
}
```

##### `422 Unprocessable Content`

```
POST /api/orders
```

```json
{
    "message": "The given data was invalid.",
    "errors": {
        "currency": ["The currency field is required."]
    }
}
```

##### `500 Internal Server Error`

```json
{
    "message": "Exception message..."
}
```