Skip to content

Start connecting a channel account

POST
/api/v1/workspaces/{workspaceId}/channel-connections/authorizations
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.

workspaceId
required
string
Media typeapplication/json
object
channel
required
string
Allowed values: shopify ebay google_merchant etsy amazon walmart
accountHandle
required

The account to connect. For Shopify, the store’s myshopify.com domain or handle. For eBay, the marketplace id, such as EBAY_US.

string
<= 255 characters

Example

demo-store.myshopify.com
Media typeapplication/json
object
authorizationUrl
required

Send the merchant here to approve the app on the channel

string
accountHandle
required

The account handle, normalized: a myshopify.com domain, or an eBay marketplace id

string
externalAccountId
required

The same value as accountHandle. Use accountHandle instead.

string

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.

Media typeapplication/json
object
statusCode
required
number
error
required
string
code
required
string
Allowed values: plan_limit_reached plan_feature_not_included
message
required
string
feature
required
string
Allowed values: active_listings channel_connections workspaces members api_keys ai_credits autonomous_agents bring_your_own_key
plan
required

The code of the organization’s plan

string
limit
required

Null is unlimited

number
nullable
usage
required
number
requested
required

How many more the request asked for

number

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"
}