Skip to content

Update integrations

API v2 is in public beta: endpoints and fields can change before general availability. See the changelog

PATCH/account/integrations

Costs 2 rate-limit points · Rate limits

Update the shop's integrations: sync signups to Klaviyo, Omnisend, Mailchimp or Shopify customers (with the customer tag), the Omnisend and Mailchimp API keys and Mailchimp audience, the Meta Pixel, Shopify Flow triggers and the SplitOrder app switch. API keys are write only; reads return connected flags.

Deep partial: absent fields are unchanged. omnisend.api_key and mailchimp.api_key are never returned by any read; "" or null removes the saved key. A Mailchimp key is checked by fetching the account's audiences and is not saved when Mailchimp refuses it; mailchimp.list_id must be one of those audiences. Klaviyo connects with OAuth from the Integrations page; disconnect with POST /account/integrations/:provider/disconnect. flow_triggers.triggers replaces the stored list. Over MCP or the in-app assistant an API key is refused with code use_key_link and key_url: the merchant enters it in STOQ.

Also searched asconnect omnisendset omnisend api keyconnect mailchimpset mailchimp api keypick mailchimp audiencesync signups to klaviyosync customers to shopifycustomer sync tagturn on meta pixelset meta pixel idenable shopify flow triggersenable splitorderset Postscript keyword

Headers

  • Idempotency-Keystring

    A fresh unique key for every write (a new UUID, say); reuse it only to retry that write. Keys are remembered for 1 hour: the same key and the same request within that hour returns the first result, with Idempotent-Replayed: true, without running again; the same key with a different method, path or body is refused (422 idempotency_key_reused); a retry while the first is still running gets 409 idempotency_key_in_progress. Keys are per store. Server errors and rate limits are not kept, so their retry runs.

Request body

  • klaviyoobject

    Klaviyo settings; sync_customers turns syncing signups to the connected Klaviyo account on or off.

    Show 1 child attributeHide child attributes
    • sync_customersboolean

      Sync visitors who sign up to the connected Klaviyo account.

  • omnisendobject

    Omnisend settings, the API key and whether signups are synced to Omnisend.

    Show 2 child attributesHide child attributes
    • api_keystring

      Omnisend API key. Write only: reads return omnisend.connected. "" removes the key.

    • sync_customersboolean

      Sync visitors who sign up to Omnisend. Needs an Omnisend API key.

  • mailchimpobject

    Mailchimp settings, the API key, the audience signups go to and whether they are synced.

    Show 3 child attributesHide child attributes
    • api_keystring

      Mailchimp API key (ends in the data centre, e.g. "-us21"). Write only: reads return mailchimp.connected. Checked by fetching the account's audiences; a key Mailchimp refuses is not saved. "" removes the key.

    • list_idstring

      Id of the Mailchimp audience signups go to. Must be an audience of the connected account.

      One of
    • sync_customersboolean

      Sync visitors who sign up to Mailchimp. Needs a key and an audience.

  • shopifyobject

    Shopify customer sync settings.

    Show 1 child attributeHide child attributes
    • sync_customersboolean

      Create or update a Shopify customer for each signup, with the tag below.

  • sync_customers_tagstring

    Tag put on synced customer profiles.

  • meta_pixelobject

    Meta Pixel settings, whether conversion events are sent and the pixel they go to.

    Show 2 child attributesHide child attributes
    • enabledboolean

      Send conversion events to the merchant's Meta Pixel.

    • pixel_idstring

      The Meta Pixel id events go to.

  • flow_triggersobject

    Shopify Flow settings, whether STOQ fires Flow triggers and which ones.

    Show 2 child attributesHide child attributes
    • enabledboolean

      Fire Shopify Flow triggers for STOQ events.

    • triggersarray of strings

      Which Shopify Flow triggers fire. REPLACES the stored list.

  • split_order_appobject

    SplitOrder app settings.

    Show 1 child attributeHide child attributes
    • enabledboolean

      Hand preorders to the SplitOrder app.

  • postscriptobject

    Postscript opt-in keyword settings.

    Show 2 child attributesHide child attributes
    • keywordstring

      The Postscript keyword subscribers text to opt in. One of GET /account/integrations/postscript/keywords.

    • keyword_idstring

      Id of that Postscript keyword.

