Salesforce Commerce B2B/D2C
Number of APIs: 18
Salesforce Commerce B2B/D2C APIs
This Qodex collection contains API endpoints from various Salesforce Commerce B2B/D2C API domains.
Get started
Follow this documentation to get started with Salesforce Qodex collections.
⚠️ Disclaimers:
- This collection is provided as-is. It's not officially supported by Salesforce or covered by SLAs.
- API documentation is not provided with the collection. Please refer to the official documentation.
- The documentation for the majority of the endpoints in this collection can be found in the B2B/D2C section of the Connect API documentation.
ℹ️ Report issues and ask questions here.
Though not strictly required to use the collection, for ease of use some APIs in the collection assume data found in a commerce B2B/D2C trial webstore created through the SFDX commerce plugin. For more information on how to create a trial webstore please see How to Create Scratch Orgs and Stores.
Variables Reference
The collection relies on the following variables:
Note: Not every folder needs all of the variables. Look at the documentation of each folder for specific details
Variable | Description | Where to find it? (Some assume trial webstore) |
---|---|---|
orgUrl | The base URL for the Salesforce org. | Through the following SFDX command : sfdx force:org:display -u . The orgUrl is the Instance Url in the response. |
orgId | Salesforce org Id. | Use the Login org admin (SOAP) endpoint under Setup Queries folder to return the id. (This uses orgUsername and orgPassword ) |
orgUsername | Org administrator username | Specified when the org was created. |
orgPassword | Org administrator password | Specified when the org was created. |
apiVersion | The Salesforce API version (e.g.: 57.0). | Log into the org -> Go to Setup -> type apex classesin the Quick Find box >> click New in the Apex Classespage -> click on the Version Settingtab to see all the supported versions |
webstoreName | The name of the webstore. | Specified at webstore creation time. |
webstoreId | The Id of the webstore. | Use the Get webstore id endpoint under Setup Queries folder to return the id. (This uses webstoreName ) |
buyerUsername | Registered buyer/shopper username. | Specified when creating the trial webstore. |
buyerPassword | Registered buyer/shopper password. | Specified when creating the trial webstore. |
buyerAccountId | Account Id associated with the shopper/buyer. | Use the Get buyer account id endpoint under Setup Queries folder to return the id. (This uses buyerUsername ) |
productSearchTerm | Search term used to find the product. | Defaulted to coffee, which will return results in the trial webstore. |
-
End2End Buyer/Shopper Journey - Search products by search term POST {{orgUrl}}/services/data/v{{apiVersion}}/commerce/webstores/{{webstoreId}}/search/product-search
-
End2End Buyer/Shopper Journey - Update checkout with payment POST {{orgUrl}}/services/data/v{{apiVersion}}/commerce/webstores/{{webstoreId}}/checkouts/:checkoutId/payments
-
Setup Queries - Get buyer account Id GET {{orgUrl}}/services/data/v{{apiVersion}}/query/?q=SELECT+Id,+Username,+AccountId+FROM+User+WHERE+UserName+=+'{{buyerUsername}}'
-
End2End Buyer/Shopper Journey - Login buyer/shopper (SOAP) POST {{orgUrl}}/services/Soap/u/{{apiVersion}}
-
End2End Buyer/Shopper Journey - Get product GET {{orgUrl}}/services/data/v{{apiVersion}}/commerce/webstores/{{webstoreId}}/products/:productId
-
End2End Buyer/Shopper Journey - Delete cart (if needed) DELETE {{orgUrl}}/services/data/v{{apiVersion}}/commerce/webstores/{{webstoreId}}/carts/:cartId
-
End2End Buyer/Shopper Journey - Create a cart POST {{orgUrl}}/services/data/v{{apiVersion}}/commerce/webstores/{{webstoreId}}/carts
-
End2End Buyer/Shopper Journey - Add item to the cart POST {{orgUrl}}/services/data/v{{apiVersion}}/commerce/webstores/{{webstoreId}}/carts/:cartId/cart-items
-
End2End Buyer/Shopper Journey - Get shipping address GET {{orgUrl}}/services/data/v{{apiVersion}}/commerce/webstores/{{webstoreId}}/accounts/{{buyerAccountId}}/addresses?addressType=Shipping&sortOrder=CreatedDateDesc&excludeUnsupportedCountries=true
-
End2End Buyer/Shopper Journey - Update shipping address (if address exists) PATCH {{orgUrl}}/services/data/v{{apiVersion}}/commerce/webstores/{{webstoreId}}/accounts/{{buyerAccountId}}/addresses/:addressId