The purpose of this page is to describe the headless Billing API service that enables rapid experience-first commerce development and applications.
Billing API follows a microservice architecture that enables commerce into any part of an application and is built on the JSON API specification, follows predictable REST URLs and supports cross-origin resource sharing.
All requests to the API need to be accompanied by an authorization header with a standard salesforce authentication token.
The SDK comes with built-in mechanisms for obtaining the above authentication token or you may use any standard Salesforce approach for obtaining a custom access token for use with the API.
The Billing API is installed with the Billing package and can be exposed to external applications via a Salesforce site or community. Once a community or site has been built, all API’s will have the structure:
The Billing API ensures backward compatibility by properly versioning any changes to the APIs. Should changes to the API structure need to be made, it will occur within a new version and older functionality will be preserved.
X-Storefront Header Parameter
In order to match your API requests with a storefront, the x-storefront parameter must be used with all requests in the request header. It should match a storefront name record in SFDC.
Requests made to the API must be encoded as JSON and contain the header
You can easily include resource relationships on most top-level resources. Multiple includes are defined using comma-delimited values.
Server side caching is used and can be configured per request using the cacheStrategy query parameter.
Any request that returns an error follows a standard format. The Billing APIs will return an array of errors that contains objects containing the status, title and data with the error details.
|500||Something went wrong on our end|