#shopify#rate-limit#buffers#429

“I need to update thousands of Shopify products but the API throttles me hard”

Drip-feed Shopify bulk updates with a buffer

Shopify's API is strictly rate-limited. Push every product update into a buffer capped at 2/sec and Fliq feeds them to Shopify in order, retrying any 429s without burning a retry.

Shopify’s Admin API uses a leaky-bucket limit (famously ~2 requests/sec on the REST Admin API for standard plans). Push a few thousand product updates at it and you’ll spend your afternoon nursing 429s and Retry-After headers. A Fliq buffer turns that into one decision: set the rate once, push everything in, walk away.

The request

Create a buffer at Shopify’s safe rate, then push one item per product update.

# 1. Create the buffer at ~2 req/sec
curl -X POST https://api.fliq.sh/buffers \
  -H "Authorization: Bearer fliq_sk_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "shopify-product-updates",
    "url": "https://your-store.myshopify.com/admin/api/2024-10/products/123.json",
    "method": "PUT",
    "headers": {
      "X-Shopify-Access-Token": "shpat_...",
      "Content-Type": "application/json"
    },
    "rate_limit": 2,
    "max_retries": 5,
    "backoff": "exponential"
  }'

# 2. Push an update (body + per-item header override for the product URL is not
#    needed here; one buffer per target URL — see the note below)
curl -X POST https://api.fliq.sh/buffers/BUFFER_ID/items \
  -H "Authorization: Bearer fliq_sk_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "{\"product\":{\"id\":123,\"tags\":\"sale,summer\"}}"
  }'
const FLIQ = { Authorization: "Bearer fliq_sk_your_token", "Content-Type": "application/json" };

// 1. One buffer per Shopify endpoint, at the plan's safe rate.
const buf = await (await fetch("https://api.fliq.sh/buffers", {
  method: "POST",
  headers: FLIQ,
  body: JSON.stringify({
    name: "shopify-product-updates",
    url: "https://your-store.myshopify.com/admin/api/2024-10/graphql.json",
    method: "POST",
    headers: {
      "X-Shopify-Access-Token": process.env.SHOPIFY_TOKEN,
      "Content-Type": "application/json",
    },
    rate_limit: 2,         // Shopify-safe
    max_retries: 5,
    backoff: "exponential",
  }),
})).json();

// 2. Push every update through the GraphQL Admin API (one mutation per item).
for (const p of products) {
  await fetch(`https://api.fliq.sh/buffers/${buf.id}/items`, {
    method: "POST",
    headers: FLIQ,
    body: JSON.stringify({
      body: JSON.stringify({
        query: `mutation($id: ID!, $tags: [String!]!) {
          tagsAdd(id: $id, tags: $tags) { node { id } userErrors { message } }
        }`,
        variables: { id: p.gid, tags: p.tags },
      }),
    }),
  });
}

What Fliq handles for you

  • A Shopify-safe rate. The token bucket caps delivery at rate_limit/sec, so you stay under Shopify’s limit by construction instead of reacting to throttling.
  • 429s don’t cost you. When Shopify replies 429, Fliq honours Retry-After and re-queues the item without consuming a retry — your real retry budget is reserved for genuine failures.
  • Ordering. Updates land in the order you pushed them, one in flight at a time — important when later edits depend on earlier ones.
  • Replay the stragglers. Anything that exhausts retries can be replayed after you fix the cause: POST /buffers/BUFFER_ID/items/ITEM_ID/replay appends it to the tail.
Drip-feed any throttled API without Redis — free tier