> For the complete documentation index, see [llms.txt](https://docs.ghosty.cash/ghostycash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ghosty.cash/ghostycash/api-reference/create.md).

# Create

This API is for creating Ghosty Order

## Create Ghosty order

<mark style="color:green;">`POST`</mark> `/create`

Creates a new ghosty order.

**Headers**

| Name                                                   | Value              |
| ------------------------------------------------------ | ------------------ |
| Content-Type                                           | `application/json` |
| x-ghostycash-api-key<mark style="color:red;">\*</mark> | `API_KEY`          |

**Body**

| Name                                                  | Type    | Description                                |
| ----------------------------------------------------- | ------- | ------------------------------------------ |
| currency`_from`<mark style="color:red;">\*</mark>     | string  | Currency symbol to swap from               |
| currency`_to`                                         | string  | Currency symbol to swap to with fixed rate |
| currency`_to`<mark style="color:red;">\*</mark>       | string  | Currency symbol to swap to                 |
| `amount_from`<mark style="color:red;">\*</mark>       | number  | Amount to swap from                        |
| `address_to`<mark style="color:red;">\*</mark>        | string  | Recipient address                          |
| `receiver_memo_tag`<mark style="color:red;">\*</mark> | string  | Recipient address tag                      |
| `is_anonym`                                           | boolean | Flag to make the transaction anonymous     |
| `fixed`                                               | boolean | True for fixed rate, False for float rate  |

**Response**

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

```json
{
  "message": "success",
  "order_info": "BDfN7vF9TMKi"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "message": "error",
  "code": 400
}
```

{% endtab %}
{% endtabs %}

**Header: "x-ghostycash-api-key"**

* The "x-ghostycash-api-key" header plays a critical role in the authentication and authorization process for API requests to the GhostyCash platform. This custom header is required for all API calls to ensure secure access to the platform's features and data. The API key, represented by this header, is a unique identifier assigned to users or applications, enabling the platform to validate requests, track usage, and enforce access controls. Users must include their specific API key in the header of each request to authenticate themselves and gain the necessary permissions to perform operations within the GhostyCash ecosystem. Failure to provide a valid API key will result in requests being denied, ensuring that sensitive information and functionalities remain protected against unauthorized access.
