How to Sync WooCommerce Orders to Salesforce Without Hitting API Limits

Sync WooCommerce Orders to Salesforce

Connecting WooCommerce to Salesforce usually starts out simple. A new order comes in, a webhook fires, and a record shows up in the CRM. Then a big sale doubles your order volume, and one morning the sync stops with a REQUEST_LIMIT_EXCEEDED error.

Salesforce caps how many API calls an org can make in a rolling 24-hour window. Most WooCommerce integrations send data one order at a time, which burns through that cap much faster than store owners expect. This guide explains how the limits work, how to estimate your usage, and the design choices that keep a high-volume store in sync.

How Salesforce API Limits Work

Salesforce counts every REST and SOAP call against a daily allocation. According to Salesforce’s developer limits reference, Enterprise and Professional Edition orgs (with API access) get 100,000 calls, plus 1,000 for each Salesforce license. Unlimited and Performance Edition orgs get 100,000 plus 5,000 per license, and Developer Edition orgs get 15,000.

The window is rolling, so there is no midnight reset. A spike at 9 p.m. still counts against you at 8 a.m. the next day.

Two details catch teams off guard:

  • The allocation is shared across the whole org. Your WooCommerce sync competes with marketing tools, data loaders, reporting apps, and anything else connected to Salesforce.
  • The grace room is not guaranteed. Salesforce may let a paid org run slightly past its limit, but it doesn’t promise to. After that, calls fail with an HTTP 403 and REQUEST_LIMIT_EXCEEDED until usage drops.

How to Check Your Current Usage

In Salesforce Setup, open Company Information and find the “API Requests, Last 24 Hours” field. Developers can also call the /limits REST resource, which returns DailyApiRequests with the maximum and remaining counts.

Every REST response also carries a Sforce-Limit-Info header, such as api-usage=18250/120000. Your integration can read that value on each call and slow down when usage climbs.

Estimate How Many Calls Your Store Actually Uses

A basic order sync often makes more calls than people think. For a single order, a typical plugin or custom script might:

  1. Search for an existing Contact by email
  2. Create or update the Account and Contact
  3. Create the Order record
  4. Create one OrderItem per line item
  5. Update the order later, when it ships or gets refunded

With three line items, that adds up to around eight calls for one order. Status changes add more, since WooCommerce fires a new order.updated webhook each time an order moves from processing to completed or gets refunded.

Picture a store handling 3,000 orders a day, where each order triggers three webhooks and each webhook uses six calls. That’s 54,000 calls a day. An Enterprise org with 20 licenses has 120,000, so it looks safe.

During a Black Friday week at five times normal volume, the same sync needs 270,000 calls. The integration falls over on the busiest sales day of the year.

Choose Between Real-Time and Bulk Sync

Not every piece of order data has to reach Salesforce within seconds. Splitting data by urgency is the easiest way to cut API usage without losing anything the sales team needs.

When Real-Time Sync Makes Sense

Use real-time sync for events a person will act on right away. Good examples are a high-value order a sales rep should follow up on, a failed payment, or a B2B customer’s first purchase.

Keep those calls lean by combining steps. The Salesforce Composite API bundles up to 25 subrequests into one call, and the whole bundle counts as a single request against your limit. Creating the Account, Contact, Order, and line items in one composite request turns eight calls into one. The sObject Collections endpoint works in a similar way and handles up to 200 records per call.

When Bulk Sync Is the Better Fit

Order history, line item details for reporting, and status updates on routine orders can wait an hour or run overnight. Queue these in WordPress and send them in batches through Bulk API 2.0.

Bulk API 2.0 is built for large data loads and processes records on Salesforce’s side in the background. Sending 3,000 orders in a few bulk jobs uses a tiny fraction of the calls that 3,000 separate requests would. The tradeoff is delay, so agree with the sales team on which data shows up when.

Use Platform Events to Decouple the Two Systems

A direct, point-to-point sync puts all the logic on the WooCommerce side. If Salesforce is slow or a record is locked, the webhook fails and the order gets stuck.

Platform Events offer a cleaner pattern. WooCommerce (or a middleware service) publishes a small event, such as Woo_Order_Placed__e, carrying the order ID and key fields. Inside Salesforce, an Apex trigger or Flow subscribes to that event and handles the work of creating and linking records.

