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
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.
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
{{placeholders}} in the -body parameter. The command resolves them at runtime and sends the exact payload Salesforce expects.| Detail | Value |
|---|---|
| Command name | salesforce api request |
-client_id | Connected App consumer key (Client ID). Tip: store as a variable and pass {{var.sf_client_id}}. |
-client_secret | Connected App consumer secret. |
-username | Salesforce login username (e.g. you@example.com). |
-password | Concatenate the SF password with the security token from your SF profile settings. |
-login_url | https://login.salesforce.com (production) or https://test.salesforce.com (sandbox). Leave blank for production. |
-sandbox | If true and no login URL is set, uses https://test.salesforce.com. |
-api_version | Salesforce REST API version (e.g. v59.0). Default: v59.0. |
-method | REST method for the Salesforce call. |
-endpoint | Path starting with `/`, e.g. /services/data/v59.0/sobjects/Contact or /services/data/v59.0/query?q=SELECT+Id+FROM+Contact. |
-body | JSON payload for POST / PATCH / PUT requests. Supports {{placeholders}} from trigger / chain / variables. |
| Token caching | Access token cached 30 minutes per (org, client_id, username). Auto-refreshed on HTTP 401. |
| Placeholder support | All 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
salesforce api request command calls any Salesforce REST endpoint directly from WordPress. It handles authentication for you, so a WooCommerce order can create a Contact or Opportunity the moment checkout completes, with no middleware.-endpoint, -method, and -body, so any standard or custom object the Salesforce REST API exposes is reachable, not just the few a dedicated sync plugin maps.