Sign inDocsBlogAboutSupportContact
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

Interface examples use sample data. Results, counts, and timing vary by site and configuration.

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

The salesforce api request command uses the supported Salesforce username-password OAuth flow, caches a token, and can retry authentication after a 401. Supply the required credentials in the command configuration and review the endpoint, permissions, provider policy, and response. Variables accept non-secret data only.

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

Shown in advanced mode, where commands start with tp. In easy mode you type the same command without the tp prefix.

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.

See it in action

Salesforce is just another saved endpoint. The demo shows how an API connection is added and called, the same pattern you use to push a lead or pull a record with send api.

Recordings show the interface at the time of capture and can differ from the current build. Follow this page and the current command reference for supported behavior.

How it works

1
Configure Salesforce credentials Provide the required Connected App and account credentials in the command configuration. Variables are not a credential store. Restrict access to macros, exports, and logs; follow your Salesforce account's authentication policy.
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 (Client ID). Tip: store as a variable and pass {{var.sf_client_id}}.
-client_secretConnected App consumer secret.
-usernameSalesforce login username (e.g. you@example.com).
-passwordConcatenate the SF password with the security token from your SF profile settings.
-login_urlhttps://login.salesforce.com (production) or https://test.salesforce.com (sandbox). Leave blank for production.
-sandboxIf true and no login URL is set, uses https://test.salesforce.com.
-api_versionSalesforce REST API version (e.g. v59.0). Default: v59.0.
-methodREST method for the Salesforce call.
-endpointPath starting with `/`, e.g. /services/data/v59.0/sobjects/Contact or /services/data/v59.0/query?q=SELECT+Id+FROM+Contact.
-bodyJSON payload for POST / PATCH / PUT requests. Supports {{placeholders}} from trigger / chain / variables.
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

Frequently asked questions

Ready?

Connect WordPress to Salesforce today.

One of 100 command variants. Part of the TrueCommander package.

Cookies. The short version.

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