Start connecting a channel account
const url = 'https://api.crossmart.io/api/v1/workspaces/example/channel-connections/authorizations';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"channel":"shopify","accountHandle":"demo-store.myshopify.com"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.crossmart.io/api/v1/workspaces/example/channel-connections/authorizations \ --header 'Content-Type: application/json' \ --data '{ "channel": "shopify", "accountHandle": "demo-store.myshopify.com" }'Returns the URL to send the merchant to. After they approve the app, the channel redirects to the API, which stores the connection and sends them back to the web app’s Channels page with the parameters of ChannelConnectRedirectDto. Needs a signed-in user, and the browser must store the cookie this response sets (send it with credentials): the callback only accepts the same browser and session that started the connection.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The account to connect. For Shopify, the store’s myshopify.com domain or handle. For eBay, the marketplace id, such as EBAY_US.
Example
demo-store.myshopify.comResponses
Section titled “Responses”object
Send the merchant here to approve the app on the channel
The account handle, normalized: a myshopify.com domain, or an eBay marketplace id
The same value as accountHandle. Use accountHandle instead.
Example
{ "accountHandle": "demo-store.myshopify.com", "externalAccountId": "demo-store.myshopify.com"}The organization’s plan does not allow this (ENTITLEMENTS_ENFORCED is on). code and feature say why; upgrading the plan resolves it.
object
The code of the organization’s plan
Null is unlimited
How many more the request asked for
Example
{ "statusCode": 402, "error": "Payment Required", "code": "plan_limit_reached", "message": "The Free plan includes 2 connected channels, and 2 are in use. Upgrade the plan to add more.", "feature": "active_listings", "plan": "free"}