> For the complete documentation index, see [llms.txt](https://docs.gestao.plus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gestao.plus/api/ecommerce/api_integration.md).

# Integração API

## URL Checkout

<mark style="color:green;">`POST`</mark> `https://tools.gestao.plus/goto-checkout.php`

Este endpoint permite que você gere uma URL para acessar o checkout com os devidos parâmetros.

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Accept<mark style="color:red;">\*</mark>       | string | application/json |
| Content-Type<mark style="color:red;">\*</mark> | string | application/json |

#### Request Body

| Name                                  | Type   | Description                                                                                                                                                                        |
| ------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| user                                  | string | Dados do usuário para o preenchimento automático do formulário                                                                                                                     |
| sku<mark style="color:red;">\*</mark> | string | SKU do produto dessa venda                                                                                                                                                         |
| callBackUrl                           | string | URL de volta para o usuário retornar para o carrinho, se for necessário                                                                                                            |
| callBackResponseUrl                   | string | URL de volta para o usuário retornar para resumo de compra após a confirmação do pagamento, se for necessário (a url deve esperar a concatenação do parâmetro de código do pedido) |
| p                                     | string | ID gerado dentro do sistema (consulte o administrador)                                                                                                                             |
| url<mark style="color:red;">\*</mark> | string | URL do ERP Gestão Online                                                                                                                                                           |

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

```
{
    "status": "success",
    "redirectTo":
    "https://dev.gestao.plus/loja/checkout?p=i1-contabilidade-indicador&loc
    k=1&item=eyJyYW5kIjoxLCJza3UiOjEwfQ%3D%3D&payload=eyJkb2
    N1bWVudCI6IjExMTExMTExMTExIiwibmFtZSI6Ik5vbWUgRXhlbXBsb
    yIsImVtYWlsIjoidGVzdGVAdGVzdGUuY29tIiwiY2VsbHBob25lIjoiNjI5O
    TU1NTU1NTUiLCJ6aXBDb2RlIjoiNzQyMzAxMzAiLCJhZGRyZXNzIjoi
    QXB0IDEyMyIsIm51bWJlciI6IjE1MjkiLCJuZWlnaGJvcmhvb2QiOiJTZX
    RvciBCdWVubyIsImFkZHJlc3NEZXRhaWwiOiJBdiBYcHRvIiwiY2l0eSI
    6IkdvaWFuaWEiLCJzdGF0ZSI6IkdPIn0%3D&callBackUrl=https%3A%
    2F%2Fseusiteintegrado.com.br%2Fexemplo%2F123"
}
```

{% endtab %}

{% tab title="400 " %}

```
{
    "status": "error",
    "message": "An error occurred, the 'url' parameter is invalid"
}
```

{% endtab %}
{% endtabs %}

Exemplo de request:

```
curl --location --request POST 'https://tools.gestao.plus/goto-checkout.php' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://parceirosoluti.com.br",
    "p": "i6473-gestao-online",
    "callBackUrl": "https://gestão.online?q=callbackToProductListSample",
    "callBackResponseUrl": "https://gestão.online?q=callbackToOrderDetailUsingCode&code=",
    "sku": 9,
    "user": {
        "document": "11111111111",
        "name": "Nome Exemplo",
        "email": "teste@teste.com",
        "cellphone": "62995555555",
        "zipCode": "74230130",
        "address": "Apt 123",
        "number": "1529",
        "neighborhood": "Setor Bueno",
        "addressDetail": "Av Xpto",
        "city": "Goiania",
        "state": "GO"
    }
}'
```

{% hint style="info" %}
Para consultar as informações utilize o código retornado na url indicada em "callBackResponseUrl", [utilize o endpoint de detalhes do pedido/pagamento](https://docs.gestao.plus/api/public/order_details_public) para obter os detalhes.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.gestao.plus/api/ecommerce/api_integration.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.