Returns

  • klaviyoobject
    Show 8 child attributesHide child attributes
    • sync_customersboolean
      Example: true
    • oauth_token_expires_atnull
      Example: 2026-11-14T09:30:00Z
    • connectedboolean
      Example: true
    • connection_methodnull
      Example: oauth
    • oauth_token_validboolean
      Example: true
    • oauth_needs_refreshboolean
      Example: false
    • email_setup_verifiedboolean
      Example: true
    • sms_setup_verifiedboolean
      Example: false
  • omnisendobject
    Show 2 child attributesHide child attributes
    • sync_customersboolean
      Example: false
    • connectedboolean
      Example: false
  • mailchimpobject
    Show 3 child attributesHide child attributes
    • list_idstring, nullable
    • sync_customersboolean
      Example: false
    • connectedboolean
      Example: false
  • shopifyobject
    Show 1 child attributeHide child attributes
    • sync_customersboolean
      Example: true
  • sync_customers_tagstring
    Example: restock-rocket
  • meta_pixelobject
    Show 2 child attributesHide child attributes
    • enabledboolean
      Example: true
    • pixel_idstring, nullable
      Example: 1234567890123456
  • flow_triggersobject
    Show 2 child attributesHide child attributes
    • enabledboolean
      Example: true
    • triggersarray of strings
  • split_order_appobject
    Show 1 child attributeHide child attributes
    • enabledboolean
      Example: false
  • postscriptobject
    Show 4 child attributesHide child attributes
    • keywordstring, nullable
    • keyword_idstring, nullable
    • connectedboolean
      Example: false
    • sms_setup_verifiedboolean
      Example: false
  • judgemeobject
    Show 1 child attributeHide child attributes
    • connectedboolean
      Example: true
  • gorgiasobject
    Show 1 child attributeHide child attributes
    • connectedboolean
      Example: false
  • smileobject
    Show 1 child attributeHide child attributes
    • connectedboolean
      Example: false

Errors

404
not_found

The path is valid but nothing with that id exists in this store.

409
conflict

The request is well formed, but the resource's current state does not allow it.

409
idempotency_key_in_progress

An earlier request with the same Idempotency-Key is still running. Wait, then resend the same request with the same key.

422
invalid_params

One or more fields failed the action's schema.

422
use_key_link

Through an assistant or MCP, a third-party API key would pass through a model, so STOQ refuses it and returns the dashboard link where the merchant enters it.

422
validation_failed

The action refused the request for a reason that is not a single bad field.

502
shopify_error

A Shopify call the operation needs failed after the operation had started.

503
upstream_unavailable

A service the answer depends on did not respond in time.

Any request can also fail with auth_invalid (401) or rate_limited (429).

Every error has the same shape: see Errors and the list of error codes.

PATCH/account/integrations
curl -X PATCH "https://app.stoqapp.com/api/v2/external/account/integrations" \
  -H "X-Auth-Token: $STOQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "meta_pixel": {
      "enabled": true,
      "pixel_id": "1234567890123456"
    },
    "flow_triggers": {
      "enabled": true,
      "triggers": [
        "flow-customer-signed-up",
        "flow-customer-placed-preorder"
      ]
    }
  }'
Response
{
  "klaviyo": {
    "sync_customers": true,
    "oauth_token_expires_at": "2026-11-14T09:30:00Z",
    "connected": true,
    "connection_method": "oauth",
    "oauth_token_valid": true,
    "oauth_needs_refresh": false,
    "email_setup_verified": true,
    "sms_setup_verified": false
  },
  "omnisend": {
    "sync_customers": false,
    "connected": false
  },
  "mailchimp": {
    "list_id": null,
    "sync_customers": false,
    "connected": false
  },
  "shopify": {
    "sync_customers": true
  },
  "sync_customers_tag": "restock-rocket",
  "meta_pixel": {
    "enabled": true,
    "pixel_id": "1234567890123456"
  },
  "flow_triggers": {
    "enabled": true,
    "triggers": [
      "flow-customer-signed-up",
      "flow-customer-placed-preorder"
    ]
  },
  "split_order_app": {
    "enabled": false
  },
  "postscript": {
    "keyword": null,
    "keyword_id": null,
    "connected": false,
    "sms_setup_verified": false
  },
  "judgeme": {
    "connected": true
  },
  "gorgias": {
    "connected": false
  },
  "smile": {
    "connected": false
  }
}