# Checkout Usuário (Boleto)

## Checkout do usuário no boleto

<mark style="color:green;">`POST`</mark> `https://api.gestao.plus/order`

Com esta rota você pode gerar pedidos de um determinado produto.

#### Headers

| Name                                            | Type   | Description                             |
| ----------------------------------------------- | ------ | --------------------------------------- |
| Origin<mark style="color:red;">\*</mark>        | string | URL de origem da requisição             |
| Authorization<mark style="color:red;">\*</mark> | string | Access Token no modelo "Bearer {token}" |

#### Request Body

| Name                                              | Type   | Description                                                         |
| ------------------------------------------------- | ------ | ------------------------------------------------------------------- |
| items<mark style="color:red;">\*</mark>           | string | Um array contendo objetos com o id do produto e quantidade comprada |
| type<mark style="color:red;">\*</mark>            | string | Tipo da movimentação, geralmente "V" de venda                       |
| negotiationType<mark style="color:red;">\*</mark> | string | Tipo de negociação utilizado para a compra                          |
| uri<mark style="color:red;">\*</mark>             | string | Identificador do cliente                                            |

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

```
{
   "code":"",
   "data": {
      "id":954,
      "orderCode": "0000954179" // NÚMERO DO PEDIDO
   },
   "publicToken":"TOKEN PÚBLICO",
   "type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
   "title":"ok",
   "status":200,
   "detail":"Order created"
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "Bad Request",
    "status": 400,
    "detail": "Invalid negotiation type for this scope"
}
```

{% endtab %}
{% endtabs %}

### Exemplo do corpo da requisição:

```
{
   "uri": "",
   "type": "V",
   "negotiationType":20,
   "items":[
      {
         "id":10,
         "sku":"370",
         "p":"",
         "quantity":1,
         "price":100,
         "description":"KIT PJ A3 - TOKEN - 2 ANOS",
      }
   ],
   "userData":{
      "document":"231.231.231-23",
      "name":"João Diniz",
      "email":"example@example.com",
      "cellphone":"(62) 00000-0000",
      "zipCode":"74000-000",
      "address":"My new address",
      "number":0,
      "neighborhood":"Residencial Alphaville Flamboyant",
      "addressDetail":"...",
      "city":"Goiânia",
      "state":"GO",
      "password":null,
      "phone":"",
      "username":"8748923323"
   }
}
```
