Creating a channel is handing Fenicia access to a marketplace account. That is the only moment the access travels: after it, you refer to the channel by its channelId.
The channel to create. Note: the authorization data goes INSIDE this object, not at the root of the body.
channel.typeenumrequired
Which marketplace this is. Accepted values: shopify, claro-shop, mercado-libre, woo-commerce, walmart, coppel, t1-comercios, sears, sanborns, tienda-nube. REJECTS tiktok-shop with 400: it completes setup through its own OAuth callback. amazon and shein do appear in typesSupported but their setup is NOT built, see below.
channel.namestring
Display name of the channel. Required except for shein, mercado-libre, amazon and tienda-nube, which derive it from the profile returned by the marketplace, and for shopify when you send intentNonce. Missing where required: 400 bad-request/missing-param.
channel.credentialsobjectestructura libre
The already-resolved access to the account: a token, an API key, or a username/password pair, depending on the type. NOT an authorization_code — a code is only redeemable with the client_id and client_secret it was requested with, and those are yours. It is an open bag (Mixed in the schema) because its shape changes with each type: see the example tabs and the table below.
channel.intentNoncestring
Shopify install-intent nonce, when setup comes from the embedded app. Only for type shopify; if you send it, the channel is finalized from the intent and name is not required.
configobject
Connection configuration. This is where the fulfillment location goes.
config.locationIdstring
ID of the Fenicia location where this channel's orders are fulfilled. Required for 10 of the 10 creatable types — see below.
A channel that imports orders needs to know where they are fulfilled from. The eight types you connect from here require it, and without it setup fails with 400 bad-request/location-required:
If the channel was connected from the portal — mercado-libre and tienda-nube — the location is set there. And from this API you can change it whenever you want with PUT /channels/{channelId}/settings.
Four names for the same location
config accepts locationId, ordersLocation, orderBranch and inventoryLocation, and takes the first non-empty one in that order. The last three are historical aliases kept for compatibility; Fenicia normalizes them all to the same canonical value before persisting. Use locationId — the others exist so old integrations do not break, not as design options.
Each type expects a different body, and what decides which one is who ran the authorization flow. That is the fork, and it is worth having clear before you write a line:
Fenicia's app → OAuth → returns to app.fenicia.io → Fenicia exchanges → channelYour app → YOUR OAuth → YOU exchange → you give us the token → channel
Shopify has a second route, and it is the only type that does: the install intent. There the merchant installs Fenicia's application, the embedded app attaches the token, and you finalize the channel with a nonce. You never see a credential.
These two cannot be connected from this API with your own application. Their setup accepts an authorization_code only, and per the explanation above yours would not be redeemable.
While that remains the case, the connection is made from the Fenicia portal: the merchant authorizes, the flow returns to app.fenicia.io, and Fenicia redeems the code with its own application. The channel gets created and from then on you operate it through this API as usual — sync, publish, query: everything works the same.
amazon and shein are real Fenicia marketplaces — their read routes work — but the setup token exchange is not built yet.
`typesSupported` lists them, and they still fail
This is the trap, and there is no way to deduce it from the API: typesSupported returns twelve values, amazon and shein included, but only ten can be created.
Send one of those two without its parameters and you get a 400 asking for them — bad-request/missing-param for Amazon, bad-request/invalid-auth for Shein. Send them complete and the call fails with a server error: there is nothing behind it to run.
Do not retry, and do not build a setup flow against them. Treat them as non-creatable until this page says otherwise.
When the refresh token dies, the channel stops operating and health.refreshTokenInvalid flips to true. Reconnecting exchanges a fresh authorization code and reactivates the channel, preserving its configuration: location, import settings and product bindings all stay.
Renews a MercadoLibre channel's credentials with a fresh authorization code
ID of the channel to reconnect. It goes in the body, not the path — this route has no path parameter.
authorization_codestringrequired
Fresh OAuth authorization code. In snake_case, unlike channel.code used at setup.
MercadoLibre only — and this is how you reconnect everything else
Despite the generic name, POST /channels/reconnect routes to MercadoLibre's reconnection. There is no generic reconnect route.
For the other nine creatable types, reconnecting means running setup again: POST /channels with fresh credentials, the same body you used the first time. It does not duplicate the channel — on save, Fenicia upserts by handle (the one derived from the store domain or account), so the existing channel keeps its renewed credentials, its settings, its location and its product bindings.
On Shopify that means repeating the five steps of the install intent, with a fresh nonce.
The channel is checked before MercadoLibre is touched: if it does not exist, or is of another type, you find out without burning the authorization code — which is single-use.
Code
HTTP
What happened
not-found/channel
404
There is no channel with that channelId in your account.
bad-request/channel-type
400
The channel exists but is not a MercadoLibre one. The message names the actual type.
bad-request/missing-param
400
channelId or authorization_code is missing.
Exchange errors start with oauth/ and return 400. Any other failure returns 500.
Code
What happened
oauth/invalid-grant
The code was already used or expired. Valid for 10 minutes, single use.
oauth/invalid-client
The application credentials are invalid. The merchant cannot fix this.
oauth/invalid-scope
The requested scope is not valid.
oauth/invalid-request
The OAuth request is malformed.
oauth/token-exchange-failed
Generic exchange failure.
If the MercadoLibre account changed
Fenicia compares the new token's user_id against the one the channel had. If they differ, the reconnection proceeds anyway and only a warning is written to the log. That is: you can reconnect a channel pointing it at a different account, and the API will not stop you. If that matters in your flow, compare it yourself before reconnecting.
Connecting Shopify takes five steps and three actors, and only two of the steps are yours. The install intent is the token that ties the two halves of the flow together.
POST /channels/shopify/install-intents → you get a nonce
You, with your API key
2
The merchant installs the Fenicia app on their store and authorizes it
The merchant, on Shopify
3
The Shopify token is attached to the intent, which becomes authenticated
Fenicia's embedded app, with its own secret
4
The merchant returns to your returnUrl
Shopify / the embedded app
5
POST /channels with channel.intentNonce → the channel is created
You, with your API key
Step 5 fails if step 3 has not finished — and the error does not distinguish it
POST /channels with an intentNonce requires the intent to already be authenticated, that is, for the embedded app to have attached the token. If you call earlier, you get:
422 unprocessable-entity/intent-not-found
That single code means four different things: the nonce does not exist, it was already consumed, it expired, or it is not authenticated yet. The response does not separate them.
Practical consequence: do not fire step 5 on a timer. Fire it when the merchant lands on your returnUrl, which is the signal that step 3 finished. And if you still get the 422, retrying a moment later is reasonable once — beyond that, assume the intent is dead and start again from step 1.
Registers a single-use install intent before redirecting to Shopify
{ "code": "bad-request/invalid-shop", "message": "shop must be a valid Shopify subdomain (got \"mi tienda\")"}
401The API key did not resolve to a user
{ "code": "bad-request/missing-user", "message": "No user identity found in the authorizer context"}
400The return URL is not on the allowlist
{ "code": "bad-request/return-url-not-allowed", "message": "returnUrl host not in allowlist"}
Returns the nonce and its expiresAt. The nonce is consumed when the channel is created and cannot be reused; past that time, POST /channels returns 422 unprocessable-entity/intent-not-found — the same code as if it had never existed. Register the intent as close to the redirect as you can.
Shopify store domain. It is normalized; if it is not a valid myshopify.com subdomain, it returns 400 bad-request/invalid-shop.
returnUrlstringrequired
Where to come back to when the install finishes. It is validated against an allowlist; see below which code each case returns.
The two `returnUrl` codes do NOT split the way you would expect
bad-request/invalid-return-url covers only the field being empty or not a string. Nothing else.
bad-request/return-url-not-allowed covers everything else, including a malformed URL. Its message is dynamic and says exactly what failed.
That is: "not-a-url" returns return-url-not-allowed, not invalid-return-url — the code name suggests the opposite.
The second one's possible messages: returnUrl is required · returnUrl must be an absolute URL · returnUrl protocol must be http or https · returnUrl must use https in production · returnUrl host not in allowlist · fenicia.io returnUrl must use https · localhost returnUrl must use port 5179.