Optional
accessOptional
correlationValue to be passed in the X-Correlation-ID
HTTP header
Optional
dataPlain JavaScript object containing the payload to send as JSON
This object will be converted to a JSON string and sent as the body
of a POST
or DELETE
request.
Optional
headersKey/value pairs representing the HTTP headers to send
You can pass in any headers you like using this property, however this is generally not necessary, as the {@see CommercetoolsApi.request} method applies all necessary headers.
You should specifically avoid setting values for the following headers:
Authorization
Content-Type
X-Correlation-ID
User-Agent
All of the above are set by the CommercetoolsApi
class.
Example value:
{
...
headers: {
'X-My-Special-Header': 'MyCustomValue'
}
...
}
HTTP method to use when sending the request
Optional
paramsQuerystring parameters to send with the request
Key/value pairs that are then converted in to a querystring
using the qs
npm package. See the paramSerializer
option
in {@see CommercetoolsApi.createAxiosInstance} for
implementation details.
Path of the REST endpoint
This is the absolute path, without the host/schema/port etc. You should not include your project key, as this will be automatically prepended.
Example: /product-projections
Note that if you want to create a path that takes into account the store key that you defined in {@see CommercetoolsApiConfig} then you should use the {@see CommercetoolsApi.applyStore} method.
Optional
retryRequest retry configuration
The request retry configuration can be set on the CommercetoolsApi
instance or on a request by request basis. If no value is passed in
here, we fall back to using the configuration provided when constructing
the CommercetoolsApi
instance. If no value was passed in to the
constructor configuration, then no retries will take place.
Access token to use as the value for the
Authorization
bearer tokenTypically, this would be the access token that belongs to a customer. This must be passed in when using one of the
me
endpoints.If this property is not passed in, we fall back to using the client access token.