This setup has three practical benefits:

  • Salesforce delivers events to triggers in batches, so one run can handle many orders at once.
  • The store needs just one call to publish each event, no matter how many records get created from it.
  • The processing logic lives in Salesforce, where admins can see it and adjust it.

Keep in mind that publishing events through the API still counts toward your daily limit. Event delivery also has its own allocation by edition, so check both numbers before moving a large volume onto this pattern.

Batch Processing and Trigger Design on the Salesforce Side

Once data arrives in bulk or through events, the Apex code that handles it decides whether the sync stays reliable. Salesforce enforces governor limits on every transaction, including 100 SOQL queries and 150 DML statements in synchronous Apex. Triggers receive records in chunks of up to 200, so code that runs a query inside a loop can hit those caps on a busy afternoon.

Good trigger design follows a few rules:

  • Bulkify everything. Query and update records as collections, never one at a time inside a loop.
  • Use one trigger per object. Pass the logic to a handler class so the order of execution stays predictable.
  • Move heavy work to Batch Apex or Queueable jobs. Batch Apex processes records in scopes of 200 by default (up to 2,000), with fresh governor limits for each chunk. Salesforce allows up to five batch jobs queued or active at once.
  • Upsert by External ID. Store the WooCommerce order ID in an External ID field, so a retry updates the same record instead of creating a duplicate.

This layer is where a lot of WooCommerce teams get stuck. Their developers know PHP, WordPress hooks, and the WooCommerce REST API, but Apex comes with its own rules, like 75% test coverage before code can deploy to production. For stores that need this built right the first time, it’s often faster to hire apex developers who have designed high-volume integrations before than to retrain a PHP team mid-project.

Build Retry Logic for Failed Webhooks

Even a well-designed sync will see failures. Salesforce might hit a limit, a record might be locked, or the endpoint might time out. The goal is to recover cleanly when that happens.

WooCommerce is strict here. Its developer docs state that after five consecutive failed deliveries (any response outside the 2xx range), the webhook is disabled and has to be switched back on manually. One bad hour on the receiving end can quietly stop the sync for days.

To prevent that:

  1. Acknowledge fast, process later. Have the receiving endpoint return a 200 as soon as it saves the payload, then process it from a queue.
  2. Verify the signature. Check the X-WC-Webhook-Signature header, a base64-encoded HMAC-SHA256 hash of the payload, before accepting any data.
  3. Retry with backoff. When Salesforce returns REQUEST_LIMIT_EXCEEDED or a lock error, wait and retry at growing intervals, such as 1 minute, 5 minutes, then 30 minutes.
  4. Keep a dead-letter list. After a set number of attempts, move the order to a failed list and alert someone.
  5. Run a nightly reconciliation. Compare the last 24 hours of WooCommerce order IDs against Salesforce and resend any that are missing.

External ID upserts make all of this safe. If the same order arrives twice, Salesforce matches it and updates the existing record.

Monitor Usage Before It Becomes a Problem

Set an alert well ahead of the limit. Salesforce lets admins create API Usage Notifications in Setup, which email a chosen user when usage passes a set percentage. An alert at 70% gives the team time to pause bulk jobs before real-time sync is affected.

It also helps to log the api-usage value from the Sforce-Limit-Info header on your side. A simple daily chart of calls per order shows right away when a plugin update or a new field mapping starts using more calls than before.

Step-by-Step Implementation Workflow

The sections above explain the pieces. This workflow puts them in order, so you can go from a fragile sync to one that holds up at peak volume.

Step 1: Record Your Baseline API Usage

Open Setup, go to Company Information, and note the “API Requests, Last 24 Hours” value once a day for a week. Include at least one busy day, such as a Monday after a weekend promo.

Write down every other tool that calls Salesforce, like a marketing platform, a data loader, or a BI connector. Your WooCommerce sync only gets what those tools leave behind.

Step 2: Estimate Calls Per Day, Then Plan for Peak

List each WooCommerce event your sync listens to, and count the Salesforce calls each one makes. Then run this formula:

Daily calls = daily orders × webhooks per order × calls per webhook

Multiply the result by your peak factor. For most stores, that means Black Friday or your biggest sale, often three to five times a normal day. Aim to keep the peak number under 70% of your org’s allocation after subtracting what other tools use.

