Sign inBlogAboutSupportContact
Integrations

Push WordPress and WooCommerce data straight into Salesforce from a macro, no Zapier

Authenticate to Salesforce via OAuth 2.0, hit any REST endpoint, and pass WordPress data via placeholders. The token is cached and auto-refreshed. Store credentials once as variables and reuse them everywhere.

5 min read May 2026 salesforce api request

Your WordPress and Salesforce data live in separate worlds

A new customer checks out in WooCommerce. That person needs to exist as a Contact in Salesforce, attached to the right Account, with the order value recorded as an Opportunity. Right now, one of three things happens: your team copies the data manually, you pay for a Zapier zap that breaks silently when Salesforce field names change, or the data never makes it across at all.

Manual entry doesn't scale. Zapier works until it doesn't, and when it stops you find out from a sales rep, not an alert. What you actually want is a direct call from WordPress to Salesforce the moment something happens, with the exact fields you control, driven by logic you wrote.

What most people do

Use Zapier or Make Automation platforms work at the trigger level. When your WooCommerce webhook fires late, or the zap hits a step limit, or Salesforce updates its API version, the sync breaks and nobody knows until the pipeline runs dry.
Install a WooCommerce-Salesforce sync plugin Dedicated sync plugins map specific fields and handle standard objects. They fall apart the moment you need a custom object, a conditional field, or a sync that depends on WordPress data outside their schema.
Write a custom plugin or REST client A bespoke integration gives you full control, but you own the OAuth flow, the token refresh, the error handling, and every Salesforce API version bump. That is a real maintenance burden for something that should be a few lines of configuration.

A better way: direct Salesforce REST calls from inside a macro

TrueCommander's salesforce api request command handles the OAuth 2.0 Username-Password flow for you, caches the access token for 30 minutes per org and user combination, and auto-refreshes on a 401. You hit any Salesforce REST endpoint with any method. Every parameter supports {{placeholder}} substitution, so you store your credentials once as TrueCommander variables and reference them everywhere without repeating raw secrets in every step.

TrueCommander
Contact created in Salesforce
HTTP 201 Created
Token cached for 30 minauto-refresh on 401
New Contact ID returned in response
Credentials from variables, not hardcodedDRY

The token cache eliminates redundant auth calls. When a macro triggers salesforce api request multiple times in quick succession, each subsequent call within the 30-minute window reuses the cached token. A 401 from Salesforce triggers an automatic re-authentication before retrying the request, so token expiry never surfaces as an error in your macro logs.

How it works

1
Store credentials as TrueCommander variables Save your Connected App consumer key, consumer secret, Salesforce username, and password-plus-token as named variables. Reference them as {{sf_client_id}} and so on in every step that calls Salesforce, so you update them in one place if they ever rotate.
2
Add the command to a macro triggered by a WordPress event Set the macro to fire on WooCommerce order completion, user registration, or any other hook. Map order or user fields to {{placeholders}} in the -body parameter. The command resolves them at runtime and sends the exact payload Salesforce expects.
3
Use the Salesforce response in later macro steps The command returns the full Salesforce API response. A new Contact ID or Opportunity ID returned in that response can be stored as a variable and passed to a subsequent step, chaining multiple Salesforce calls in one macro run.
DetailValue
Command namesalesforce api request
-client_idConnected App consumer key from your Salesforce org's App Manager
-client_secretConnected App consumer secret
-usernameSalesforce login username (usually an email address)
-passwordSalesforce password concatenated directly with the security token from your SF profile settings (no separator)
-login_urlhttps://login.salesforce.com for production. https://test.salesforce.com for sandbox. Defaults to production.
-sandboxIf true and no -login_url is set, uses https://test.salesforce.com automatically
-api_versionSalesforce API version, e.g. v59.0. Defaults to v59.0.
-methodREST method: GET, POST, PATCH, PUT, or DELETE
-endpointPath starting with /, e.g. /services/data/v59.0/sobjects/Contact
-bodyJSON payload for POST, PATCH, or PUT. Supports {{placeholder}} substitution. Ignored for GET and DELETE.
Token cachingAccess token cached 30 minutes per (org, client_id, username). Auto-refreshed on HTTP 401.
Placeholder supportAll parameters resolve {{variables}} at runtime when used inside a macro
Can be used in

Real example

A B2B WooCommerce store sells annual software licenses. Every new customer should become a Salesforce Contact and their first purchase should create an Opportunity so the sales team can see pipeline value in real time.

You create a macro that fires on WooCommerce's woocommerce_order_status_completed hook. Step one calls salesforce api request with -endpoint=/services/data/v59.0/sobjects/Contact, -method=POST, and a -body that maps {{billing_first_name}}, {{billing_last_name}}, and {{billing_email}} from the order. Step two reads the Contact ID from the response and calls salesforce api request again to create an Opportunity linked to that Contact, with the order total as the Amount field.

The whole macro runs in under two seconds. Your credentials are stored as variables and never appear in any macro step in plain text. The sales team opens Salesforce the next morning and every overnight customer is already there.

Goes further with TrueCommander

Ready?

Connect WordPress to Salesforce today.

One of 91 commands. All included with every license.

Cookies. The short version.

Essential cookies keep the cart and theme working. Analytics only fire if you say yes. Read our policy.