> ## Documentation Index
> Fetch the complete documentation index at: https://help.emotive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up an API for your Custom Site

> Development instructions for integrating Emotive and custom sites.

This article provides instructions on how to prepare your custom site before your installation with Emotive. These instructions are for your development team.

<Note>
  Please attempt this configuration at least 2 days in advance of your scheduled installation. These configurations must be completed in order to successfully install Emotive.

  Please make sure your developer is on the installation call with Emotive. They will need to grant us access to certain permissions. If you experience any issues, please contact us at [installs@emotive.io](mailto:installs@emotive.io) for further assistance.
</Note>

## Authentication

Emotive respects the privacy and sensitivity of any content an organization working with us, and towards that we take great pains to ensure the security of your data. We use encoded token authorization over https to ensure security and maintain simplicity.

To access the Emotive Open API, a client must add an "Authorization" HTTPS header to every API request and that header's value must contain a valid API token. An API token is unique to each user in Emotive, and the Emotive team will be providing the token to you as a client. Once your token is generated, you can add it to each request with the following syntax:

Authorization: Token \<token>

The Authorization Header must be included in every request.

Example (Authentication)

Authorization: Token dXNlck5hbdfdr4WVWfssFg346vbcv==

## Content Types for Data Creation

### Resource Creation

For any request that contains JSON in the request body (POST or PUT operations), we support a content type of "application/json". You should then expect any content in the response body to also be returned as JSON. For example the HTTP request headers would look like:

Accept: application/json

Content-Type: application/json; charset=UTF-8

### Http Response Code Conventions

* **2xx response codes:** Generally returned when the request resulted in a successful response. The response body usually contains the expected resource that was requested or was created as a result of the request.
* **4xx response codes:** Generally a client-generated error, which means the client made a request that is either malformed, invalid or not allowed for the given resource at that time. The response body will contain an "error" attribute explaining what happened and how to correct, if applicable.

## Status Codes

### Success Codes

| Code | Description                                           |
| ---- | ----------------------------------------------------- |
| 200  | OK                                                    |
| 201  | Created                                               |
| 292  | Accepted (Request accepted, and queued for execution) |

### Client Error Codes

| Code | Description                                    |
| ---- | ---------------------------------------------- |
| 400  | Bad Request (missing or invalid data provided) |
| 401  | Unauthorized/Authentication Failure            |
| 403  | Forbidden                                      |
| 404  | Resource not found                             |
| 405  | Method not allowed                             |
| 409  | Conflict                                       |
| 412  | Precondition failed                            |
| 413  | Request entity too large                       |

### Server Error Codes

| Code | Description           |
| ---- | --------------------- |
| 500  | Internal server error |
| 501  | Not implemented       |
| 503  | Service unavailable   |

### Orders API

[https://api.emotiveapp.co/ecommerce/v1/orders/](https://api.emotiveapp.co/ecommerce/v1/orders/)

## Request Parameters

<img src="https://mintcdn.com/emotiv/GelXjFfUGXsTSetw/images/integrations/custom-site-order-parameters.png?fit=max&auto=format&n=GelXjFfUGXsTSetw&q=85&s=5a79317f62f63c1bb8bb51b0e099b321" alt="request parameters" height="200" className="integrations" data-path="images/integrations/custom-site-order-parameters.png" />

<img src="https://mintcdn.com/emotiv/GelXjFfUGXsTSetw/images/integrations/custom-site-parameters-2.png?fit=max&auto=format&n=GelXjFfUGXsTSetw&q=85&s=3bb8bf2c681078e6c80b70b7d1b4c20f" alt="request parameters" height="200" className="integrations" data-path="images/integrations/custom-site-parameters-2.png" />

<img src="https://mintcdn.com/emotiv/GelXjFfUGXsTSetw/images/integrations/custom-site-parameters-3.png?fit=max&auto=format&n=GelXjFfUGXsTSetw&q=85&s=543b174eb48aef94f0071189e9975a5a" alt="request parameters" height="200" className="integrations" data-path="images/integrations/custom-site-parameters-3.png" />

### Sample Order Request

<img src="https://mintcdn.com/emotiv/2g6clCj3HipLv0dP/images/integrations/order-sample-request.png?fit=max&auto=format&n=2g6clCj3HipLv0dP&q=85&s=8044ab1dbcd37d10c5bd69b1a2dc98e1" alt="request sample" height="200" className="integrations" data-path="images/integrations/order-sample-request.png" />

## Response Parameters

<img src="https://mintcdn.com/emotiv/2g6clCj3HipLv0dP/images/integrations/response-parameters.png?fit=max&auto=format&n=2g6clCj3HipLv0dP&q=85&s=9c564dfcb161eee80f6185d07468265f" alt="response parameters" height="200" className="integrations" data-path="images/integrations/response-parameters.png" />

### Sample Order Response

<img src="https://mintcdn.com/emotiv/2g6clCj3HipLv0dP/images/integrations/sample-response.png?fit=max&auto=format&n=2g6clCj3HipLv0dP&q=85&s=32ac92ab3944018e2f478e1296c3f8e7" alt="sample response" height="200" className="integrations" data-path="images/integrations/sample-response.png" />
