API reference
Cart
Generated HTTP reference for the 2 operations the published OpenAPI document describes under cart.
4 min read
Cart
This page is generated from the published OpenAPI document. It is complete with respect to that document and says nothing about surfaces the document does not describe yet. See what is generated here for what that means.
Base URL: https://api.codespar.dev
Every operation below requires a Bearer token. See Authentication.
POST /v1/cart/ifood/connect/start
Open an iFood login for a shopper (connect-once, and iFood cannot be bought from)
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
502 | object | The hosted browser worker refused or failed, or the pending session could not be recorded. Not terminal: retry mints a new context and session. |
503 | object | No browser worker is configured for this deployment, so no connect can be started at all. Terminal for the caller: retrying cannot fix it, and it is an operator's configuration to supply. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
checkout_supported | false | yes | Always present and always false on this route. Its absence on the Mercado Livre response is the signal that the merchant CAN be bought from; do not read a missing field as false. |
context_id | string | yes | The persistent browser context the login is about to be written into, fresh for this connect. Bind it to nothing yourself: the server remembers which context it issued for this session and later checkouts resolve it from the stored mapping. |
live_view_url | string | yes | The interactive URL a HUMAN opens to log into their own marketplace account. MAY COME BACK AS AN EMPTY STRING, and the call still answers 200: the worker builds it as `debuggerFullscreenUrl |
merchant | "ifood" | yes | — |
note | string | yes | A fixed disclosure sentence, held as a constant in cart/connect-core.ts and repeated verbatim by the finish call: iFood checkout is not supported yet, the login is stored for a future capability, and no purchase can be made on iFood today in live or in test. |
session_id | string | yes | The live browser session. It is also the handle for the finish call, and the server keeps a single-use pending row for it. Nobody else can present it: a finish is refused unless the row was started by the same org and project. |
Example response
{
"merchant": "ifood",
"context_id": "context_0000000000000000",
"session_id": "ses_0000000000000000",
"live_view_url": "https://example.com/hook",
"checkout_supported": false,
"note": "string"
}Example request
curl -X POST https://api.codespar.dev/v1/cart/ifood/connect/start \
-H "Authorization: Bearer $CODESPAR_API_KEY"POST /v1/cart/meli/connect/start
Open a Mercado Livre login for a shopper (connect-once, step 1 of 2)
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
502 | object | The hosted browser worker refused or failed, or the pending session could not be recorded. Not terminal: retry mints a new context and session. |
503 | object | No browser worker is configured for this deployment, so no connect can be started at all. Terminal for the caller: retrying cannot fix it, and it is an operator's configuration to supply. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
context_id | string | yes | The persistent browser context the login is about to be written into, fresh for this connect. Bind it to nothing yourself: the server remembers which context it issued for this session and later checkouts resolve it from the stored mapping. |
live_view_url | string | yes | The interactive URL a HUMAN opens to log into their own marketplace account. MAY COME BACK AS AN EMPTY STRING, and the call still answers 200: the worker builds it as `debuggerFullscreenUrl |
merchant | "meli" | yes | — |
session_id | string | yes | The live browser session. It is also the handle for the finish call, and the server keeps a single-use pending row for it. Nobody else can present it: a finish is refused unless the row was started by the same org and project. |
Example response
{
"merchant": "meli",
"context_id": "context_0000000000000000",
"session_id": "ses_0000000000000000",
"live_view_url": "https://example.com/hook"
}Example request
curl -X POST https://api.codespar.dev/v1/cart/meli/connect/start \
-H "Authorization: Bearer $CODESPAR_API_KEY"