# Orders

## Create order

<mark style="color:orange;">**POST**</mark>  `{{BASE_URL}}`**`/api/order`**

{% hint style="info" %}
Create order using cryptocurrency and network
{% endhint %}

**Parameters**

**Header**

Authorization                     `{{API_KEY}}`

Body

> `currency` should be **PEN** or **USD** depend on the original currency of the item.
>
> `metadata` is a free json data where su can send an important info to identify the origin order.

```javascript
{
  "amount": 20,
  "currency": "PEN",
  "transaction": {
    "customer": {
      "name": "John Doe",
      "email": "sample@gmail.com"
    },
    "networkId": 1,
    "cryptoId": 2
  },
  "metadata": {
    "description": "Curso de criptomonedas",
    "order": "order-001",
    "hash": "curso-001"
  }
}
```

**Responses**

<details>

<summary>🟢 <strong>200</strong></summary>

```javascript
{
  "orderCode": "15344389b0034ece85f2434d589dd76c",
  "network": "BSC",
  "crypto": "BUSD",
  "amount": 0.003,
  "address": "0x3073370FB1E57a3028B83d8c47B846cf227f0E7c",
  "imageAddress": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJQAAACUCAYAAAB1PADUAAAAAklEQVR4AewaftIAAAStSURBVO3BQW4cSRAEQY/C/P/LvjzmqYBGJ0lJG2bxC1VLDlWLDlWLDlWLDlWLDlWLDlWLDlWLDlWLDlWLDlWLDlWLDlWLDlWLDlWLDlWLPryUhJ+k8kYSblSeSMKkMiXhCZUpCT9J5Y1D1aJD1aJD1aIPy1Q2JeGNJEwqN0nYpHKThCdUNiVh06Fq0aFq0aFq0YdvloQnVJ5IwiaVJ5Jwk4QblTeS8ITKdzpULTpULTpULfrwP5OEJ1SmJNwk4UZlSsKk8jc7VC06VC06VC368D+j8kQSJpWbJEwqUxImlX/JoWrRoWrRoWrRh2+m8pNUpiS8oTIlYVKZVKYkTCqbVP4kh6pFh6pFh6pFH5Yl4W+ShEllSsKkMiVhUnkiCZPKTRL+ZIeqRYeqRYeqRfELf7EkTCp/kiRMKv+yQ9WiQ9WiQ9WiDy8lYVKZkrBJZVKZkvCGypSEN1SmJNyoTEnYpPKdDlWLDlWLDlWLPnwzlS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Fh2qFh2qFh2qFh2qFh2qFh2qFh2qFh2qFh2qFv0HblYuFHxVcRYAAAAASUVORK5CYII=",
  "expirationDate": "2022-08-02T05:46:52.319Z"
}
```

</details>

<details>

<summary>🟠 401</summary>

```javascript
{
  "statusCode": 401,
  "message": "Unauthorized"
}
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://coini.gitbook.io/api-docs/reference/api-reference/orders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