Step 3: Sort Each Data Type Into Real-Time or Batch

Go through every field and record your sync sends, and ask one question: does someone act on this within the hour? If yes, it goes on the real-time path. If no, it goes in the batch queue.

DataWho needs itPath
High-value or B2B ordersSales repsReal-time
Failed paymentsSupport teamReal-time
Routine new ordersReportingBatch (hourly)
Line item detailsReportingBatch (nightly)
Shipped and completed statusAccount historyBatch (hourly)
RefundsFinanceReal-time or hourly

Step 4: Slim Down the Real-Time Path

Rebuild each real-time sync as one Composite API request that creates or updates the Account, Contact, Order, and line items together. Use upsert calls keyed on an External ID field that holds the WooCommerce order ID.

This step alone often drops a new order from eight calls to one. Re-run the Step 2 formula with the new number.

Step 5: Set Up the Batch Queue

On the WordPress side, write batch-bound orders to a queue instead of sending them right away. WooCommerce ships with Action Scheduler, which can run a recurring job every hour to collect queued orders.

That job sends the batch to Salesforce as a Bulk API 2.0 job and marks each order as sent. Schedule the nightly batch for your store’s quietest hours, when other tools use the fewest calls.

Step 6: Build the Salesforce Side

Create a platform event for new orders and a single, bulkified Apex trigger that handles it. Move anything heavy, like recalculating account totals, into Batch Apex or a Queueable job.

Write the Apex tests alongside the code. Salesforce blocks production deploys below 75% test coverage, so tests can’t be left for the last week.

Step 7: Add Retries and Reconciliation

Go through this checklist before launch:

  • The webhook endpoint returns a 200 within a few seconds and processes from a queue
  • Every payload is checked against the X-WC-Webhook-Signature header
  • Failed calls retry at 1, 5, and 30 minutes
  • Orders that fail every retry move to a dead-letter list that alerts a named person
  • A nightly job compares the last 24 hours of order IDs in both systems and resends gaps

Step 8: Test at Peak Volume in a Sandbox

Run a load test in a Salesforce sandbox before your next big sale. A Full sandbox gets its own large API allocation, so tests there won’t use up production calls.

Replay a copy of real order data at your peak factor from Step 2. Watch for API errors, lock errors, and governor limit failures, and check that no WooCommerce webhook switches to Disabled during the test.

Step 9: Turn On Monitoring

Create an API Usage Notification in Setup that emails the team at 70% of the daily allocation. Log the api-usage value from the Sforce-Limit-Info header on every call.

Once a week, divide total calls by total orders. If calls per order creep up after a plugin update or a new field mapping, you’ll catch it before your next peak.

Conclusion

Syncing WooCommerce orders to Salesforce at scale is mostly about spending API calls where they matter. Send urgent events in real time and batch the rest. Let Salesforce do the processing through Platform Events and bulkified Apex, and build retries that expect things to fail. Stores that plan for peak volume ahead of time avoid the most costly kind of sync outage, the one that lands on their best sales day.

FAQs

How many API calls does Salesforce allow per day?

It depends on your edition and license count. Enterprise Edition gets 100,000 calls plus 1,000 per Salesforce license in a rolling 24-hour period. Unlimited Edition gets 100,000 plus 5,000 per license, and Developer Edition gets 15,000.

What happens when a WooCommerce integration hits the Salesforce API limit?

New calls fail with a REQUEST_LIMIT_EXCEEDED error until usage in the rolling window drops. Orders placed during that time won’t reach Salesforce unless the integration queues them and retries later.

Can I buy more Salesforce API calls?

Yes. Salesforce sells API Call Add-Ons that raise the daily allocation. It’s worth cutting wasted calls first, since composite requests and batching can reduce usage a lot before you pay for more.

Should I use a plugin or a custom integration?

Plugins work well for low-volume stores with standard data. Stores with high order volume, custom objects, or B2B pricing rules usually need custom logic on the Salesforce side to stay within limits.

Why did my WooCommerce webhook stop working?

WooCommerce disables a webhook after five consecutive failed deliveries. Go to WooCommerce > Settings > Advanced > Webhooks, fix the problem on the receiving endpoint, then set the webhook’s status back to Active.