In order to be able to build request objects you can use the RequestBuilder. The following methods return a HTTP request instance of Guzzle PSR-7.
$root = new ApiRequestBuilder();
<tt>withProjectKey("projectKey")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->get();
<tt>withProjectKey("projectKey")->head()</tt>
Checks if a Project exists for a given projectKey
. Returns a 200 OK
status if the Project exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->head();
<tt>withProjectKey("projectKey")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->post(null);
<tt>withProjectKey("projectKey")->apiClients()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->apiClients()
->get();
<tt>withProjectKey("projectKey")->apiClients()->head()</tt>
Checks if an API Client exists for a given Query Predicate. Returns a 200 OK
status if any API Clients match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->apiClients()
->head();
<tt>withProjectKey("projectKey")->apiClients()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->apiClients()
->post(null);
<tt>withProjectKey("projectKey")->apiClients()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->apiClients()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->apiClients()->withId("ID")->head()</tt>
Checks if an API Client exists for a given id
. Returns a 200 OK
status if the API Client exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->apiClients()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->apiClients()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->apiClients()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->businessUnits()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->businessUnits()
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->businessUnits()->head()</tt>
Checks if a BusinessUnit exists for a given Query Predicate. Returns a 200 OK
status if any BusinessUnits match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->businessUnits()
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->businessUnits()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->businessUnits()
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->businessUnits()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->businessUnits()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->businessUnits()->withId("ID")->head()</tt>
Checks if a BusinessUnit exists for a given id
. Returns a 200 OK
status if the BusinessUnit exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->businessUnits()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->businessUnits()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->businessUnits()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->businessUnits()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->businessUnits()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->businessUnits()->withKey("key")->head()</tt>
Checks if a BusinessUnit exists for a given key
. Returns a 200 OK
status if the BusinessUnit exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->businessUnits()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->businessUnits()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->businessUnits()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->approvalFlows()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->approvalFlows()
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->approvalFlows()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->approvalFlows()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->approvalFlows()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->approvalFlows()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->approvalRules()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->approvalRules()
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->approvalRules()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->approvalRules()
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->approvalRules()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->approvalRules()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->approvalRules()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->approvalRules()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->approvalRules()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->approvalRules()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->approvalRules()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->approvalRules()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->head()</tt>
Checks if a Cart exists for a given Query Predicate. Returns a 200 OK
status if any Carts match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->post(null)</tt>
Creates a [Cart](ctp:api:type:Cart) in the [BusinessUnit](ctp:api:type:BusinessUnit) referenced by businessUnitKey
. As such, the businessUnit
field on [CartDraft](ctp:api:type:CartDraft) is ignored for this request. Creating a Cart can fail with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match the Cart.
Specific Error Codes:
- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->withId("ID")->get()</tt>
If the Cart exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->withId("ID")->head()</tt>
Checks if a Cart exists for a given id
. Returns a 200 OK
status if the Cart exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->withId("ID")->post(null)</tt>
If the Cart exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->withId("ID")->delete()</tt>
If the Cart exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->withKey("key")->get()</tt>
If the Cart exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->withKey("key")->head()</tt>
Checks if a Cart exists for a given key
. Returns a 200 OK
status if the Cart exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->withKey("key")->post(null)</tt>
If the Cart exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->withKey("key")->delete()</tt>
If the Cart exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->carts()->replicate()->post(null)</tt>
Creates a new Cart by replicating an existing Cart or Order. Can be useful in cases where a customer wants to cancel a recent order to make some changes or reorder a previous order.
The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in Active
[CartState](ctp:api:type:CartState).
The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to initial
.
If the Cart exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Specific Error Codes:
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->carts()
->replicate()
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->orders()
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->head()</tt>
Checks if an Order exists for a given Query Predicate. Returns a 200 OK
status if any Orders match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->orders()
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->post(null)</tt>
Creates an Order from a [Cart](ctp:api:type:Cart) in a [BusinessUnit](ctp:api:type:BusinessUnit). The Cart must have a shipping address set before creating an Order. Creating an Order fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the Cart does not reference the same BusinessUnit as the businessUnitKey
path parameter.
Specific Error Codes:
- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [OutOfStock](ctp:api:type:OutOfStockError)
- [PriceChanged](ctp:api:type:PriceChangedError)
- [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError)
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->orders()
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->withId("ID")->get()</tt>
If the Order exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->orders()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->withId("ID")->head()</tt>
Checks if an Order exists for a given id
. Returns a 200 OK
status if the Order exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->orders()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->withId("ID")->post(null)</tt>
If the Order exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->orders()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->withOrderNumber("orderNumber")->get()</tt>
If the Order exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->orders()
->withOrderNumber("orderNumber")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->withOrderNumber("orderNumber")->head()</tt>
Checks if an Order exists for a given orderNumber
. Returns a 200 OK
status if the Order exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->orders()
->withOrderNumber("orderNumber")
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->withOrderNumber("orderNumber")->post(null)</tt>
If the Order exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->orders()
->withOrderNumber("orderNumber")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->orders()->orderQuote()->post(null)</tt>
Creates an Order from a [Quote](ctp:api:type:Cart) in a [BusinessUnit](ctp:api:type:BusinessUnit). Creating an Order fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the Quote does not reference the same BusinessUnit as the businessUnitKey
path parameter.
Specific Error Codes:
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [OutOfStock](ctp:api:type:OutOfStockError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->orders()
->orderQuote()
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quoteRequests()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quoteRequests()
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quoteRequests()->head()</tt>
Checks if a QuoteRequest exists for a given Query Predicate. Returns a 200 OK
status if any QuoteRequests match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quoteRequests()
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quoteRequests()->post(null)</tt>
Creates a QuoteRequest in a [BusinessUnit](ctp:api:type:BusinessUnit). Creating QuoteRequest fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) if the Cart does not reference the same BusinessUnit as the businessUnitKey
path parameter.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quoteRequests()
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quoteRequests()->withId("ID")->get()</tt>
If the QuoteRequest exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quoteRequests()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quoteRequests()->withId("ID")->head()</tt>
Checks if a QuoteRequest exists for a given id
. Returns a 200 OK
status if the QuoteRequest exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quoteRequests()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quoteRequests()->withId("ID")->post(null)</tt>
If the QuoteRequest exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quoteRequests()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quoteRequests()->withKey("key")->get()</tt>
If the QuoteRequest exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quoteRequests()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quoteRequests()->withKey("key")->head()</tt>
Checks if a QuoteRequest exists for a given key
. Returns a 200 OK
status if the QuoteRequest exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quoteRequests()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quoteRequests()->withKey("key")->post(null)</tt>
If the QuoteRequest exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quoteRequests()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quotes()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quotes()
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quotes()->head()</tt>
Checks if a Quote exists for a given Query Predicate. Returns a 200 OK
status if any Quotes match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quotes()
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quotes()->withId("ID")->get()</tt>
If the Quote exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quotes()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quotes()->withId("ID")->head()</tt>
Checks if a Quote exists for a given id
. Returns a 200 OK
status if the Quote exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quotes()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quotes()->withId("ID")->post(null)</tt>
If the Quote exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quotes()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quotes()->withKey("key")->get()</tt>
If the Quote exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quotes()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quotes()->withKey("key")->head()</tt>
Checks if a Quote exists for a given key
. Returns a 200 OK
status if the Quote exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quotes()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->quotes()->withKey("key")->post(null)</tt>
If the Quote exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->quotes()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->associateRoles()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->get();
<tt>withProjectKey("projectKey")->associateRoles()->head()</tt>
Checks if an AssociateRole exists for a given Query Predicate. Returns a 200 OK
status if any AssociateRole match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->head();
<tt>withProjectKey("projectKey")->associateRoles()->post(null)</tt>
Creating a Associate Role generates the [AssociateRoleCreated](ctp:api:type:AssociateRoleCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->post(null);
<tt>withProjectKey("projectKey")->associateRoles()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->associateRoles()->withId("ID")->head()</tt>
Checks if an AssociateRole exists for a given id
. Returns a 200 OK
status if the AssociateRole exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->associateRoles()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->associateRoles()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->associateRoles()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->associateRoles()->withKey("key")->head()</tt>
Checks if an AssociateRole exists for a given key
. Returns a 200 OK
status if the AssociateRole exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->associateRoles()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->associateRoles()->withKey("key")->delete()</tt>
Deleting an AssociateRole generates the [AssociateRoleDeleted](ctp:api:type:AssociateRoleDeletedMessage) Message. An AssociateRole can only be deleted if it is not assigned to any [Associates](ctp:api:type:Associate).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->associateRoles()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->attributeGroups()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->get();
<tt>withProjectKey("projectKey")->attributeGroups()->head()</tt>
Checks if an AttributeGroup exists for a given Query Predicate. Returns 200 OK
status if any AttributeGroups match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->head();
<tt>withProjectKey("projectKey")->attributeGroups()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->post(null);
<tt>withProjectKey("projectKey")->attributeGroups()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->attributeGroups()->withId("ID")->head()</tt>
Checks if an AttributeGroup exists for a given id
. Returns a 200 OK
status if the AttributeGroup exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->attributeGroups()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->attributeGroups()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->attributeGroups()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->attributeGroups()->withKey("key")->head()</tt>
Checks if an AttributeGroup exists for a given key
. Returns 200 OK
status if the AttributeGroup exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->attributeGroups()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->attributeGroups()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->attributeGroups()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->businessUnits()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->get();
<tt>withProjectKey("projectKey")->businessUnits()->head()</tt>
Checks if a BusinessUnit exists for a given Query Predicate. Returns a 200 OK
status if any BusinessUnits match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->head();
<tt>withProjectKey("projectKey")->businessUnits()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->post(null);
<tt>withProjectKey("projectKey")->businessUnits()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->businessUnits()->withId("ID")->head()</tt>
Checks if a BusinessUnit exists for a given id
. Returns a 200 OK
status if the BusinessUnit exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->businessUnits()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->businessUnits()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->businessUnits()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->businessUnits()->withKey("key")->head()</tt>
Checks if a BusinessUnit exists for a given key
. Returns a 200 OK
status if the BusinessUnit exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->businessUnits()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->businessUnits()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->cartDiscounts()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->get();
<tt>withProjectKey("projectKey")->cartDiscounts()->head()</tt>
Checks if a CartDiscount exists for a given Query Predicate. Returns a 200 OK
status if any CartDiscounts match the Query Predicate, or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->head();
<tt>withProjectKey("projectKey")->cartDiscounts()->post(null)</tt>
Creating a Cart Discount produces the [CartDiscountCreated](ctp:api:type:CartDiscountCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->post(null);
<tt>withProjectKey("projectKey")->cartDiscounts()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->cartDiscounts()->withId("ID")->head()</tt>
Checks if a CartDiscount exists for a given id
. Returns a 200 OK
status if the CartDiscount exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->cartDiscounts()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->cartDiscounts()->withId("ID")->delete()</tt>
Deleting a Cart Discount produces the [CartDiscountDeleted](ctp:api:type:CartDiscountDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->cartDiscounts()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->cartDiscounts()->withKey("key")->head()</tt>
Checks if a CartDiscount exists for a given key
. Returns a 200 OK
status if the CartDiscount exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->cartDiscounts()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->cartDiscounts()->withKey("key")->delete()</tt>
Deleting a Cart Discount produces the [CartDiscountDeleted](ctp:api:type:CartDiscountDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->cartDiscounts()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->carts()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->get();
<tt>withProjectKey("projectKey")->carts()->head()</tt>
Checks if a Cart exists for a given Query Predicate. Returns a 200 OK
status if any Carts match the Query Predicate, or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->head();
<tt>withProjectKey("projectKey")->carts()->post(null)</tt>
If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, or if the Shipping Method is not active, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.
Specific Error Codes:
- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->post(null);
<tt>withProjectKey("projectKey")->carts()->withId("ID")->get()</tt>
To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->carts()->withId("ID")->head()</tt>
Checks if a Cart exists for a given id
. Returns a 200 OK
status if the Cart exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->carts()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->carts()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->carts()->withCustomerId("customerId")->get()</tt>
Retrieves the most recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) Customer
. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withCustomerId("customerId")
->get();
<tt>withProjectKey("projectKey")->carts()->withCustomerId("customerId")->head()</tt>
Checks if a Cart of a Customer exists. Returns a 200 OK
status if the Cart exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withCustomerId("customerId")
->head();
<tt>withProjectKey("projectKey")->carts()->withKey("key")->get()</tt>
To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->carts()->withKey("key")->head()</tt>
Checks if a Cart exists for a given key
. Returns a 200 OK
status if the Cart exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->carts()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->carts()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->carts()->replicate()->post(null)</tt>
Creates a new Cart by replicating an existing Cart or Order. Can be useful in cases where a customer wants to cancel a recent order to make some changes or reorder a previous order.
The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in Active
[CartState](ctp:api:type:CartState).
The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to initial
.
Specific Error Codes:
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->replicate()
->post(null);
<tt>withProjectKey("projectKey")->categories()->get()</tt>
Either the scope view_products:{projectKey}
or view_categories:{projectKey}
is required.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->get();
<tt>withProjectKey("projectKey")->categories()->head()</tt>
Checks if a Category exists for on a given Query Predicate. Returns a 200 OK
status if any Categories match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->head();
<tt>withProjectKey("projectKey")->categories()->post(null)</tt>
Either the scope manage_products:{projectKey}
or manage_categories:{projectKey}
is required.
Creating a Category produces the [CategoryCreated](ctp:api:type:CategoryCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->post(null);
<tt>withProjectKey("projectKey")->categories()->withId("ID")->get()</tt>
Either the scope view_products:{projectKey}
or view_categories:{projectKey}
is required.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->categories()->withId("ID")->head()</tt>
Checks if a Category exists for a given id
. Returns a 200 OK
status if the Category exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->categories()->withId("ID")->post(null)</tt>
Either the scope manage_products:{projectKey}
or manage_categories:{projectKey}
is required.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->categories()->withId("ID")->delete()</tt>
Either the scope manage_products:{projectKey}
or manage_categories:{projectKey}
is required.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->categories()->withKey("key")->get()</tt>
Either the scope view_products:{projectKey}
or view_categories:{projectKey}
is required.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->categories()->withKey("key")->head()</tt>
Checks if a Category exists for a given key
. Returns a 200 OK
status if the Category exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->categories()->withKey("key")->post(null)</tt>
Either the scope manage_products:{projectKey}
or manage_categories:{projectKey}
is required.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->categories()->withKey("key")->delete()</tt>
Either the scope manage_products:{projectKey}
or manage_categories:{projectKey}
is required.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->categories()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->channels()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->channels()
->get();
<tt>withProjectKey("projectKey")->channels()->head()</tt>
Checks if a Channel exists for a given Query Predicate. Returns a 200 OK
status if any Channels match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->channels()
->head();
<tt>withProjectKey("projectKey")->channels()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->channels()
->post(null);
<tt>withProjectKey("projectKey")->channels()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->channels()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->channels()->withId("ID")->head()</tt>
Checks if a Channel exists for a given id
. Returns a 200 OK
status if the Channel exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->channels()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->channels()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->channels()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->channels()->withId("ID")->delete()</tt>
Returns a [ReferenceExists](ctp:api:type:ReferenceExistsError) error if other resources reference the Channel to be deleted.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->channels()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->customObjects()->get()</tt>
For performance reasons, it is highly advisable to query for Custom Objects in a container by using the container
field in the where
predicate.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customObjects()
->get();
<tt>withProjectKey("projectKey")->customObjects()->head()</tt>
Checks if a CustomObject exists for a given Query Predicate. Returns a 200 OK
status if any CustomObjects match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customObjects()
->head();
<tt>withProjectKey("projectKey")->customObjects()->post(null)</tt>
If an object with the given container/key exists, the object will be replaced with the new value and the version is incremented. If the request contains a version and an object with the given container/key, then the version must match the version of the existing object. Concurrent updates to the same Custom Object returns a [ConcurrentModification](ctp:api:type:ConcurrentModificationError) error even if the version is not provided.
Fields within value
that have null
values are not saved.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customObjects()
->post(null);
<tt>withProjectKey("projectKey")->customObjects()->withContainer("container")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customObjects()
->withContainer("container")
->get();
<tt>withProjectKey("projectKey")->customObjects()->withContainerAndKey("container", "key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customObjects()
->withContainerAndKey("container", "key")
->get();
<tt>withProjectKey("projectKey")->customObjects()->withContainerAndKey("container", "key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customObjects()
->withContainerAndKey("container", "key")
->delete();
<tt>withProjectKey("projectKey")->customerGroups()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->get();
<tt>withProjectKey("projectKey")->customerGroups()->head()</tt>
Checks if a CustomerGroup exists for a given Query Predicate. Returns a 200 OK
status if any CustomerGroup match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->head();
<tt>withProjectKey("projectKey")->customerGroups()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->post(null);
<tt>withProjectKey("projectKey")->customerGroups()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->customerGroups()->withId("ID")->head()</tt>
Checks if a CustomerGroup exists for a given id
. Returns a 200 OK
status if the CustomerGroup exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->customerGroups()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->customerGroups()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->customerGroups()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->customerGroups()->withKey("key")->head()</tt>
Checks if a CustomerGroup exists for a given key
. Returns a 200 OK
status if the CustomerGroup exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->customerGroups()->withKey("key")->post(null)</tt>
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->customerGroups()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customerGroups()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->customers()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->get();
<tt>withProjectKey("projectKey")->customers()->head()</tt>
Checks if a Customer exists for a given Query Predicate. Returns a 200 OK
status if any Customers match the Query Predicate, or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->head();
<tt>withProjectKey("projectKey")->customers()->post(null)</tt>
If the anonymousCart
field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). Similarly, if the anonymousId
field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same anonymousId
.
Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. Simultaneously creating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->post(null);
<tt>withProjectKey("projectKey")->customers()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->customers()->withId("ID")->head()</tt>
Checks if a Customer exists for a given id
. Returns a 200 OK
status if the Customer exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->customers()->withId("ID")->post(null)</tt>
Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->customers()->withId("ID")->delete()</tt>
Deleting a Customer produces the [CustomerDeleted](ctp:api:type:CustomerDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->customers()->emailConfirm()->post(null)</tt>
Verifying the email of the Customer produces the [CustomerEmailVerified](ctp:api:type:CustomerEmailVerifiedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->emailConfirm()
->post(null);
<tt>withProjectKey("projectKey")->customers()->emailToken()->post(null)</tt>
Produces the [CustomerEmailTokenCreated](ctp:api:type:CustomerEmailTokenCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->emailToken()
->post(null);
<tt>withProjectKey("projectKey")->customers()->withEmailToken("emailToken")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withEmailToken("emailToken")
->get();
<tt>withProjectKey("projectKey")->customers()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->customers()->withKey("key")->head()</tt>
Checks if a Customer exists for a given key
. Returns a 200 OK
status if the Customer exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->customers()->withKey("key")->post(null)</tt>
Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->customers()->withKey("key")->delete()</tt>
Deleting a Customer produces the [CustomerDeleted](ctp:api:type:CustomerDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->customers()->password()->post(null)</tt>
Changing the password produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with reset=false
.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->password()
->post(null);
<tt>withProjectKey("projectKey")->customers()->passwordReset()->post(null)</tt>
Resetting the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with reset=true
.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->passwordReset()
->post(null);
<tt>withProjectKey("projectKey")->customers()->passwordToken()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->passwordToken()
->post(null);
<tt>withProjectKey("projectKey")->customers()->withPasswordToken("passwordToken")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withPasswordToken("passwordToken")
->get();
<tt>withProjectKey("projectKey")->customers()->search()->post(null)</tt>
A [SearchNotReady](ctp:api:type:SearchNotReadyError) error is returned if the indexing is in progress or the feature is deactivated. If deactivated, you can reactivate it.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->search()
->post(null);
<tt>withProjectKey("projectKey")->customers()->search()->head()</tt>
Checks whether a search index of Customers exists for a Project. If an index exists, a 200 OK
is returned; otherwise, a 409 Conflict
.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->search()
->head();
<tt>withProjectKey("projectKey")->customers()->searchIndexingStatus()->get()</tt>
Returns the indexing status of the Customer Search for a Project.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->searchIndexingStatus()
->get();
<tt>withProjectKey("projectKey")->discountCodes()->get()</tt>
Deprecated OAuth 2.0 Scope: view_orders:{projectKey}
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->get();
<tt>withProjectKey("projectKey")->discountCodes()->head()</tt>
Checks if a DiscountCode exists for a given Query Predicate. Returns a 200 OK
status if any DiscountCodes match the Query Predicate, or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->head();
<tt>withProjectKey("projectKey")->discountCodes()->post(null)</tt>
Creating a Discount Code produces the [DiscountCodeCreated](ctp:api:type:DiscountCodeCreatedMessage) Message.
Deprecated OAuth 2.0 Scope: manage_orders:{projectKey}
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->post(null);
<tt>withProjectKey("projectKey")->discountCodes()->withId("ID")->get()</tt>
Deprecated OAuth 2.0 Scope: view_orders:{projectKey}
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->discountCodes()->withId("ID")->head()</tt>
Checks if a DiscountCode exists for a given id
. Returns a 200 OK
status if the DiscountCode exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->discountCodes()->withId("ID")->post(null)</tt>
Deprecated OAuth 2.0 Scope: manage_orders:{projectKey}
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->discountCodes()->withId("ID")->delete()</tt>
Deleting a Discount Code produces the [DiscountCodeDeleted](ctp:api:type:DiscountCodeDeletedMessage) Message.
Deprecated OAuth 2.0 Scope: manage_orders:{projectKey}
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->discountCodes()->withKey("key")->get()</tt>
Deprecated OAuth 2.0 Scope: view_orders:{projectKey}
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->discountCodes()->withKey("key")->head()</tt>
Checks if a DiscountCode exists for a given key
. Returns a 200 OK
status if the DiscountCode exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->discountCodes()->withKey("key")->post(null)</tt>
Deprecated OAuth 2.0 Scope: manage_orders:{projectKey}
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->discountCodes()->withKey("key")->delete()</tt>
Deleting a Discount Code produces the [DiscountCodeDeleted](ctp:api:type:DiscountCodeDeletedMessage) Message.
Deprecated OAuth 2.0 Scope: manage_orders:{projectKey}
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountCodes()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->extensions()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->get();
<tt>withProjectKey("projectKey")->extensions()->head()</tt>
Checks if an Extension exists for a given Query Predicate. Returns a 200 OK
status if any Extensions match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->head();
<tt>withProjectKey("projectKey")->extensions()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->post(null);
<tt>withProjectKey("projectKey")->extensions()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->extensions()->withId("ID")->head()</tt>
Checks if an Extension exists for a given id
. Returns a 200 OK
status if the Extension exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->extensions()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->extensions()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->extensions()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->extensions()->withKey("key")->head()</tt>
Checks if an Extension exists for a given key
. Returns a 200 OK
status if the Extension exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->extensions()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->extensions()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->extensions()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->graphql()->post(null)</tt>
Execute a GraphQL query
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->graphql()
->post(null);
<tt>withProjectKey("projectKey")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->me()->customers()->post(null)</tt>
The My Business Unit endpoint does not support assigning existing Customers to a Business Unit. Associates with the UpdateAssociates
[Permission](ctp:api:type:Permission) can use this endpoint to create a new Customer and associate it with the Business Unit. If the required Permission is missing, an AssociateMissingPermission error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->me()
->customers()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->head()</tt>
Checks if a CartDiscount exists for a given Query Predicate. Returns a 200 OK
status if any CartDiscounts match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->post(null)</tt>
When using the endpoint, the Store specified in the path and the Stores specified in the payload's stores
field are added to the CartDiscount.
Creating a Cart Discount produces the [CartDiscountCreated](ctp:api:type:CartDiscountCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withId("ID")->get()</tt>
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withId("ID")->head()</tt>
Checks if a CartDiscount exists for a given id
. Returns a 200 OK
status if the CartDiscount exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withId("ID")->post(null)</tt>
To update a CartDiscount, you must have permissions for all Stores the CartDiscount is associated with, except when [removing a Store](ctp:api:type:CartDiscountRemoveStoreAction).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withId("ID")->delete()</tt>
To delete a CartDiscount, specify the manage_cart_discounts:{projectKey}:{storeKey}
scope for all Stores associated with the CartDiscount.
Deleting a Cart Discount produces the [CartDiscountDeleted](ctp:api:type:CartDiscountDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withKey("key")->head()</tt>
Checks if a CartDiscount exists for a given key
. Returns a 200 OK
status if the CartDiscount exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withKey("key")->post(null)</tt>
To update a CartDiscount, you must have permissions for all Stores the CartDiscount is associated with, except when [removing a Store](ctp:api:type:CartDiscountRemoveStoreAction).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withKey("key")->delete()</tt>
To delete a CartDiscount, specify the manage_cart_discounts:{projectKey}:{storeKey}
scope for all Stores associated with the CartDiscount.
Deleting a Cart Discount produces the [CartDiscountDeleted](ctp:api:type:CartDiscountDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->cartDiscounts()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->get()</tt>
Queries Carts in a specific [Store](ctp:api:type:Store).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->head()</tt>
Checks if a Cart exists for a given Query Predicate. Returns a 200 OK
status if any Carts match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->post(null)</tt>
Creates a [Cart](ctp:api:type:Cart) in the [Store](ctp:api:type:Store) specified by storeKey
.
If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, or if the Shipping Method is not active, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.
Specific Error Codes:
- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withId("ID")->get()</tt>
If the Cart exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withId("ID")->head()</tt>
Checks if a Cart exists for a given id
. Returns a 200 OK
status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withId("ID")->post(null)</tt>
Updates a [Cart](ctp:api:type:Cart) in the [Store](ctp:api:type:Store) specified by storeKey
. If the Cart exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withId("ID")->delete()</tt>
If the Cart exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withCustomerId("customerId")->get()</tt>
Retrieves the most recently modified [active Cart](ctp:api:type:CartState) of a Customer with [CartOrigin](ctp:api:type:CartOrigin) Customer
. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
If the Cart exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->withCustomerId("customerId")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withCustomerId("customerId")->head()</tt>
Checks if a Cart of a Customer exists. Returns a 200 OK
status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->withCustomerId("customerId")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withKey("key")->get()</tt>
If the Cart exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withKey("key")->head()</tt>
Checks if a Cart exists for a given key
. Returns a 200 OK
status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withKey("key")->post(null)</tt>
If the Cart exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withKey("key")->delete()</tt>
If the Cart exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->replicate()->post(null)</tt>
Creates a new Cart by replicating an existing Cart or Order. Can be useful in cases where a customer wants to cancel a recent order to make some changes or reorder a previous order.
The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in Active
[CartState](ctp:api:type:CartState).
The new Cart does not contain payments or deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to initial
.
Specific Error Codes:
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->carts()
->replicate()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->head()</tt>
Checks if a Customer exists for a given Query Predicate. Returns a 200 OK
status if any Customers match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->post(null)</tt>
When using this endpoint, if omitted, the Customer stores
field is set to the [Store](ctp:api:type:Store) specified in the path parameter.
If the anonymousCart
field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). Similarly, if the anonymousId
field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same anonymousId
. If a Cart with a store
field specified, the store
field must reference the same [Store](ctp:api:type:Store) specified in the {storeKey}
path parameter.
Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. Simultaneously creating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withId("ID")->get()</tt>
If the Customer exists in the Project but the stores
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withId("ID")->head()</tt>
Checks if a Customer exists for a given id
. Returns a 200 OK
status if the Customer exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withId("ID")->post(null)</tt>
If the Customer exists in the Project but the stores
field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withId("ID")->delete()</tt>
Deleting a Customer produces the [CustomerDeleted](ctp:api:type:CustomerDeletedMessage) Message.
If the Customer exists in the Project but the stores
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->emailConfirm()->post(null)</tt>
The customer verifies the email using the token value. Verifying the email of the Customer produces the [CustomerEmailVerified](ctp:api:type:CustomerEmailVerifiedMessage) Message.
If the Customer exists in the Project but the stores
field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->emailConfirm()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->emailToken()->post(null)</tt>
If the Customer exists in the Project but the stores
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->emailToken()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withEmailToken("emailToken")->get()</tt>
If the Customer exists in the Project but the stores
field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->withEmailToken("emailToken")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withKey("key")->get()</tt>
If the Customer exists in the Project but the stores
field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withKey("key")->head()</tt>
Checks if a Customer exists for a given key
. Returns a 200 OK
status if the Customer exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withKey("key")->post(null)</tt>
If the Customer exists in the Project but the stores
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Simultaneously updating two Customers with the same email address can return a [LockedField](ctp:api:type:LockedFieldError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withKey("key")->delete()</tt>
Deleting a Customer produces the [CustomerDeleted](ctp:api:type:CustomerDeletedMessage) Message.
If the Customer exists in the Project but the stores
field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->password()->post(null)</tt>
Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with reset=false
.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->password()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->passwordReset()->post(null)</tt>
Resetting the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with reset=true
.
If the Customer exists in the Project but the stores
field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->passwordReset()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->passwordToken()->post(null)</tt>
If the Customer exists in the Project but the stores
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->passwordToken()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withPasswordToken("passwordToken")->get()</tt>
If the Customer exists in the Project but the stores
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->withPasswordToken("passwordToken")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->login()->post(null)</tt>
Authenticates a Customer associated with a [Store](ctp:api:type:Store). For more information, see Global versus Store-specific Customers.
A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is updated with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError).
Triggers Cart merge during sign-in.
If the Customer exists in the Project but the stores
field references a different [Store](ctp:api:type:Store), this method returns an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->login()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->get()</tt>
Returns a Customer for a given Query Predicate in a [Store](ctp:api:type:Store). Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Customer exists in the Store for the given Query Predicate.
- If a Customer exists in the Store for the given Query Predicate, but does not have an
id
value that matches the customer:{id} scope.
- If a Customer exists for the given Query Predicate but is associated with a different Store than what is specified in the
manage_my_profile:{projectKey}:{storeKey}
scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->post(null)</tt>
Updates the Customer in a [Store](ctp:api:type:Store). Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Customer exists with the
id
specified in the customer:{id} scope.
- If the Customer exists but is associated with a different Store than what is specified in the
manage_my_profile:{projectKey}:{storeKey}
scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->delete()</tt>
Deletes the Customer in a [Store](ctp:api:type:Store). Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Customer exists with the
id
specified in the customer:{id} scope.
- If the Customer exists but is associated with a different Store than what is specified in the
manage_my_profile:{projectKey}:{storeKey}
scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->activeCart()->get()</tt>
Retrieves the Customer's most recently modified [active Cart](ctp:api:type:CartState) in a Store. Returns a 200 OK
status if successful.
Carts with Merchant
or Quote
[CartOrigin](ctp:api:type:CartOrigin) are ignored.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no active Cart exists.
- If an active Cart exists but does not have a
store
specified, or the store
field references a different Store.
- If an active Cart exists but does not have a
customerId
that matches the customer:{id} scope, or anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->activeCart()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->activeCart()->head()</tt>
Checks if an active Cart exists in a Store. Returns 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no active Cart exists in a Store.
- If an active Cart exists but does not have a
store
specified, or the store
field references a different Store.
- If an active Cart exists but does not contain a
customerId
that matches the customer:{id} scope, or anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->activeCart()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->carts()->get()</tt>
Returns all Carts that match a given Query Predicate and contain either a matching customerId
or anonymousId
in a Store.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->carts()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->carts()->head()</tt>
Checks if a Cart exists for a Store that matches the given Query Predicate, and contains a matching customerId
or anonymousId
. Returns a 200 OK
status if any Carts match these conditions, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->carts()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->carts()->post(null)</tt>
Creates a Cart in a Store for the Customer or anonymous user. The customerId
or anonymousId
field on the Cart is automatically set based on the customer:{id} or anonymous_id:{id} scope.
The store
field in the created [Cart](ctp:api:type:Cart) is set to the Store specified by the storeKey
path parameter.
Specific Error Codes:
- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError)
- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->carts()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->carts()->withId("ID")->get()</tt>
Returns a Cart for a given id
in a Store. Returns a 200 OK
status if the Cart exists.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Cart exists in the Store for the given
id
.
- If the Cart exists but does not belong to a Store, or the Cart's
store
field references a different Store.
- If the Cart exists but does not have either a
customerId
that matches the customer:{id} scope, or an anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->carts()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->carts()->withId("ID")->head()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->carts()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->carts()->withId("ID")->post(null)</tt>
Updates the Cart for a given id
in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Cart exists in the Store for the given
id
.
- If the Cart exists but does not belong to a Store, or the Cart's
store
field references a different Store.
- If the Cart exists but does not have either a
customerId
that matches the customer:{id} scope, or an anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->carts()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->carts()->withId("ID")->delete()</tt>
Deletes the Cart for a given id
in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Cart exists in the Store for the given
id
.
- If the Cart exists in the Project but does not belong to a Store, or the Cart's
store
field references a different Store.
- If the Cart exists in the Project but does not have either a
customerId
that matches the customer:{id} scope, or an anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->carts()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->emailConfirm()->post(null)</tt>
This is the last step in the email verification process of a Customer. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Customer exists with the
id
specified in the customer:{id} scope.
- If the Customer exists but is associated with a different Store than what is specified in the
manage_my_profile:{projectKey}:{storeKey}
scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->emailConfirm()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->login()->post(null)</tt>
Retrieves the authenticated Customer (that matches the given email/password pair) if they are part of a specific [Store](ctp:api:type:Store).
If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the anonymousId
are assigned to the newly logged-in Customer.
- If the Customer does not have a Cart, the most recently modified anonymous cart becomes the Customer's Cart.
- If the Customer already has a Cart, the most recently modified anonymous cart is handled according to [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode).
A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is updated with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError).
If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->login()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->orders()->get()</tt>
Returns all Orders in a Store that match a given Query Predicate and contain either a customerId
that matches the customer_id:{id} scope, or an anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->orders()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->orders()->head()</tt>
Checks if an Order exists for a given Query Predicate in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Orders exist in the Store that match the Query Predicate.
- If an Order matches the Query Predicate, but no
store
is specified, or the store
field references a different Store.
- If an Order matches the Query Predicate, but does not have a
customerId
that matches the customer:{id} scope, or an anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->orders()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->orders()->post(null)</tt>
Creates an Order in a Store from a Cart for the Customer or anonymous user. The customerId
or anonymousId
field on the Order is automatically set based on the customer:{id} or anonymous_id:{id} scope.
The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating B2B Orders, the Customer must have the CreateMyOrdersFromMyCarts
[Permission](ctp:api:type:Permission).
If the Cart's customerId
does not match the customer:{id} scope, or the anonymousId
does not match the anonymous_id:{id} scope, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned.
Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message.
Specific Error Codes:
- [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError)
- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError)
- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
- [OutOfStock](ctp:api:type:OutOfStockError)
- [PriceChanged](ctp:api:type:PriceChangedError)
- [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->orders()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->orders()->withId("ID")->get()</tt>
Returns an Order for a given id
in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Order exists in the Store for the given
id
.
- If the Order exists but does not have a
store
specified, or the store
field references a different Store.
- If the Order exists but does not have a
customerId
that matches the customer:{id} scope, or anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->orders()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->orders()->withId("ID")->head()</tt>
Checks if an Order exists for a given id
in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Order exists in the Store for the given
id
.
- If the Order exists but does not have a
store
specified, or the store
field references a different Store.
- If the Order exists but does not have a
customerId
that matches the customer:{id} scope, or anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->orders()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->password()->post(null)</tt>
Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with reset=false
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Customer exists with the
id
specified in the customer:{id} scope.
- If the Customer exists but is associated with a different Store than what is specified in the
manage_my_profile:{projectKey}:{storeKey}
scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->password()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->password()->reset()->post(null)</tt>
This is the last step in the password reset process of the authenticated Customer.
Resetting a password produces the Customer [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with reset=true
.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Customer exists with the
id
specified in the customer:{id} scope.
- If the Customer exists but is associated with a different Store than what is specified in the
manage_my_profile:{projectKey}:{storeKey}
scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->password()
->reset()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->get()</tt>
Returns ShoppingLists that match the given Query Predicate in a Store. Returns 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingLists exist in a Store.
- If a ShoppingList exists but does not have a
store
specified, or the store
field references a different Store.
- If a ShoppingList exists in a Store but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->head()</tt>
Checks if a ShoppingList exists for the given Query Predicate in a Store. Returns 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingLists exist for a given Query Predicate in a Store.
- If a ShoppingList matches the Query Predicate but does not have a
store
specified, or the store
field references a different Store.
- If a ShoppingList exists in a Store but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->post(null)</tt>
Creates a ShoppingList in a Store for a Customer or anonymous user. The customer
or anonymousId
field on the ShoppingList is automatically set based on the given customer:{id} or anonymous_id:{id} scope.
When using this endpoint, the store
field of a ShoppingList is always set to the [Store](ctp:api:type:Store) specified in the path parameter.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withId("ID")->get()</tt>
Returns a ShoppingList for a given id
in a Store. Returns 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList matches the given
id
in a Store.
- If a ShoppingList matches the given
id
but does not have a store
specified, or the store
field references a different Store.
- If a ShoppingList matches the given
id
in a Store but does not contain either an anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withId("ID")->head()</tt>
Checks if a ShoppingList exists for a given id
in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList matches the given
id
in a Store.
- If a ShoppingList matches the given
id
but does not have a store
specified, or the store
field references a different Store.
- If a ShoppingList matches the given
id
in a Store but does not contain either an anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withId("ID")->post(null)</tt>
Updates a ShoppingList for a given id
in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList matches the given
id
in a Store.
- If a ShoppingList matches the given
id
but does not have a store
specified, or the store
field references a different Store.
- If a ShoppingList matches the given
id
in a Store but does not contain either an anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withId("ID")->delete()</tt>
Deletes the ShoppingList for a given id
in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList matches the given
id
in a Store.
- If a ShoppingList matches the given
id
but does not have a store
specified, or the store
field references a different Store.
- If a ShoppingList matches the given
id
in a Store but does not contain either an anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withKey("key")->get()</tt>
Returns a ShoppingList for a given key
in a Store. Returns 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList matches the given
key
in a Store.
- If a ShoppingList matches the given
key
but does not have a store
specified, or the store
field references a different Store.
- If a ShoppingList matches the given
key
in a Store but does not contain either an anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withKey("key")->head()</tt>
Checks if a ShoppingList exists for a given key
in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists that matches the given
key
in a Store.
- If a ShoppingList matches the given
key
but does not have a store
specified, or the store
field references a different Store.
- If a ShoppingList matches the given
key
in a Store but does not contain either an anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withKey("key")->post(null)</tt>
Updates a ShoppingList for a given key
in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList matches the given
key
in a Store.
- If a ShoppingList matches the given
key
but does not have a store
specified, or the store
field references a different Store.
- If a ShoppingList matches the given
key
in a Store but does not contain either an anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withKey("key")->delete()</tt>
Deletes the ShoppingList for a given key
in a Store. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList matches the given
key
in a Store.
- If a ShoppingList matches the given
key
but does not have a store
specified, or the store
field references a different Store.
- If a ShoppingList matches the given
key
in a Store but does not contain either an anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->shoppingLists()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->signup()->post(null)</tt>
If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the anonymousId
are assigned to the newly created Customer.
If omitted in the request body, the [Customer](ctp:api:type:Customer) stores
field is set to the [Store](ctp:api:type:Store) specified in the path parameter.
A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is updated with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError).
Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->me()
->signup()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->head()</tt>
Checks if an Order exists for a given Query Predicate. Returns a 200 OK
status if any Orders match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->post(null)</tt>
Before you create an Order, the Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction). The shipping address is used for tax calculation for a Cart with Platform
[TaxMode](ctp:api:type:TaxMode).
Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number.
Specific Error Codes:
- [OutOfStock](ctp:api:type:OutOfStockError)
- [PriceChanged](ctp:api:type:PriceChangedError)
- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
- [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [InvalidOperation](ctp:api:type:InvalidOperationError)
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withId("ID")->get()</tt>
If the Order exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withId("ID")->head()</tt>
Checks if an Order exists for a given id
. Returns a 200 OK
status if the Order exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withId("ID")->post(null)</tt>
If the Order exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withId("ID")->delete()</tt>
If the Order exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withOrderNumber("orderNumber")->get()</tt>
If the Order exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->withOrderNumber("orderNumber")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withOrderNumber("orderNumber")->head()</tt>
Checks if an Order exists for a given orderNumber
. Returns a 200 OK
status if the Order exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->withOrderNumber("orderNumber")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withOrderNumber("orderNumber")->post(null)</tt>
If the Order exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->withOrderNumber("orderNumber")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withOrderNumber("orderNumber")->delete()</tt>
If the Order exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->withOrderNumber("orderNumber")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->orderQuote()->post(null)</tt>
Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message.
Specific Error Codes:
- [OutOfStock](ctp:api:type:OutOfStockError)
- [PriceChanged](ctp:api:type:PriceChangedError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [InvalidOperation](ctp:api:type:InvalidOperationError)
- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->orderQuote()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productProjections()->withId("ID")->get()</tt>
Gets the current or staged representation of a [Product](ctp:api:type:Product) by its ID in the specified [Store](ctp:api:type:Store). If the Store has defined some languages, countries, distribution, supply Channels, and/or Product Selection, they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices), and [inventory](ctp:api:type:ProductProjectionInventoryEntries).
If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the availability of the Product in the specified Store.
When used with an API Client that has the view_published_products:{projectKey}
scope, this endpoint only returns published (current) Product Projections.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->productProjections()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productProjections()->withId("ID")->head()</tt>
Checks if the current or staged representations of a Product exists for a given id
in the specified [Store](ctp:api:type:Store). Returns a 200 OK
status if the ProductProjection exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->productProjections()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productProjections()->withKey("key")->get()</tt>
Gets the current or staged representation of a [Product](ctp:api:type:Product) by its key in the specified [Store](ctp:api:type:Store). If the Store has defined some languages, countries, distribution, supply Channels, and/or Product Selection, they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices), and [inventory](ctp:api:type:ProductProjectionInventoryEntries).
If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the availability of the Product in the specified Store.
When used with an API Client that has the view_published_products:{projectKey}
scope, this endpoint only returns published (current) Product Projections.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->productProjections()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productProjections()->withKey("key")->head()</tt>
Checks if the current or staged representations of a Product exists for a given key
in the specified [Store](ctp:api:type:Store). Returns a 200 OK
status if the ProductProjection exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->productProjections()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productSelectionAssignments()->get()</tt>
Queries Product Selection assignments in a specific [Store](ctp:api:type:Store).
The response will include duplicate Products whenever more than one active Product Selection of the Store includes a Product. To make clear through which Product Selection a Product is available in the Store the response contains assignments including both the Product and the Product Selection. Only Products of Product Selections that are activated in the Store will be returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->productSelectionAssignments()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productTailoring()->get()</tt>
Queries Product Tailoring in a specific [Store](ctp:api:type:Store).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->productTailoring()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productTailoring()->post(null)</tt>
Creates a [ProductTailoring](ctp:api:type:ProductTailoring) in the [Store](ctp:api:type:Store) specified by storeKey
. When using this endpoint the ProductTailoring's store
field is always set to the [Store](ctp:api:type:Store) specified in the path parameter.
Generates the [ProductTailoringCreated](ctp:api:type:ProductTailoringCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->productTailoring()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->products()->withProductId("productID")->productTailoring()->get()</tt>
Gets the current or staged representation of a [Product Tailoring](ctp:api:type:ProductTailoring) by its Product ID in the specified [Store](ctp:api:type:Store).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->products()
->withProductId("productID")
->productTailoring()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->products()->withProductId("productID")->productTailoring()->post(null)</tt>
Updates the current or staged representation of a [Product Tailoring](ctp:api:type:ProductTailoring) by its Product ID in the specified [Store](ctp:api:type:Store).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->products()
->withProductId("productID")
->productTailoring()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->products()->withProductId("productID")->productTailoring()->delete()</tt>
Generates the [ProductTailoringDeleted](ctp:api:type:ProductTailoringDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->products()
->withProductId("productID")
->productTailoring()
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->products()->withProductId("productID")->productTailoring()->images()->post(null)</tt>
Uploads a JPEG, PNG and GIF file to a [ProductVariantTailoring](ctp:api:type:ProductVariantTailoring). The maximum file size of the image is 10MB. Either variant
or sku
is required to update a specific ProductVariant. If neither is provided, the image is uploaded to the Master Variant of the Product.
The response status code depends on the size of the original image. If the image is small, the API responds with 200 OK
, and if the image is larger, it responds with 202 Accepted
. The Product returned with a 202 Accepted
status code contains a warnings
field with an [ImageProcessingOngoing](ctp:api:type:ImageProcessingOngoingWarning) Warning.
Produces the ProductTailoringImageAdded Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->products()
->withProductId("productID")
->productTailoring()
->images()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->products()->withProductKey("productKey")->productTailoring()->get()</tt>
Gets the current or staged representation of a [Product Tailoring](ctp:api:type:ProductTailoring) by its Product key in the specified [Store](ctp:api:type:Store).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->products()
->withProductKey("productKey")
->productTailoring()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->products()->withProductKey("productKey")->productTailoring()->post(null)</tt>
Updates the current or staged representation of a [Product Tailoring](ctp:api:type:ProductTailoring) by its Product key in the specified [Store](ctp:api:type:Store).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->products()
->withProductKey("productKey")
->productTailoring()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->products()->withProductKey("productKey")->productTailoring()->delete()</tt>
Generates the [ProductTailoringDeleted](ctp:api:type:ProductTailoringDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->products()
->withProductKey("productKey")
->productTailoring()
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->products()->withProductKey("productKey")->productTailoring()->images()->post(null)</tt>
Uploads a JPEG, PNG and GIF file to a [ProductVariantTailoring](ctp:api:type:ProductVariantTailoring). The maximum file size of the image is 10MB. Either variant
or sku
is required to update a specific ProductVariant. If neither is provided, the image is uploaded to the Master Variant of the Product.
The response status code depends on the size of the original image. If the image is small, the API responds with 200 OK
, and if the image is larger, it responds with 202 Accepted
. The Product returned with a 202 Accepted
status code contains a warnings
field with an [ImageProcessingOngoing](ctp:api:type:ImageProcessingOngoingWarning) Warning.
Produces the ProductTailoringImageAdded Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->products()
->withProductKey("productKey")
->productTailoring()
->images()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->head()</tt>
Checks if a QuoteRequest exists for a given Query Predicate. Returns a 200 OK
status if any QuoteRequests match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->post(null)</tt>
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->withId("ID")->head()</tt>
Checks if a QuoteRequest exists for a given id
. Returns a 200 OK
status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->withKey("key")->head()</tt>
Checks if a QuoteRequest exists for a given key
. Returns a 200 OK
status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quoteRequests()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quoteRequests()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->head()</tt>
Checks if a Quote exists for a given Query Predicate. Returns a 200 OK
status if any Quotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->withId("ID")->head()</tt>
Checks if a Quote exists for a given id
. Returns a 200 OK
status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->withKey("key")->head()</tt>
Checks if a Quote exists for a given key
. Returns a 200 OK
status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->quotes()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->quotes()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shippingMethods()->matchingCart()->get()</tt>
Retrieves all the active ShippingMethods that can ship to the shipping address of the given Cart in a given [Store](ctp:api:type:Store). Each ShippingMethod contains exactly one ShippingRate with the flag isMatching
set to true
. This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shippingMethods()
->matchingCart()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shippingMethods()->matchingCart()->head()</tt>
Checks if an active ShippingMethod that can ship to the shipping address of the given Cart exists in the given [Store](ctp:api:type:Store). Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shippingMethods()
->matchingCart()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->head()</tt>
Checks if a ShoppingList exists for a given Query Predicate. Returns a 200 OK
status if any ShoppingLists match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->post(null)</tt>
When using this endpoint, the store
field of a ShoppingList is always set to the [Store](ctp:api:type:Store) specified in the path parameter.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withId("ID")->get()</tt>
If a ShoppingList exists in a Project but does not have the store
field, or the store
field references a different [Store](ctp:api:type:Store), the ResourceNotFound error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withId("ID")->head()</tt>
Checks if a ShoppingList exists for a given id
. Returns a 200 OK
status if the ShoppingList exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withId("ID")->post(null)</tt>
If a ShoppingList exists in a Project but does not have the store
field, or the store
field references a different [Store](ctp:api:type:Store), the ResourceNotFound error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withId("ID")->delete()</tt>
If a ShoppingList exists in a Project but does not have the store
field, or the store
field references a different [Store](ctp:api:type:Store), the ResourceNotFound error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withKey("key")->get()</tt>
If a ShoppingList exists in a Project but does not have the store
field, or the store
field references a different [Store](ctp:api:type:Store), the ResourceNotFound error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withKey("key")->head()</tt>
Checks if a ShoppingList exists for a given key
. Returns a 200 OK
status if the ShoppingList exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withKey("key")->post(null)</tt>
If a ShoppingList exists in a Project but does not have the store
field, or the store
field references a different [Store](ctp:api:type:Store), the ResourceNotFound error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withKey("key")->delete()</tt>
If a ShoppingList exists in a Project but does not have the store
field, or the store
field references a different [Store](ctp:api:type:Store), the ResourceNotFound error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->head()</tt>
Checks if a StagedQuote exists for a given Query Predicate. Returns a 200 OK
status if any StagedQuotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->withId("ID")->head()</tt>
Checks if a StagedQuote exists for a given id
. Returns a 200 OK
status if the StagedQuote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->withKey("key")->head()</tt>
Checks if a StagedQuote exists for a given key
. Returns a 200 OK
status if the StagedQuote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->stagedQuotes()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->stagedQuotes()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->inventory()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->get();
<tt>withProjectKey("projectKey")->inventory()->head()</tt>
Checks if an InventoryEntry exists for a given Query Predicate. Returns a 200 OK
status if any Inventory Entries match the Query Predicate, a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->head();
<tt>withProjectKey("projectKey")->inventory()->post(null)</tt>
Produces the [InventoryEntryCreated](ctp:api:type:InventoryEntryCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->post(null);
<tt>withProjectKey("projectKey")->inventory()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->inventory()->withId("ID")->head()</tt>
Checks if an InventoryEntry exists for a given id
. Returns a 200 OK
status if the InventoryEntry exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->inventory()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->inventory()->withId("ID")->delete()</tt>
Produces the [InventoryEntryDeleted](ctp:api:type:InventoryEntryDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->inventory()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->inventory()->withKey("key")->head()</tt>
Checks if an InventoryEntry exists for a given key
. Returns a 200 OK
status if the InventoryEntry exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->inventory()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->inventory()->withKey("key")->delete()</tt>
Produces the [InventoryEntryDeleted](ctp:api:type:InventoryEntryDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->login()->post(null)</tt>
Authenticates a global Customer not associated with a Store. For more information, see Global versus Store-specific Customers. If the Customer is registered in a Store, use the Authenticate (sign in) Customer in Store method.
Triggers Cart merge during sign-in.
A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is updated with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError).
If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->login()
->post(null);
<tt>withProjectKey("projectKey")->me()->get()</tt>
Returns a Customer for a given Query Predicate. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Customer exists for the given Query Predicate.
- If a Customer exists for the given Query Predicate, but does not have an
id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->get();
<tt>withProjectKey("projectKey")->me()->post(null)</tt>
Updates the Customer specified in the customer:{id} scope. Returns a 200 OK
status if successful.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->post(null);
<tt>withProjectKey("projectKey")->me()->delete()</tt>
Deletes the Customer specified in the customer:{id} scope. Returns a 200 OK
status if successful.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->delete();
<tt>withProjectKey("projectKey")->me()->activeCart()->get()</tt>
Retrieves the Customer's most recently modified [active Cart](ctp:api:type:CartState). Returns a 200 OK
status if successful.
Carts with Merchant
or Quote
[CartOrigin](ctp:api:type:CartOrigin) are ignored.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no active Cart exists.
- If an active Cart exists but does not have a
customerId
that matches the customer:{id} scope, or anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->activeCart()
->get();
<tt>withProjectKey("projectKey")->me()->activeCart()->head()</tt>
Checks if an active Cart exists. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no active Cart exists.
- If an active Cart exists but does not have a
customerId
that matches the customer:{id} scope, or an anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->activeCart()
->head();
<tt>withProjectKey("projectKey")->me()->businessUnits()->get()</tt>
Returns all of the authenticated Customer’s Business Units in a Project. Returns a 200 OK
status if successful, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->businessUnits()
->get();
<tt>withProjectKey("projectKey")->me()->businessUnits()->head()</tt>
Checks if a BusinessUnit exists for a given Query Predicate. Returns a 200 OK
status if any BusinessUnits match the Query Predicate and the Customer has access to them, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->businessUnits()
->head();
<tt>withProjectKey("projectKey")->me()->businessUnits()->post(null)</tt>
Automatically assigns the Associate to the Business Unit in the default [Associate Role](ctp:api:type:AssociateRole) defined in [BusinessUnitConfiguration](ctp:api:type:BusinessUnitConfiguration). If there is no default Associate Role configured, this request fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) error. When creating a Division, the Associate must have the AddChildUnits
[Permission](ctp:api:type:Permission) in the parent unit. If the required Permission is missing, an AssociateMissingPermission error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->businessUnits()
->post(null);
<tt>withProjectKey("projectKey")->me()->businessUnits()->withId("ID")->get()</tt>
Returns a Business Unit for a given id
. Returns a 200 OK
status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->businessUnits()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->me()->businessUnits()->withId("ID")->head()</tt>
Checks if a BusinessUnit exists for a given id
. Returns a 200 OK
status if the BusinessUnit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->businessUnits()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->me()->businessUnits()->withId("ID")->post(null)</tt>
Updates a Business Unit for a given id
. Returns a 200 OK
status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->businessUnits()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->me()->businessUnits()->withKey("key")->get()</tt>
Returns a Business Unit for a given key
. Returns a 200 OK
status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->businessUnits()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->me()->businessUnits()->withKey("key")->head()</tt>
Checks if a BusinessUnit exists for a given key
. Returns a 200 OK
status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->businessUnits()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->me()->businessUnits()->withKey("key")->post(null)</tt>
Updates a Business Unit for a given key
. Returns a 200 OK
status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->businessUnits()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->me()->carts()->get()</tt>
Returns all Carts that match a given Query Predicate and contain either a matching customerId
or anonymousId
.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->carts()
->get();
<tt>withProjectKey("projectKey")->me()->carts()->head()</tt>
Checks if a Cart exists that matches a given Query Predicate and contains either a matching customerId
or anonymousId
. Returns a 200 OK
status if the Cart exists, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->carts()
->head();
<tt>withProjectKey("projectKey")->me()->carts()->post(null)</tt>
Creates a Cart for the Customer or anonymous user. The customerId
or anonymousId
field on the Cart is automatically set based on the customer:{id} or anonymous_id:{id} scope.
Specific Error Codes:
- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->carts()
->post(null);
<tt>withProjectKey("projectKey")->me()->carts()->withId("ID")->get()</tt>
Returns a Cart for a given id
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Cart exists for a given
id
.
- If the Cart exists but does not have a
customerId
that matches the customer:{id} scope, or anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->carts()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->me()->carts()->withId("ID")->head()</tt>
Checks if a Cart exists for a given id
. Returns a 200 OK
status if the Cart exists.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Cart exists for a given
id
.
- If the Cart exists but does not have a
customerId
that matches the customer:{id} scope, or anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->carts()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->me()->carts()->withId("ID")->post(null)</tt>
Updates the Cart for a given id
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Cart exists for a given
id
.
- If the Cart exists but does not have a
customerId
that matches the customer:{id} scope, or anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->carts()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->me()->carts()->withId("ID")->delete()</tt>
Deletes the Cart for a given id
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Cart exists for a given
id
.
- If the Cart exists but does not have a
customerId
that matches the customer:{id} scope, or anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->carts()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->me()->carts()->replicate()->post(null)</tt>
Creates a new Cart by replicating an existing Cart or Order of the authenticated Customer. This can be useful in cases where a customer wants to cancel a recent order to make some changes or reorder a previous order.
The replicated Cart preserves Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the Cart or Order. If the Line Items become invalid, for example, due to removed Products or Prices, they are removed from the new Cart. If the Customer switches to another Customer Group, the new Cart is updated with the new value. It has up-to-date Tax Rates, Prices, and Line Item product data and is in Active
[CartState](ctp:api:type:CartState).
The new Cart does not contain Payments or Deliveries. The [State](ctp:api:type:ItemState) of Line Items and Custom Line Items is reset to initial
.
If the Cart or Order to be replicated does not belong to the authenticated Customer, the API returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error
Specific Error Codes:
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->carts()
->replicate()
->post(null);
<tt>withProjectKey("projectKey")->me()->emailConfirm()->post(null)</tt>
This is the last step in the email verification process of a Customer.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->emailConfirm()
->post(null);
<tt>withProjectKey("projectKey")->me()->login()->post(null)</tt>
Retrieves the authenticated customer (that matches the given email/password pair).
If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the anonymousId
are assigned to the newly logged-in Customer.
- If the Customer does not have a Cart yet, the most recently modified anonymous cart becomes the Customer's Cart.
- If the Customer already has a Cart, the most recently modified anonymous cart is handled in accordance with [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode).
A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is updated with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError).
If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->login()
->post(null);
<tt>withProjectKey("projectKey")->me()->orders()->get()</tt>
Returns all Orders that match a given Query Predicate.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Orders exist for a given Query Predicate.
- If the Order exists but does not have a
customerId
that matches the customer:{id} scope, or anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->orders()
->get();
<tt>withProjectKey("projectKey")->me()->orders()->head()</tt>
Checks if an Order exists for a given Query Predicate. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Order exists that matches the Query Predicate.
- If one or more Orders exist but don't have either a
customerId
that matches the customer:{id} scope, or an anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->orders()
->head();
<tt>withProjectKey("projectKey")->me()->orders()->post(null)</tt>
Creates an Order from a Cart for the Customer or anonymous user. The customerId
or anonymousId
field on the Order is automatically set based on the customer:{id} or anonymous_id:{id} scope.
The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating B2B Orders, the Customer must have the CreateMyOrdersFromMyCarts
[Permission](ctp:api:type:Permission). Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message.
If the Cart's customerId
does not match the customer:{id} scope, or the anonymousId
does not match the anonymous_id:{id} scope, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned.
If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number.
Specific Error Codes:
- [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError)
- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [OutOfStock](ctp:api:type:OutOfStockError)
- [PriceChanged](ctp:api:type:PriceChangedError)
- [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError)
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->orders()
->post(null);
<tt>withProjectKey("projectKey")->me()->orders()->withId("ID")->get()</tt>
Returns an Order for a given id
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Order exists for the given
id
.
- If the Order exists but does not have either a
customerId
that matches the customer:{id} scope, or an anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->orders()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->me()->orders()->withId("ID")->head()</tt>
Checks if an Order exists for a given id
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no Order exists for the given
id
.
- If the Order exists but does not have either a
customerId
that matches the customer:{id} scope, or an anonymousId
that matches the anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->orders()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->me()->orders()->orderQuote()->post(null)</tt>
When creating B2B Orders, the Customer must have the CreateMyOrdersFromMyQuotes
[Permission](ctp:api:type:Permission).
Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message.
Specific Error Codes:
- [OutOfStock](ctp:api:type:OutOfStockError)
- [PriceChanged](ctp:api:type:PriceChangedError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError)
- [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->orders()
->orderQuote()
->post(null);
<tt>withProjectKey("projectKey")->me()->password()->post(null)</tt>
Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with reset=false
.
If the current password does not match, an [InvalidCurrentPassword](ctp:api:type:InvalidCurrentPasswordError) error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->password()
->post(null);
<tt>withProjectKey("projectKey")->me()->password()->reset()->post(null)</tt>
This is the last step in the password reset process of a Customer.
Resetting a password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with reset=true
.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->password()
->reset()
->post(null);
<tt>withProjectKey("projectKey")->me()->payments()->get()</tt>
Returns all Payments that match a given Query Predicate.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->payments()
->get();
<tt>withProjectKey("projectKey")->me()->payments()->head()</tt>
Checks if a Payment exists for a given Query Predicate. Returns a 200 OK
status if any Payments match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->payments()
->head();
<tt>withProjectKey("projectKey")->me()->payments()->post(null)</tt>
Creates a Payment for the Customer or an anonymous user. Creating a Payment produces the [PaymentCreated](ctp:api:type:PaymentCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->payments()
->post(null);
<tt>withProjectKey("projectKey")->me()->payments()->withId("ID")->get()</tt>
Returns a Payment for a given id
.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->payments()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->me()->payments()->withId("ID")->head()</tt>
Checks if a Payment exists for a given id
. Returns a 200 OK
status if the Payment exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->payments()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->me()->payments()->withId("ID")->post(null)</tt>
Updates a Payment for a given id
. You can only update a Payment if it has no [Transactions](ctp:api:type:Transaction).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->payments()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->me()->payments()->withId("ID")->delete()</tt>
Deletes the Payment for a given id
. You can only delete a Payment if it has no [Transactions](ctp:api:type:Transaction).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->payments()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->me()->quoteRequests()->get()</tt>
Returns all Quote Requests that match a given Query Predicate. Returns a 200 OK
status if successful.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quoteRequests()
->get();
<tt>withProjectKey("projectKey")->me()->quoteRequests()->head()</tt>
Checks if a QuoteRequest exists for a given Query Predicate. Returns a 200 OK
status if any QuoteRequests match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quoteRequests()
->head();
<tt>withProjectKey("projectKey")->me()->quoteRequests()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quoteRequests()
->post(null);
<tt>withProjectKey("projectKey")->me()->quoteRequests()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quoteRequests()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->me()->quoteRequests()->withId("ID")->head()</tt>
Checks if a QuoteRequest exists for a given id
. Returns a 200 OK
status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quoteRequests()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->me()->quoteRequests()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quoteRequests()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->me()->quoteRequests()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quoteRequests()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->me()->quoteRequests()->withKey("key")->head()</tt>
Checks if a QuoteRequest exists for a given key
. Returns a 200 OK
status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quoteRequests()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->me()->quoteRequests()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quoteRequests()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->me()->quotes()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quotes()
->get();
<tt>withProjectKey("projectKey")->me()->quotes()->head()</tt>
Checks if a Quote exists for a given Query Predicate. Returns a 200 OK
status if any Quotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quotes()
->head();
<tt>withProjectKey("projectKey")->me()->quotes()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quotes()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->me()->quotes()->withId("ID")->head()</tt>
Checks if a Quote exists for a given id
. Returns a 200 OK
status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quotes()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->me()->quotes()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quotes()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->me()->quotes()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quotes()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->me()->quotes()->withKey("key")->head()</tt>
Checks if a Quote exists for a given key
. Returns a 200 OK
status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quotes()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->me()->quotes()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quotes()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->me()->shoppingLists()->get()</tt>
Returns all ShoppingLists that match the given Query Predicate. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists for the given Query Predicate.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->get();
<tt>withProjectKey("projectKey")->me()->shoppingLists()->head()</tt>
Checks if a ShoppingList matches the given Query Predicate. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists for the given Query Predicate.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->head();
<tt>withProjectKey("projectKey")->me()->shoppingLists()->post(null)</tt>
Creates a ShoppingList for the Customer or anonymous user. The customerId
or anonymousId
on the ShoppingList is automatically set based on the given customer:{id} or anonymous_id:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->post(null);
<tt>withProjectKey("projectKey")->me()->shoppingLists()->withId("ID")->get()</tt>
Returns a ShoppingList for a given id
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists for the given
id
.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->me()->shoppingLists()->withId("ID")->head()</tt>
Checks if a ShoppingList exists for a given id
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists for the given
id
.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->me()->shoppingLists()->withId("ID")->post(null)</tt>
Updates a ShoppingList for a given id
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists for the given
id
.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->me()->shoppingLists()->withId("ID")->delete()</tt>
Deletes the ShoppingList for a given id
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists for the given
id
.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->me()->shoppingLists()->withKey("key")->get()</tt>
Returns a ShoppingList for a given key
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists for the given
key
.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->me()->shoppingLists()->withKey("key")->head()</tt>
Checks if a ShoppingList exists for a given key
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists for the given
key
.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->me()->shoppingLists()->withKey("key")->post(null)</tt>
Updates a ShoppingList for a given key
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists for the given
key
.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->me()->shoppingLists()->withKey("key")->delete()</tt>
Deletes the ShoppingList for a given key
. Returns a 200 OK
status if successful.
A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:
- If no ShoppingList exists for the given
key
.
- If a ShoppingList exists but does not contain either an
anonymousId
that matches the anonymous_id:{id} scope, or a customer
with id
value that matches the customer:{id} scope.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->shoppingLists()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->me()->signup()->post(null)</tt>
If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the anonymousId
are assigned to the newly created Customer.
Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->signup()
->post(null);
<tt>withProjectKey("projectKey")->messages()->get()</tt>
Deprecated OAuth 2.0 Scope: view_orders:{projectKey}
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->messages()
->get();
<tt>withProjectKey("projectKey")->messages()->head()</tt>
Checks if a Message exists for a given Query Predicate. Returns a 200 OK
status if any Messages match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->messages()
->head();
<tt>withProjectKey("projectKey")->messages()->withId("ID")->get()</tt>
Deprecated OAuth 2.0 Scope: view_orders:{projectKey}
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->messages()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->messages()->withId("ID")->head()</tt>
Checks if a Message exists for a given id
. Returns a 200 OK
status if the Message exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->messages()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->orders()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->get();
<tt>withProjectKey("projectKey")->orders()->head()</tt>
Checks if an Order exists for a given Query Predicate. Returns a 200 OK
status if any Orders match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->head();
<tt>withProjectKey("projectKey")->orders()->post(null)</tt>
Before you create an Order, the Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction). The shipping address is used for tax calculation for a Cart with Platform
[TaxMode](ctp:api:type:TaxMode).
Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message.
If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number.
Specific Error Codes:
- [OutOfStock](ctp:api:type:OutOfStockError)
- [PriceChanged](ctp:api:type:PriceChangedError)
- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError)
- [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [InvalidOperation](ctp:api:type:InvalidOperationError)
- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->post(null);
<tt>withProjectKey("projectKey")->orders()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->orders()->withId("ID")->head()</tt>
Checks if an Order exists for a given id
. Returns a 200 OK
status if the Order exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->orders()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->orders()->withId("ID")->delete()</tt>
Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->orders()->edits()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->get();
<tt>withProjectKey("projectKey")->orders()->edits()->head()</tt>
Checks if an OrderEdit exists for a given Query Predicate. Returns a 200 OK
status if any OrderEdits match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->head();
<tt>withProjectKey("projectKey")->orders()->edits()->post(null)</tt>
You can either create multiple Order Edits for an Order and apply them sequentially to an Order, or create multiple Order Edits parallelly (as alternatives to each other) and apply one of them to the Order.
You can only create an Order Edit if the InventoryMode of the Order and its LineItems is None
.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->post(null);
<tt>withProjectKey("projectKey")->orders()->edits()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->orders()->edits()->withId("ID")->head()</tt>
Checks if an OrderEdit exists for a given id
. Returns a 200 OK
status if the OrderEdit exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->orders()->edits()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->orders()->edits()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->orders()->edits()->withId("ID")->apply()->post(null)</tt>
Applying an OrderEdit produces the [OrderEditApplied](ctp:api:type:OrderEditAppliedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withId("ID")
->apply()
->post(null);
<tt>withProjectKey("projectKey")->orders()->edits()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->orders()->edits()->withKey("key")->head()</tt>
Checks if an OrderEdit exists for a given key
. Returns a 200 OK
status if the OrderEdit exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->orders()->edits()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->orders()->edits()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->orders()->importOrder()->post(null)</tt>
Importing an Order produces the [Order Imported](ctp:api:type:OrderImportedMessage) Message.
Specific Error Codes:
- [OutOfStock](ctp:api:type:OutOfStockError)
- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->importOrder()
->post(null);
<tt>withProjectKey("projectKey")->orders()->withOrderNumber("orderNumber")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withOrderNumber("orderNumber")
->get();
<tt>withProjectKey("projectKey")->orders()->withOrderNumber("orderNumber")->head()</tt>
Checks if an Order exists for a given orderNumber
. Returns a 200 OK
status if the Order exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withOrderNumber("orderNumber")
->head();
<tt>withProjectKey("projectKey")->orders()->withOrderNumber("orderNumber")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withOrderNumber("orderNumber")
->post(null);
<tt>withProjectKey("projectKey")->orders()->withOrderNumber("orderNumber")->delete()</tt>
Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withOrderNumber("orderNumber")
->delete();
<tt>withProjectKey("projectKey")->orders()->orderQuote()->post(null)</tt>
Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message.
Specific Error Codes:
- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError)
- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError)
- [InvalidOperation](ctp:api:type:InvalidOperationError)
- [OutOfStock](ctp:api:type:OutOfStockError)
- [PriceChanged](ctp:api:type:PriceChangedError)
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->orderQuote()
->post(null);
<tt>withProjectKey("projectKey")->orders()->search()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->search()
->post(null);
<tt>withProjectKey("projectKey")->orders()->search()->head()</tt>
Checks whether a search index for the Project's Orders exists. Returns a 200 OK
status if the index exists or a 404 Not Found
error otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->search()
->head();
<tt>withProjectKey("projectKey")->payments()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->get();
<tt>withProjectKey("projectKey")->payments()->head()</tt>
Checks if a Payment exists for a given Query Predicate. Returns a 200 OK
status if any Payments match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->head();
<tt>withProjectKey("projectKey")->payments()->post(null)</tt>
Creating a Payment produces the [PaymentCreated](ctp:api:type:PaymentCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->post(null);
<tt>withProjectKey("projectKey")->payments()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->payments()->withId("ID")->head()</tt>
Checks if a Payment exists for a given id
. Returns a 200 OK
status if the Payment exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->payments()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->payments()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->payments()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->payments()->withKey("key")->head()</tt>
Checks if a Payment exists for a given key
. Returns a 200 OK
status if the Payment exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->payments()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->payments()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->productDiscounts()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->get();
<tt>withProjectKey("projectKey")->productDiscounts()->head()</tt>
Checks if a ProductDiscount exists for a given Query Predicate. Returns a 200 OK
status if any ProductDiscounts match the Query Predicate, or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->head();
<tt>withProjectKey("projectKey")->productDiscounts()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->post(null);
<tt>withProjectKey("projectKey")->productDiscounts()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->productDiscounts()->withId("ID")->head()</tt>
Checks if a ProductDiscount exists for a given id
. Returns a 200 OK
status if the ProductDiscount exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->productDiscounts()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->productDiscounts()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->productDiscounts()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->productDiscounts()->withKey("key")->head()</tt>
Checks if a ProductDiscount exists for a given key
. Returns a 200 OK
status if the ProductDiscount exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->productDiscounts()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->productDiscounts()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->productDiscounts()->matching()->post(null)</tt>
This endpoint can be used to simulate which Product Discounts would be applied if a specified Product Variant had a specified Price. Given Product and Product Variant IDs and a Price, this endpoint will return the [ProductDiscount](ctp:api:type:ProductDiscount) that would have been applied to that Price.
If a Product Discount could not be found that could be applied to the Price of a Product Variant, a [NoMatchingProductDiscountFound](ctp:api:type:NoMatchingProductDiscountFoundError) error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productDiscounts()
->matching()
->post(null);
<tt>withProjectKey("projectKey")->productProjections()->get()</tt>
Use the Product Projections query endpoint to get the current or staged representations of Products. When used with an API Client that has the view_published_products:{projectKey}
scope, this endpoint only returns published (current) Product Projections.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->get();
<tt>withProjectKey("projectKey")->productProjections()->head()</tt>
Checks if the current or staged representation of a Product exists for a given Query Predicate. Returns a 200 OK
status if any ProductProjections match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->head();
<tt>withProjectKey("projectKey")->productProjections()->withId("ID")->get()</tt>
Gets the current or staged representation of a [Product](ctp:api:type:Product) by its ID. When used with an API Client that has the view_published_products:{projectKey}
scope, this endpoint only returns published (current) Product Projections.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->productProjections()->withId("ID")->head()</tt>
Checks if the current or staged representation of a Product exists for a given id
. Returns a 200 OK
status if the ProductProjection exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->productProjections()->withKey("key")->get()</tt>
Gets the current or staged representation of a [Product](ctp:api:type:Product) found by Key. When used with an API Client that has the view_published_products:{projectKey}
scope, this endpoint only returns published (current) Product Projections.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->productProjections()->withKey("key")->head()</tt>
Checks if the current or staged representation of a Product exists for a given key
. Returns a 200 OK
status if the ProductProjection exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->productProjections()->search()->post(null)</tt>
Product Projection Search
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->search()
->post(null);
<tt>withProjectKey("projectKey")->productProjections()->search()->get()</tt>
Product Projection Search
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->search()
->get();
<tt>withProjectKey("projectKey")->productProjections()->suggest()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->suggest()
->get();
<tt>withProjectKey("projectKey")->productSelections()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->get();
<tt>withProjectKey("projectKey")->productSelections()->head()</tt>
Checks if a ProductSelection exists for a given Query Predicate. Returns a 200 OK
status if any ProductSelections match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->head();
<tt>withProjectKey("projectKey")->productSelections()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->post(null);
<tt>withProjectKey("projectKey")->productSelections()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->productSelections()->withId("ID")->head()</tt>
Checks if a ProductSelection exists for a given id
. Returns a 200 OK
status if the ProductSelection exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->productSelections()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->productSelections()->withId("ID")->delete()</tt>
Deletion will only succeed if the Product Selection is not assigned to any [Store](ctp:api:type:Store).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->productSelections()->withId("ID")->products()->get()</tt>
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->withId("ID")
->products()
->get();
<tt>withProjectKey("projectKey")->productSelections()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->productSelections()->withKey("key")->head()</tt>
Checks if a ProductSelection exists for a given key
. Returns a 200 OK
status if the ProductSelection exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->productSelections()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->productSelections()->withKey("key")->delete()</tt>
Deletion will only succeed if the Product Selection is not assigned to any [Store](ctp:api:type:Store).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->productSelections()->withKey("key")->products()->get()</tt>
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productSelections()
->withKey("key")
->products()
->get();
<tt>withProjectKey("projectKey")->productTailoring()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTailoring()
->get();
<tt>withProjectKey("projectKey")->productTailoring()->head()</tt>
Checks if a ProductTailoring exists for a given Query Predicate. Returns a 200 OK
status if any ProductTailoring match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTailoring()
->head();
<tt>withProjectKey("projectKey")->productTailoring()->post(null)</tt>
Generates the [ProductTailoringCreated](ctp:api:type:ProductTailoringCreatedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTailoring()
->post(null);
<tt>withProjectKey("projectKey")->productTailoring()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTailoring()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->productTailoring()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTailoring()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->productTailoring()->withId("ID")->delete()</tt>
Generates the [ProductTailoringDeleted](ctp:api:type:ProductTailoringDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTailoring()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->productTailoring()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTailoring()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->productTailoring()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTailoring()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->productTailoring()->withKey("key")->delete()</tt>
Generates the [ProductTailoringDeleted](ctp:api:type:ProductTailoringDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTailoring()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->productTypes()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->get();
<tt>withProjectKey("projectKey")->productTypes()->head()</tt>
Checks if a ProductType exists for a given Query Predicate. Returns a 200 OK
status if any ProductTypes match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->head();
<tt>withProjectKey("projectKey")->productTypes()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->post(null);
<tt>withProjectKey("projectKey")->productTypes()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->productTypes()->withId("ID")->head()</tt>
Checks if a ProductType exists for a given id
. Returns a 200 OK
status if the ProductType exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->productTypes()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->productTypes()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->productTypes()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->productTypes()->withKey("key")->head()</tt>
Checks if a ProductType exists for a given key
. Returns a 200 OK
status if the ProductType exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->productTypes()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->productTypes()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productTypes()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->products()->get()</tt>
If Product price selection query parameters are provided, the selected Prices are added to the response.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->get();
<tt>withProjectKey("projectKey")->products()->head()</tt>
Checks if a Product exists for a given Query Predicate. Returns a 200 OK
status if any Products match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->head();
<tt>withProjectKey("projectKey")->products()->post(null)</tt>
To create a new Product, send a representation that is going to become the initial staged and current representation of the new Product in the catalog. If Product price selection query parameters are provided, selected Prices will be added to the response. Produces the ProductCreated Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->post(null);
<tt>withProjectKey("projectKey")->products()->withId("ID")->get()</tt>
If Product price selection query parameters are provided, the selected Prices are added to the response.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->products()->withId("ID")->head()</tt>
Checks if a Product exists for a given id
. Returns a 200 OK
status if the Product exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->products()->withId("ID")->post(null)</tt>
If Product price selection query parameters are provided, the selected Prices are added to the response.
A failed response can return a [DuplicatePriceScope](ctp:api:type:DuplicatePriceScopeError), [DuplicateVariantValues](ctp:api:type:DuplicateVariantValuesError), [DuplicateAttributeValue](ctp:api:type:DuplicateAttributeValueError), or [DuplicateAttributeValues](ctp:api:type:DuplicateAttributeValuesError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->products()->withId("ID")->delete()</tt>
If Product price selection query parameters are provided, the selected Prices are added to the response. Produces the ProductDeleted Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->products()->withId("ID")->images()->post(null)</tt>
Uploads a JPEG, PNG, or a GIF image file to a [ProductVariant](ctp:api:type:ProductVariant). The maximum file size of the image is 10MB. Either variant
or sku
is required to update a specific ProductVariant. If neither is provided, the image is uploaded to the Master Variant of the Product.
The response status code depends on the size of the original image. If the image is small, the API responds with 200 OK
, and if the image is larger, it responds with 202 Accepted
. The Product returned with a 202 Accepted
status code contains a warnings
field with an [ImageProcessingOngoing](ctp:api:type:ImageProcessingOngoingWarning) Warning.
Produces the ProductImageAdded Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withId("ID")
->images()
->post(null);
<tt>withProjectKey("projectKey")->products()->withId("ID")->productSelections()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withId("ID")
->productSelections()
->get();
<tt>withProjectKey("projectKey")->products()->withKey("key")->get()</tt>
If Product price selection query parameters are provided, the selected Prices are added to the response.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->products()->withKey("key")->head()</tt>
Checks if a Product exists for a given key
. Returns a 200 OK
status if the Product exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->products()->withKey("key")->post(null)</tt>
A failed response can return a [DuplicatePriceScope](ctp:api:type:DuplicatePriceScopeError), [DuplicateVariantValues](ctp:api:type:DuplicateVariantValuesError), [DuplicateAttributeValue](ctp:api:type:DuplicateAttributeValueError), or [DuplicateAttributeValues](ctp:api:type:DuplicateAttributeValuesError) error.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->products()->withKey("key")->delete()</tt>
If Product price selection query parameters are provided, the selected Prices are added to the response. Produces the ProductDeleted Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->products()->withKey("key")->productSelections()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->withKey("key")
->productSelections()
->get();
<tt>withProjectKey("projectKey")->products()->search()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->products()
->search()
->post(null);
<tt>withProjectKey("projectKey")->quoteRequests()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->get();
<tt>withProjectKey("projectKey")->quoteRequests()->head()</tt>
Checks if a QuoteRequest exists for a given Query Predicate. Returns a 200 OK
status if any QuoteRequests match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->head();
<tt>withProjectKey("projectKey")->quoteRequests()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->post(null);
<tt>withProjectKey("projectKey")->quoteRequests()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->quoteRequests()->withId("ID")->head()</tt>
Checks if a QuoteRequest exists for a given id
. Returns a 200 OK
status if the QuoteRequest exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->quoteRequests()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->quoteRequests()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->quoteRequests()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->quoteRequests()->withKey("key")->head()</tt>
Checks if a QuoteRequest exists for a given key
. Returns a 200 OK
status if the QuoteRequest exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->quoteRequests()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->quoteRequests()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quoteRequests()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->quotes()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->get();
<tt>withProjectKey("projectKey")->quotes()->head()</tt>
Checks if a Quote exists for a given Query Predicate. Returns a 200 OK
status if any Quotes match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->head();
<tt>withProjectKey("projectKey")->quotes()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->post(null);
<tt>withProjectKey("projectKey")->quotes()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->quotes()->withId("ID")->head()</tt>
Checks if a Quote exists for a given id
. Returns a 200 OK
status if the Quote exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->quotes()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->quotes()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->quotes()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->quotes()->withKey("key")->head()</tt>
Checks if a Quote exists for a given key
. Returns a 200 OK
status if the Quote exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->quotes()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->quotes()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->quotes()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->reviews()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->get();
<tt>withProjectKey("projectKey")->reviews()->head()</tt>
Checks if a Review exists for a given Query Predicate. Returns a 200 OK
status if any Reviews match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->head();
<tt>withProjectKey("projectKey")->reviews()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->post(null);
<tt>withProjectKey("projectKey")->reviews()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->reviews()->withId("ID")->head()</tt>
Checks if a Review exists for a given id
. Returns a 200 OK
status if the Review exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->reviews()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->reviews()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->reviews()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->reviews()->withKey("key")->head()</tt>
Checks if a Review exists for a given key
. Returns a 200 OK
status if the Review exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->reviews()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->reviews()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->reviews()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->shippingMethods()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->get();
<tt>withProjectKey("projectKey")->shippingMethods()->head()</tt>
Checks if a ShippingMethod exists for a given Query Predicate. Returns a 200 OK
status if any ShippingMethods match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->head();
<tt>withProjectKey("projectKey")->shippingMethods()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->post(null);
<tt>withProjectKey("projectKey")->shippingMethods()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->shippingMethods()->withId("ID")->head()</tt>
Checks if a ShippingMethod exists for a given id
. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->shippingMethods()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->shippingMethods()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->shippingMethods()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->shippingMethods()->withKey("key")->head()</tt>
Checks if a ShippingMethod exists for a given key
. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->shippingMethods()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->shippingMethods()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->shippingMethods()->matchingCart()->get()</tt>
Retrieves all the active ShippingMethods that can ship to the shipping address of the given Cart. Each ShippingMethod contains exactly one ShippingRate with the flag isMatching
set to true
. This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingCart()
->get();
<tt>withProjectKey("projectKey")->shippingMethods()->matchingCart()->head()</tt>
Checks if an active ShippingMethod exists for the given Cart. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingCart()
->head();
<tt>withProjectKey("projectKey")->shippingMethods()->matchingCartLocation()->get()</tt>
Retrieves all the active ShippingMethods that can ship to the given [Location](ctp:api:type:Location) with a predicate
that matches the given Cart. Each ShippingMethod contains exactly one ShippingRate with the flag isMatching
set to true
. This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction).
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingCartLocation()
->get();
<tt>withProjectKey("projectKey")->shippingMethods()->matchingCartLocation()->head()</tt>
Checks if an active ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists for the given Cart. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingCartLocation()
->head();
<tt>withProjectKey("projectKey")->shippingMethods()->matchingLocation()->get()</tt>
Retrieves all the active ShippingMethods that can ship to the given Location. ShippingMethods that have a predicate
defined are automatically disqualified. If the currency
parameter is given, then the ShippingMethods must also have a rate defined in the specified currency. Each ShippingMethod contains at least one ShippingRate with the flag isMatching
set to true
. If the currency
parameter is given, exactly one ShippingRate will contain it.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingLocation()
->get();
<tt>withProjectKey("projectKey")->shippingMethods()->matchingLocation()->head()</tt>
Checks if an active ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists. Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingLocation()
->head();
<tt>withProjectKey("projectKey")->shippingMethods()->matchingOrderedit()->get()</tt>
Retrieves all the active ShippingMethods that can ship to the given [Location](ctp:api:type:Location) for an [OrderEdit](ctp:api:type:OrderEdit).
If the OrderEdit preview cannot be generated, an [EditPreviewFailed](ctp:api:type:EditPreviewFailedError) error is returned.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingOrderedit()
->get();
<tt>withProjectKey("projectKey")->shippingMethods()->matchingOrderedit()->head()</tt>
Checks if an active ShippingMethod that can ship to the given [Location](ctp:api:type:Location) exists for the given [OrderEdit](ctp:api:type:OrderEdit). Returns a 200 OK
status if the ShippingMethod exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingOrderedit()
->head();
<tt>withProjectKey("projectKey")->shoppingLists()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->get();
<tt>withProjectKey("projectKey")->shoppingLists()->head()</tt>
Checks if a ShoppingList exists for a given Query Predicate. Returns a 200 OK
status if any ShoppingLists match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->head();
<tt>withProjectKey("projectKey")->shoppingLists()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->post(null);
<tt>withProjectKey("projectKey")->shoppingLists()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->shoppingLists()->withId("ID")->head()</tt>
Checks if a ShoppingList exists for a given id
. Returns a 200 OK
status if the ShoppingList exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->shoppingLists()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->shoppingLists()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->shoppingLists()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->shoppingLists()->withKey("key")->head()</tt>
Checks if a ShoppingList exists for a given key
. Returns a 200 OK
status if the ShoppingList exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->shoppingLists()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->shoppingLists()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->stagedQuotes()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->get();
<tt>withProjectKey("projectKey")->stagedQuotes()->head()</tt>
Checks if a StagedQuote exists for a given Query Predicate. Returns a 200 OK
status if any StagedQuotes match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->head();
<tt>withProjectKey("projectKey")->stagedQuotes()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->post(null);
<tt>withProjectKey("projectKey")->stagedQuotes()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->stagedQuotes()->withId("ID")->head()</tt>
Checks if a StagedQuote exists for a given id
. Returns a 200 OK
status if the StagedQuote exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->stagedQuotes()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->stagedQuotes()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->stagedQuotes()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->stagedQuotes()->withKey("key")->head()</tt>
Checks if a StagedQuote exists for a given key
. Returns a 200 OK
status if the StagedQuote exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->stagedQuotes()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->stagedQuotes()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stagedQuotes()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->standalonePrices()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->get();
<tt>withProjectKey("projectKey")->standalonePrices()->head()</tt>
Checks if a StandalonePrice exists for a given Query Predicate. Returns a 200 OK
status if any StandalonePrices match the Query Predicate, or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->head();
<tt>withProjectKey("projectKey")->standalonePrices()->post(null)</tt>
Creating a Standalone Price produces the [StandalonePriceCreated](ctp:api:type:StandalonePriceCreatedMessage) Message.
- If the Standalone Price has the same price scope as an existing Standalone Price, a [DuplicateStandalonePriceScope](ctp:api:type:DuplicateStandalonePriceScopeError) error is returned.
- If the Standalone Price has overlapping validity periods within the same price scope, a [OverlappingStandalonePriceValidity](ctp:api:type:OverlappingStandalonePriceValidityError) error is returned. A Price without validity period does not conflict with a Price defined for a time period.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->post(null);
<tt>withProjectKey("projectKey")->standalonePrices()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->standalonePrices()->withId("ID")->head()</tt>
Checks if a StandalonePrice exists for a given id
. Returns a 200 OK
status if the StandalonePrice exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->standalonePrices()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->standalonePrices()->withId("ID")->delete()</tt>
Produces the [StandalonePriceDeleted](ctp:api:type:StandalonePriceDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->standalonePrices()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->standalonePrices()->withKey("key")->head()</tt>
Checks if a StandalonePrice exists for a given key
. Returns a 200 OK
status if the StandalonePrice exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->standalonePrices()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->standalonePrices()->withKey("key")->delete()</tt>
Produces the [StandalonePriceDeleted](ctp:api:type:StandalonePriceDeletedMessage) Message.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->standalonePrices()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->states()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->get();
<tt>withProjectKey("projectKey")->states()->head()</tt>
Checks if a State exists for a given Query Predicate. Returns a 200 OK
status if any States match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->head();
<tt>withProjectKey("projectKey")->states()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->post(null);
<tt>withProjectKey("projectKey")->states()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->states()->withId("ID")->head()</tt>
Checks if a State exists for a given id
. Returns a 200 OK
status if the State exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->states()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->states()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->states()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->states()->withKey("key")->head()</tt>
Checks if a State exists for a given key
. Returns a 200 OK
status if the State exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->states()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->states()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->states()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->stores()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->get();
<tt>withProjectKey("projectKey")->stores()->head()</tt>
Checks if a Store exists for a given Query Predicate. Returns a 200 OK
status if any Stores match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->head();
<tt>withProjectKey("projectKey")->stores()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->post(null);
<tt>withProjectKey("projectKey")->stores()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->stores()->withId("ID")->head()</tt>
Checks if a Store exists for a given id
. Returns a 200 OK
status if the Store exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->stores()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->stores()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->stores()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->stores()->withKey("key")->head()</tt>
Checks if a Store exists for a given key
. Returns a 200 OK
status if the Store exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->stores()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->stores()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->stores()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->subscriptions()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->get();
<tt>withProjectKey("projectKey")->subscriptions()->head()</tt>
Checks if a Subscription exists for a given Query Predicate. Returns a 200 OK
status if any Subscriptions match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->head();
<tt>withProjectKey("projectKey")->subscriptions()->post(null)</tt>
A test notification is sent to ensure the correct configuration of the Destination. If the notification cannot be delivered, the Subscription will not be created. The payload of the test notification is of type ResourceCreated for the resourceTypeId
subscription
.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->post(null);
<tt>withProjectKey("projectKey")->subscriptions()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->subscriptions()->withId("ID")->head()</tt>
Checks if a Subscription exists for a given id
. Returns a 200 OK
status if the Subscription exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->subscriptions()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->subscriptions()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->subscriptions()->withId("ID")->withIdHealth()->get()</tt>
This endpoint can be polled by a monitoring or alerting system that checks the health of your Subscriptions. To ease integration with such systems this endpoint does not require Authorization.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->withId("ID")
->withIdHealth()
->get();
<tt>withProjectKey("projectKey")->subscriptions()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->subscriptions()->withKey("key")->head()</tt>
Checks if a Subscription exists for a given key
. Returns a 200 OK
status if the Subscription exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->subscriptions()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->subscriptions()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->subscriptions()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->taxCategories()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->get();
<tt>withProjectKey("projectKey")->taxCategories()->head()</tt>
Checks if a TaxCategory exists for a given Query Predicate. Returns a 200 OK
status if any TaxCategories match the Query Predicate, or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->head();
<tt>withProjectKey("projectKey")->taxCategories()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->post(null);
<tt>withProjectKey("projectKey")->taxCategories()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->taxCategories()->withId("ID")->head()</tt>
Checks if a TaxCategory exists for a given id
. Returns a 200 OK
status if the TaxCategory exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->taxCategories()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->taxCategories()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->taxCategories()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->taxCategories()->withKey("key")->head()</tt>
Checks if a TaxCategory exists for a given key
. Returns a 200 OK
status if the Tax Category exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->taxCategories()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->taxCategories()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->taxCategories()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->types()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->get();
<tt>withProjectKey("projectKey")->types()->head()</tt>
Checks if a Type exists for a given Query Predicate. Returns a 200 OK
status if any Types match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->head();
<tt>withProjectKey("projectKey")->types()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->post(null);
<tt>withProjectKey("projectKey")->types()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->types()->withId("ID")->head()</tt>
Checks if a Type exists for a given id
. Returns a 200 OK
status if the Type exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->types()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->types()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->types()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->types()->withKey("key")->head()</tt>
Checks if a Type exists for a given key
. Returns a 200 OK
status if the Type exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->types()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->types()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->types()
->withKey("key")
->delete();
<tt>withProjectKey("projectKey")->zones()->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->get();
<tt>withProjectKey("projectKey")->zones()->head()</tt>
Checks if a Zone exists for a given Query Predicate. Returns a 200 OK
status if any Zones match the Query Predicate or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->head();
<tt>withProjectKey("projectKey")->zones()->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->post(null);
<tt>withProjectKey("projectKey")->zones()->withId("ID")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withId("ID")
->get();
<tt>withProjectKey("projectKey")->zones()->withId("ID")->head()</tt>
Checks if a Zone exists for a given id
. Returns a 200 OK
status if the Zone exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withId("ID")
->head();
<tt>withProjectKey("projectKey")->zones()->withId("ID")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withId("ID")
->post(null);
<tt>withProjectKey("projectKey")->zones()->withId("ID")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withId("ID")
->delete();
<tt>withProjectKey("projectKey")->zones()->withKey("key")->get()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withKey("key")
->get();
<tt>withProjectKey("projectKey")->zones()->withKey("key")->head()</tt>
Checks if a Zone exists for a given key
. Returns a 200 OK
status if the Zone exists or a 404 Not Found
otherwise.
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withKey("key")
->head();
<tt>withProjectKey("projectKey")->zones()->withKey("key")->post(null)</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withKey("key")
->post(null);
<tt>withProjectKey("projectKey")->zones()->withKey("key")->delete()</tt>
null
Example
$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withKey("key")
->delete();