# AI Day to Dusk

## Explanation

This API endpoint allows users to submit new orders within the `service-day-to-dusk` service.

***

<mark style="color:green;">**`POST`**</mark> **`https://api.aihomedesign.com/v1/order`**

***

## Request Body

Ensure that your request body is in the <mark style="color:red;">**RAW-JSON**</mark> format.

The `service-day-to-dusk` service requires `sky style` as a mandatory widget. To attach this widget to the request body, include the widget's ID in `selected_widgets` under `id` and the selected widget item's ID under `item_id`.

```json
{
    "order_id":string,
    "remove_shadow": boolean,
    "selected_widgets" : 
    [
        {
            "id" : string,
            "item_id" : string
        }
    ]
}
```

* **`order_id`**: This should match the `order_id` returned by the Image Upload API.
* **`remove_shadow`**: This toggle determines whether shadows are removed. Set to `true` to remove shadows or `false` to keep them.
* **`selected_widgets`**:
  * **`id`**: Retrieve the `id` for `selected_widgets` based on the `service_name` from the [Get Widgets and Items endpoint](https://doc.aihomedesign.com/api-endpoints/get-widgets-and-items).
  * **`item_id`**: Retrieve the `item_id` for each widget by using its `id` in `items` key from the [Get Widget and Items endpoint](https://doc.aihomedesign.com/api-endpoints/submit-order/broken-reference).

{% hint style="info" %}
**What is "Shadow Removal?"**&#x20;

"Remove Shadow" is a boolean option that, when enabled, eliminates shadows from the image.
{% endhint %}

<figure><img src="https://1694203522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fanw8A7ZZEFkicjKXkFik%2Fuploads%2F7CJuGpInhWtG1go0Ksef%2FD2DSh.png?alt=media&#x26;token=44e9e14f-1e27-4a10-beff-abd5d9ef4df8" alt=""><figcaption><p><em>(Images shown in this documentation may not reflect the latest updates or design changes on the website.)</em></p></figcaption></figure>

{% hint style="info" %}
**What are Widgets and Items?**

**Widgets** are options that enhance your order. Depending on the service, widgets can either be optional or mandatory. For example, a widget might let you choose a design style or color or add specific enhancements to your image.

**Items** are the specific values or choices available for each widget. For instance, if a widget allows you to select a **style**, the widget items could be options like "Modern," "Contemporary," or "Scandinavian."

Use the [**Get Widgets and Items API**](https://doc.aihomedesign.com/api-endpoints/get-widgets-and-items) to see the available widgets and the items for each widget, ensuring your order is perfectly tailored to your needs.
{% endhint %}

<figure><img src="https://1694203522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fanw8A7ZZEFkicjKXkFik%2Fuploads%2FgNyUaubRiArsbdzkqE5w%2Fd2dwi.png?alt=media&#x26;token=d9c2c879-5ee5-4fbe-a510-615d599a955b" alt=""><figcaption><p>Day to Dusk - Sky Style Widget &#x26; Items<br><em>(Images shown in this documentation may not reflect the latest updates or design changes on the website.)</em></p></figcaption></figure>

## Headers

<table><thead><tr><th>Key</th><th>Value</th><th data-hidden>Type</th></tr></thead><tbody><tr><td>x-api-key<mark style="color:red;">*</mark></td><td>{your_api_key_here}</td><td>string</td></tr></tbody></table>

## Response

{% tabs %}
{% tab title="200: OK " %}

```json
{
   "order_id": string,
   "image_id": string,
   "eta": integer
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "error": string
    "key": string
}
```

{% endtab %}
{% endtabs %}
