ShopfloDevelopers

API reference

Commerce Partner API

Search products across your brands and hand shoppers to a ready Shopflo checkout.

Available by application Shopping agents, chat and WhatsApp concierges, gifting desks

The Commerce Partner API lets a service you run search the catalogs of the brands Shopflo has enabled for you, then pass the shopper to Shopflo checkout with a cart already built.

To run the whole purchase inside your own chat, use the Commerce MCP instead. Both use the same client id and secret.

Base URL: https://api.shopflo.co

Authentication: Partner token

Exchange your client credentials for a short-lived bearer token, then send it on every call.

Read how this authentication works

Endpoints

Authentication

POST

Get a token

/heimdall/api/v1/commerce-partner/token

Exchange your client id and client secret for a bearer token. expires_in is in seconds.

Authentication: None. Your credentials go in the body.

Request body

  • client_idstringRequired

    Starts with sfcp_.

  • client_secretstringRequired

    Shown once when Shopflo issues your keys.

Response fields in data

  • access_tokenstringRequired

    Send it as Authorization: Bearer <access_token>.

  • token_typestringRequired

    Always Bearer.

  • expires_inintegerRequired

    Lifetime in seconds. 3600 by default.

Errors

StatusCodeWhen
400GE_001client_id or client_secret is missing or blank. The message names the field, for example client_id is required.
401AUTH_018The client id is unknown, the secret is wrong, or your access is suspended, revoked or past its end date. The response does not say which.
429TOO_MANY_REQUESTSMore than 10 requests a minute from one IP address. An IP address with more than 30 attempts is blocked for 15 minutes.
POST/heimdall/api/v1/commerce-partner/token
curl -sS -X POST "https://api.shopflo.co/heimdall/api/v1/commerce-partner/token" \
  -H "Content-Type: application/json" \
  -d '{
  "client_id": "sfcp_your_client_id",
  "client_secret": "your_client_secret"
}'
Response200 OK
{
  "success": true,
  "data": {
    "access_token": "eyJhbGciOi...",
    "token_type": "Bearer",
    "expires_in": 3600
  }
}
GET

Get your account

/heimdall/api/v1/commerce-partner/me

Returns your account and the brands Shopflo has enabled for you. Use it to find the merchant_id values you can pass to the other endpoints.

Authentication: Bearer token

Response fields in data

  • client_idstringRequired

    Your client id.

  • namestringRequired

    Your account name.

  • statusstringRequired

    ACTIVE, SUSPENDED or REVOKED. Only ACTIVE accounts can call the API.

  • merchantsarrayRequired

    The brands enabled for you. Empty until Shopflo enables one.

    • merchant_idstringRequired

      Pass this to product search filters and to the checkout endpoint.

    • namestringOptional

      Brand name. Null for a brand with no profile yet.

    • shop_domainstringOptional

      The brand's store domain. Null for a brand with no profile yet.

Calls to this endpoint count toward your per-minute limit.

Errors

StatusCodeWhen
401GE_003The token is missing, invalid or expired, or your account is not active. data holds the reason.
429AUTH_001You went over your per-minute limit.
GET/heimdall/api/v1/commerce-partner/me
curl -sS "https://api.shopflo.co/heimdall/api/v1/commerce-partner/me" \
  -H "Authorization: Bearer your_access_token"
Response200 OK
{
  "success": true,
  "data": {
    "client_id": "sfcp_your_client_id",
    "name": "Example Concierge Ltd",
    "status": "ACTIVE",
    "merchants": [
      {
        "merchant_id": "your_merchant_id",
        "name": "Example Brand",
        "shop_domain": "example-brand.myshopify.com"
      }
    ]
  }
}

Products

Checkout

POST

Create a checkout link

/kratos/api/v1/partner/merchant/{merchant_id}/token

Creates a checkout for one brand with the items you send, and returns a link to Shopflo checkout. Send the shopper to checkout_url. They finish the order there, and the order is attributed to your account.

Authentication: Bearer token

Path parameters

  • merchant_idstringRequired

    The brand. It must be on your /me list.

Request body

  • itemsarrayRequired

    At least one item. One checkout holds items from one brand.

    • variant_idstringRequired

      A variant_id from product search for the same brand.

    • quantityintegerRequired

      1 or more.

Response fields in data

  • token_idstringRequired

    Identifies the checkout session.

  • checkout_urlstringRequired

    Open it for the shopper in a browser or in-app web view, or send it in a message. Do not build the link yourself.

This endpoint does not log the shopper in and does not take payment. To run login and payment inside your own chat, use the Commerce MCP.

Errors

StatusCodeWhen
400GE_001items is empty, an item has no variant_id, or a quantity is missing or below 1. The message names the problem.
401GE_003The token is missing, invalid or expired, or your account is not active.
403GE_007The brand in the path is not enabled for you. The message is Merchant not available to this partner.
429AUTH_001You went over your per-minute limit.
POST/kratos/api/v1/partner/merchant/{merchant_id}/token
curl -sS -X POST "https://api.shopflo.co/kratos/api/v1/partner/merchant/your_merchant_id/token" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "items": [
    {
      "variant_id": "var_456",
      "quantity": 1
    }
  ]
}'
Response200 OK
{
  "success": true,
  "data": {
    "token_id": "tok_abc123",
    "checkout_url": "https://checkout.shopflo.co/stable/?tokenId=tok_abc123"
  }
}