commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
RequestBuilder

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.

<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 status if the Project exists, or a 404 status 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 the provided query predicate. Returns a 200 status if any API Clients match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the API Client exists, or a 404 status 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 one or more BusinessUnits exist for the provided query predicate. Returns a 200 status if any BusinessUnits match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the BusinessUnit exists, or a 404 status 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 with the provided key. Returns a 200 status if the BusinessUnit exists, or a 404 status 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 one or more Carts exist for the provided query predicate. Returns a 200 status if any Carts match the query predicate, or a 404 status 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 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 with the provided id. Returns a 200 status if the Cart exists, or a 404 status 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 with the provided key. Returns a 200 status if the Cart exists, or a 404 status 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>

Retrieves Orders in a [BusinessUnit](ctp:api:type:BusinessUnit).

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 one or more Orders exist with provided query predicate in a [BusinessUnit](ctp:api:type:BusinessUnit). Returns a 200 status if any Orders match the query predicate, or a 404 status 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 and an active Shipping Method set.

If the Cart does not reference the same BusinessUnit as the businessUnitKey path parameter, an [InvalidOperation](ctp:api:type:InvalidOperationError) is returned.

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>

Retrieves an Order with the provided id in a [BusinessUnit](ctp:api:type:BusinessUnit). If the Order exists in the [Project](ctp:api:type:Project) but does not reference the requested Business Unit, 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 with the provided id in a [BusinessUnit](ctp:api:type:BusinessUnit). Returns a 200 status if the Order exists, or a 404 status 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>

Updates an Order in a [BusinessUnit](ctp:api:type:BusinessUnit) using one or more update actions. If the Order exists in the [Project](ctp:api:type:Project) but does not reference the requested Business Unit, 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>

Retrieves an Order with the provided orderNumber in a [BusinessUnit](ctp:api:type:BusinessUnit). 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 with the provided orderNumber in a [BusinessUnit](ctp:api:type:BusinessUnit). Returns a 200 status if the Order exists, or a 404 status 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>

Updates an Order in a [BusinessUnit](ctp:api:type:BusinessUnit) using one or more update actions. If the Order exists in the [Project](ctp:api:type:Project) but does not reference the requested Business Unit, 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:Quote) in a [BusinessUnit](ctp:api:type:BusinessUnit).

The Quote must reference the same Business Unit as the businessUnitKey path parameter, must have the Pending [state](ctp:api:type:QuoteState), and must be valid (not past the validTo date). If these criteria are not met, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.

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 one or more QuoteRequests exist for the provided query predicate. Returns a 200 status if any QuoteRequests match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the QuoteRequest exists, or a 404 status 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 with the provided key. Returns a 200 status if the QuoteRequest exists, or a 404 status 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 one or more Quotes exist for the provided query predicate. Returns a 200 status if any Quotes match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Quote exists, or a 404 status 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 with the provided key. Returns a 200 status if the Quote exists, or a 404 status 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")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->get()</tt>

Retrieves ShoppingLists in a [BusinessUnit](ctp:api:type:BusinessUnit).

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->shoppingLists()
->get();

<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->head()</tt>

Checks if one or more ShoppingLists exist for the provided query predicate in a [BusinessUnit](ctp:api:type:BusinessUnit). Returns a 200 status if any ShoppingLists match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->shoppingLists()
->head();

<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->post(null)</tt>

Creates a ShoppingList in the [BusinessUnit](ctp:api:type:BusinessUnit) referenced by businessUnitKey. As such, the businessUnit field on [ShoppingListDraft](ctp:api:type:ShoppingListDraft) is ignored for this request.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->shoppingLists()
->post(null);

<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->withId("ID")->get()</tt>

Retrieves a ShoppingList with the provided key in a [BusinessUnit](ctp:api:type:BusinessUnit).

If the ShoppingList exists in the 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")
->shoppingLists()
->withId("ID")
->get();

<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->withId("ID")->head()</tt>

Checks if a ShoppingList exists with the provided id in a [BusinessUnit](ctp:api:type:BusinessUnit). Returns a 200 status if the ShoppingList exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->shoppingLists()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->withId("ID")->post(null)</tt>

Updates a ShoppingList in a [BusinessUnit](ctp:api:type:BusinessUnit) using one or more update actions. If the ShoppingList exists in the 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")
->shoppingLists()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->withId("ID")->delete()</tt>

Deletes a ShoppingList in a [BusinessUnit](ctp:api:type:BusinessUnit).

If the ShoppingList exists in the 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")
->shoppingLists()
->withId("ID")
->delete();

<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->withKey("key")->get()</tt>

Retrieves a ShoppingList with the provided key in a [BusinessUnit](ctp:api:type:BusinessUnit). If the ShoppingList exists in the 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")
->shoppingLists()
->withKey("key")
->get();

<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->withKey("key")->head()</tt>

Checks if a ShoppingList exists with the provided key in a [BusinessUnit](ctp:api:type:BusinessUnit). Returns a 200 status if the ShoppingList exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->asAssociate()
->withAssociateIdValue("associateId")
->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")
->shoppingLists()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->withKey("key")->post(null)</tt>

Updates a ShoppingList in a [BusinessUnit](ctp:api:type:BusinessUnit) using one or more update actions. If the ShoppingList 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")
->shoppingLists()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->asAssociate()->withAssociateIdValue("associateId")->inBusinessUnitKeyWithBusinessUnitKeyValue("businessUnitKey")->shoppingLists()->withKey("key")->delete()</tt>

Deletes a ShoppingList in a [BusinessUnit](ctp:api:type:BusinessUnit).

If the ShoppingList exists in the 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")
->shoppingLists()
->withKey("key")
->delete();

<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 one or more AssociateRoles exist for the provided query predicate. Returns a 200 status if any AssociateRole match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the AssociateRole exists, or a 404 status 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 with the provided key. Returns a 200 status if the AssociateRole exists, or a 404 status 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 one or more AttributeGroups exist for the provided query predicate. Returns 200 status if any AttributeGroups match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the AttributeGroup exists, or a 404 status 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 with the provided key. Returns 200 status if the AttributeGroup exists, or a 404 status 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 one or more BusinessUnits exist for the provided query predicate. Returns a 200 status if any BusinessUnits match the query predicate, or a 404 status 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()->withBusinessUnitIdValueAssociatesWithAssociateIdValue("businessUnitId", "associateId")->get()</tt>

Retrieves roles and permissions of an Associate in a Business Unit.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->withBusinessUnitIdValueAssociatesWithAssociateIdValue("businessUnitId", "associateId")
->get();

<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 with the provided id. Returns a 200 status if the BusinessUnit exists, or a 404 status 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 with the provided key. Returns a 200 status if the BusinessUnit exists, or a 404 status 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")->businessUnits()->keyWithKeyValueAssociatesWithAssociateIdValue("key", "associateId")->get()</tt>

Retrieves roles and permissions of an Associate in a Business Unit.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->keyWithKeyValueAssociatesWithAssociateIdValue("key", "associateId")
->get();

<tt>withProjectKey("projectKey")->businessUnits()->search()->post(null)</tt>

If the initial indexing is in progress or the feature is inactive, A [SearchNotReady](ctp:api:type:SearchNotReadyError) error is returned. If inactive, you can reactivate it.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->search()
->post(null);

<tt>withProjectKey("projectKey")->businessUnits()->search()->head()</tt>

Checks whether a search index of Business Units exists for a Project. Returns a 200 OK if an index exists; otherwise, returns a 409 Conflict.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->search()
->head();

<tt>withProjectKey("projectKey")->businessUnits()->searchIndexingStatus()->get()</tt>

Returns the indexing status of the Business Unit Search for a Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->businessUnits()
->searchIndexingStatus()
->get();

<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 one or more CartDiscounts exist for the provided query predicate. Returns a 200 status if any CartDiscounts match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the CartDiscount exists, or a 404 status 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 with the provided key. Returns a 200 status if the CartDiscount exists, or a 404 status 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>

Retrieves Carts in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->get();

<tt>withProjectKey("projectKey")->carts()->head()</tt>

Checks if one or more Carts exist for the provided query predicate. Returns a 200 status if any Carts match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->head();

<tt>withProjectKey("projectKey")->carts()->post(null)</tt>

Creates a Cart in the Project.

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>

Retrieves a Cart with the provided id. 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 the provided id. Returns a 200 status if the Cart exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->carts()->withId("ID")->post(null)</tt>

Updates a Cart in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->carts()->withId("ID")->delete()</tt>

Deletes a Cart in the Project.

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 exists for a Customer. Returns a 200 status if the Cart exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withCustomerId("customerId")
->head();

<tt>withProjectKey("projectKey")->carts()->withKey("key")->get()</tt>

Retrieves a Cart with the provided key. 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 with the provided key. Returns a 200 status if the Cart exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->carts()->withKey("key")->post(null)</tt>

Updates a Cart in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->carts()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->carts()->withKey("key")->delete()</tt>

Deletes a Cart in the Project.

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.

The following applies to the new Cart:

  • It contains the same Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the originating Cart or Order.
  • If a Line Item becomes invalid, it is removed from the new Cart. A common reason for this is removed Products or Prices.
  • Line items and Custom Line Items are reset to their initial state.
  • It contains no payments or delivery information.
  • It contains up-to-date Tax Rates, Prices, and Line Item product data.
  • The CartState is Active.
  • If using the customerGroup field (for a single Customer Group) and the referenced Customer switched to another Customer Group, the new Cart is automatically updated to reflect the new group and corresponding prices.
  • If using the customerGroupAssignments field (for multiple Customer Groups), the Cart no longer keeps a direct reference to a Customer Group. If a Customer’s group assignments change, the Cart and its Line Item prices are not updated automatically. Prices are only updated when the Cart is changed via a direct update action.

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 one or more Categories exist for the provided query predicate. Returns a 200 status if any Categories match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Category exists, or a 404 status 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 with the provided key. Returns a 200 status if the Category exists, or a 404 status 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 one or more Channels exist for the provided query predicate. Returns a 200 status if any Channels match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Channel exists, or a 404 status 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")->channels()->withKey("key")->get()</tt>

null

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->channels()
->withKey("key")
->get();

<tt>withProjectKey("projectKey")->channels()->withKey("key")->head()</tt>

Checks if a Channel exists with the provided key. Returns a 200 status if the Channel exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->channels()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->channels()->withKey("key")->post(null)</tt>

null

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->channels()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->channels()->withKey("key")->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()
->withKey("key")
->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 one or more CustomObjects exist for the provided query predicate. Returns a 200 status if any CustomObjects match the query predicate, or a 404 status 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 one or more CustomerGroups exist for the provided query predicate. Returns a 200 status if any CustomerGroup match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the CustomerGroup exists, or a 404 status 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 with the provided key. Returns a 200 status if the CustomerGroup exists, or a 404 status 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 one or more Customers exist for the provided query predicate. Returns a 200 status if any Customers match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->head();

<tt>withProjectKey("projectKey")->customers()->post(null)</tt>

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 with the provided id. Returns a 200 status if the Customer exists, or a 404 status 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>

Use this method to verify a global Customer's email during their email verification process.

Verifying the email of the Customer produces the [CustomerEmailVerified](ctp:api:type:CustomerEmailVerifiedMessage) Message.

After the email is verified, all email tokens issued previously through the email verification flow are invalidated. This invalidation of tokens is eventually consistent.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->emailConfirm()
->post(null);

<tt>withProjectKey("projectKey")->customers()->emailToken()->post(null)</tt>

Use this method to create an email token for a global Customer during their email verification process.

Creating an email token for the Customer produces the [CustomerEmailTokenCreated](ctp:api:type:CustomerEmailTokenCreatedMessage) Message. The Message will include the token's value, if the token's validity is 60 minutes or less.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->emailToken()
->post(null);

<tt>withProjectKey("projectKey")->customers()->withEmailToken("emailToken")->get()</tt>

Use this method to retrieve a global Customer's details by using the email token during their email verification process.

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 with the provided key. Returns a 200 status if the Customer exists, or a 404 status 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>

Use this method to reset a global Customer's password during their password reset process.

Resetting the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with reset=true.

After the password is reset, all password tokens issued previously through the password reset flow are invalidated. In addition, any access and refresh tokens issued previously through the password flow and refresh token flow are invalidated. This invalidation of tokens is eventually consistent.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->passwordReset()
->post(null);

<tt>withProjectKey("projectKey")->customers()->passwordToken()->post(null)</tt>

Use this method to create a password reset token for a global Customer during their password reset process.

Creating a password reset token for the Customer produces the [CustomerPasswordTokenCreated](ctp:api:type:CustomerPasswordTokenCreatedMessage) Message. The Message will include the token's value, if the token's validity is 60 minutes or less.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->passwordToken()
->post(null);

<tt>withProjectKey("projectKey")->customers()->withPasswordToken("passwordToken")->get()</tt>

Use this method to retrieve the details of a global Customer by using the password token during their password reset process.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->customers()
->withPasswordToken("passwordToken")
->get();

<tt>withProjectKey("projectKey")->customers()->search()->post(null)</tt>

If the initial indexing is in progress or the feature is inactive, a [SearchNotReady](ctp:api:type:SearchNotReadyError) error is returned. If inactive, 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. Returns a 200 OK if an index exists; otherwise, returns 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 one or more DiscountCodes exist for the provided query predicate. Returns a 200 status if any DiscountCodes match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the DiscountCode exists, or a 404 status 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 with the provided key. Returns a 200 status if the DiscountCode exists, or a 404 status 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")->discountGroups()->get()</tt>

Retrieves all DiscountGroups in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->get();

<tt>withProjectKey("projectKey")->discountGroups()->head()</tt>

Checks if one or more DiscountGroups exist for the provided query predicate. Returns a 200 status if any DiscountGroups match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->head();

<tt>withProjectKey("projectKey")->discountGroups()->post(null)</tt>

Creates a DiscountGroup in the Project. This request generates the [DiscountGroupCreated](ctp:api:type:DiscountGroupCreatedMessage) Message.

If the limit for active Discount Groups has been reached, a [MaxDiscountGroupsReached](ctp:api:type:MaxDiscountGroupsReachedError) error is returned.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->post(null);

<tt>withProjectKey("projectKey")->discountGroups()->withId("ID")->get()</tt>

Retrieves a DiscountGroup with the provided id.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->withId("ID")
->get();

<tt>withProjectKey("projectKey")->discountGroups()->withId("ID")->head()</tt>

Checks if a DiscountGroup exists with the provided id. Returns a 200 status if a DiscountGroup exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->discountGroups()->withId("ID")->post(null)</tt>

Updates a DiscountGroup in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->discountGroups()->withId("ID")->delete()</tt>

Deletes a DiscountGroup in the Project. This request generates the [DiscountGroupDeleted](ctp:api:type:DiscountGroupDeletedMessage) Message.

If the DiscountGroup is referenced by a CartDiscount, a [ReferenceExists](ctp:api:type:ReferenceExistsError) error is returned.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->withId("ID")
->delete();

<tt>withProjectKey("projectKey")->discountGroups()->withKey("key")->get()</tt>

Retrieves a DiscountGroup with the provided key.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->withKey("key")
->get();

<tt>withProjectKey("projectKey")->discountGroups()->withKey("key")->head()</tt>

Checks if a DiscountGroup exists with the provided key. Returns a 200 status if a DiscountGroup exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->discountGroups()->withKey("key")->post(null)</tt>

Updates a DiscountGroup in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->discountGroups()->withKey("key")->delete()</tt>

Deletes a DiscountGroup in the Project. This request generates the [DiscountGroupDeleted](ctp:api:type:DiscountGroupDeletedMessage) Message.

If the DiscountGroup is referenced by a CartDiscount, a [ReferenceExists](ctp:api:type:ReferenceExistsError) error is returned.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->discountGroups()
->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 one or more Extensions exist for the provided query predicate. Returns a 200 status if any Extensions match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Extension exists, or a 404 status 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 with the provided key. Returns a 200 status if the Extension exists, or a 404 status 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 request.

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")->businessUnits()->get()</tt>

null

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->get();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->head()</tt>

Checks if one or more BusinessUnits exist for the provided query predicate. Returns a 200 status if any BusinessUnits match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->head();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->post(null)</tt>

null

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->post(null);

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->withBusinessUnitIdValueAssociatesWithAssociateIdValue("businessUnitId", "associateId")->get()</tt>

Retrieves roles and permissions of an Associate in a Business Unit in a Store.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->withBusinessUnitIdValueAssociatesWithAssociateIdValue("businessUnitId", "associateId")
->get();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->withId("ID")->get()</tt>

null

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->withId("ID")
->get();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->withId("ID")->head()</tt>

Checks if a BusinessUnit exists with the provided id. Returns a 200 status if the BusinessUnit exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->withId("ID")->post(null)</tt>

null

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->withId("ID")->delete()</tt>

null

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->withId("ID")
->delete();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->withKey("key")->get()</tt>

null

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->withKey("key")
->get();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->withKey("key")->head()</tt>

Checks if a BusinessUnit exists with the provided key. Returns a 200 status if the BusinessUnit exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->withKey("key")->post(null)</tt>

null

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->withKey("key")->delete()</tt>

null

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->withKey("key")
->delete();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->businessUnits()->keyWithKeyValueAssociatesWithAssociateIdValue("key", "associateId")->get()</tt>

Retrieves roles and permissions of an Associate in a Business Unit in a Store.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->businessUnits()
->keyWithKeyValueAssociatesWithAssociateIdValue("key", "associateId")
->get();

<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 one or more CartDiscounts exist for the provided query predicate. Returns a 200 status if any CartDiscounts match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the CartDiscount exists, or a 404 status 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 with the provided key. Returns a 200 status if the CartDiscount exists, or a 404 status 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>

Retrieves Carts in a [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 one or more Carts exist for the provided query predicate in a [Store](ctp:api:type:Store). Returns a 200 status if any Carts match the query predicate, or a 404 status 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 in a [Store](ctp:api:type:Store).

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>

Retrieves a Cart with the provided id in a [Store](ctp:api:type:Store).

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 with the provided id in a Store. Returns a 200 status if the Cart exists, or a 404 status 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 in a [Store](ctp:api:type:Store) using one or more update actions.

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>

Deletes a Cart in a [Store](ctp:api:type:Store).

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 one or more Carts exist for a Customer in a [Store](ctp:api:type:Store). Returns a 200 status if the Cart exists, or a 404 status 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>

Retrieves a Cart with the provided key in a [Store](ctp:api:type:Store).

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 with the provided key in a [Store](ctp:api:type:Store). Returns a 200 status if the Cart exists, or a 404 status 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>

Updates a Cart in a [Store](ctp:api:type:Store) using one or more update actions.

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>

Deletes a Cart in a [Store](ctp:api:type:Store).

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 in a [Store](ctp:api:type:Store) by replicating an existing Cart or Order.

The following applies to the new Cart:

  • It contains the same Customer information, Line Items and Custom Line Items, Custom Fields, Discount Codes, and other settings of the originating Cart or Order.
  • If a Line Item becomes invalid, it is removed from the new Cart. A common reason for this is removed Products or Prices.
  • Line items and Custom Line Items are reset to their initial state.
  • It contains no payments or delivery information.
  • It contains up-to-date Tax Rates, Prices, and Line Item product data.
  • The CartState is Active.
  • If using the customerGroup field (for a single Customer Group) and the referenced Customer switched to another Customer Group, the new Cart is automatically updated to reflect the new group and corresponding prices.
  • If using the customerGroupAssignments field (for multiple Customer Groups), the Cart no longer keeps a direct reference to a Customer Group. If a Customer’s group assignments change, the Cart and its Line Item prices are not updated automatically. Prices are only updated when the Cart is changed via a direct update action.

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 one or more Customers exist for the provided query predicate. Returns a 200 status if any Customers match the query predicate, or a 404 status 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 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.

If the Customer has multiple active Carts, the anonymous Cart is merged into the most recently modified active Cart.

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 with the provided id. Returns a 200 status if the Customer exists, or a 404 status 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>

Use this method to verify a Store-specific Customer's email during their email verification process.

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.

After the email is verified, all email tokens issued previously through the email verification flow are invalidated. This invalidation of tokens is eventually consistent.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->emailConfirm()
->post(null);

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->emailToken()->post(null)</tt>

Use this method to create an email token for a Store-specific Customer during their email verification process.

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.

Creating an email token for the Customer produces the [CustomerEmailTokenCreated](ctp:api:type:CustomerEmailTokenCreatedMessage) Message. The Message will include the token's value, if the token's validity is 60 minutes or less.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->emailToken()
->post(null);

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withEmailToken("emailToken")->get()</tt>

Use this method to retrieve a Store-specific Customer's details by using the email token during their email verification process.

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 with the provided key. Returns a 200 status if the Customer exists, or a 404 status 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>

Use this method to reset a Store-specific Customer's password during their password reset process.

Resetting the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with reset=true.

After the password is reset, all password tokens issued previously through the password reset flow are invalidated. In addition, any access and refresh tokens issued previously through the password flow and refresh token flow are invalidated. This invalidation of tokens is eventually consistent.

If the Customer exists in the Project but the stores field references a different [Store](ctp:api:type:Store), then 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>

Use this method to create a password reset token for a Store-specific Customer during their password reset process.

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.

Creating a password reset token for the Customer produces the [CustomerPasswordTokenCreated](ctp:api:type:CustomerPasswordTokenCreatedMessage) Message. The Message will include the token's value, if the token's validity is 60 minutes or less.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->customers()
->passwordToken()
->post(null);

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withPasswordToken("passwordToken")->get()</tt>

Use this method to retrieve a Store-specific Customer's details by using the password reset token during their password reset process.

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).

If the Customer has multiple active Carts, the anonymous Cart is merged into the most recently modified active Cart.

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 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 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 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 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>

Retrieves Carts for the authenticated Customer or anonymous user in a [Store](ctp:api:type: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 status if any Carts match these conditions, or a 404 status 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 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 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 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 status if successful.

After the email is verified, all email tokens issued previously through the email verification flow are invalidated. This invalidation of tokens is eventually consistent.

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).

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>

Retrieves Orders in a [Store](ctp:api:type:Store) for the authenticated Customer or anonymous user.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no Orders exist that match the provided query predicate.
  • If an 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()
->get();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->orders()->head()</tt>

Checks if one or more Orders exist for the provided query predicate in a [Store](ctp:api:type:Store) for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A Not Found 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 from a Cart in a [Store](ctp:api:type:Store) 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 and an active Shipping Method set.

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>

Retrieves an Order with the provided id in a [Store](ctp:api:type:Store) for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no Orders exists in the Store with the provided id.
  • If an Order exists but does not have a store specified, or the store field references a different Store.
  • If an 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 with the provided id in a [Store](ctp:api:type:Store) for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A Not Found error is returned in the following scenarios:

  • If no Order exists in the Store with the provided id.
  • If an Order exists but does not have a store specified, or the store field references a different Store.
  • If an 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 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.

After the password is reset, all password tokens issued previously through the password reset flow are invalidated. In addition, any access and refresh tokens issued previously through the password flow and refresh token flow are invalidated. This invalidation of tokens is eventually consistent.

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>

Retrieves ShoppingLists for the authenticated Customer or anonymous user in a [Store](ctp:api:type: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 one or more ShoppingLists exist for the provided query predicate for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns 200 OK status if successful.

A Not Found error is returned in the following scenarios:

  • If no ShoppingLists exist for the provided 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 for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). 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 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>

Retrieves a ShoppingList with the provided id for the authenticated Customer or anonymous user in a [Store](ctp:api:type: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 provided id in a Store.
  • If a ShoppingList matches the provided id but does not have a store specified, or the store field references a different Store.
  • If a ShoppingList matches the provided 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 with the provided id for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns a 200 status if successful.

A Not Found error is returned in the following scenarios:

  • If no ShoppingList matches the provided id in a Store.
  • If a ShoppingList matches the provided id but does not have a store specified, or the store field references a different Store.
  • If a ShoppingList matches the provided 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 the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store) using one or more update actions. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList matches the provided id in a Store.
  • If a ShoppingList matches the provided id but does not have a store specified, or the store field references a different Store.
  • If a ShoppingList matches the provided 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 a ShoppingList in a [Store](ctp:api:type:Store). Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList matches the provided id in a Store.
  • If a ShoppingList matches the provided id but does not have a store specified, or the store field references a different Store.
  • If a ShoppingList matches the provided 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>

Retrieves a ShoppingList with the provided key for the authenticated Customer or anonymous user in a [Store](ctp:api:type: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 provided key in a Store.
  • If a ShoppingList matches the provided key but does not have a store specified, or the store field references a different Store.
  • If a ShoppingList matches the provided 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 with the provided key for the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store). Returns a 200 status if successful.

A Not Found error is returned in the following scenarios:

  • If no ShoppingList exists that matches the provided key in a Store.
  • If a ShoppingList matches the provided key but does not have a store specified, or the store field references a different Store.
  • If a ShoppingList matches the provided 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 the authenticated Customer or anonymous user in a [Store](ctp:api:type:Store) using one or more update actions. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList matches the provided key in a Store.
  • If a ShoppingList matches the provided key but does not have a store specified, or the store field references a different Store.
  • If a ShoppingList matches the provided 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 a ShoppingList in a [Store](ctp:api:type:Store). Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList matches the provided key in a Store.
  • If a ShoppingList matches the provided key but does not have a store specified, or the store field references a different Store.
  • If a ShoppingList matches the provided 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.

If the Customer has multiple active Carts, the anonymous Cart is merged into the most recently modified active Cart.

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>

Retrieves Orders in a [Store](ctp:api:type:Store).

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->get();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->head()</tt>

Checks if one or more Orders exist for the provided query predicate in a [Store](ctp:api:type:Store). Returns a 200 status if any Orders match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->orders()
->head();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->post(null)</tt>

Creates an Order from a Cart in a [Store](ctp:api:type:Store). The Cart must have a shipping address and an active Shipping Method set.

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>

Retrieves an Order with the provided id in a [Store](ctp:api:type:Store). 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 with the provided id in a [Store](ctp:api:type:Store). Returns a 200 status if the Order exists, or a 404 status 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>

Updates an Order in a [Store](ctp:api:type:Store) using one or more update actions. 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>

Deletes an Order in a [Store](ctp:api:type:Store). 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>

Retrieves an Order with the provided orderNumber in a [Store](ctp:api:type:Store). 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 with the provided orderNumber in a [Store](ctp:api:type:Store). Returns a 200 status if the Order exists, or a 404 status 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>

Updates an Order in a [Store](ctp:api:type:Store) using one or more update actions. 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>

Deletes an Order in a [Store](ctp:api:type:Store). 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>

Creates an Order from a [Quote](ctp:api:type:Quote) in a [Store](ctp:api:type:Store). The referenced Quote must have the Pending [state](ctp:api:type:QuoteState) and must be valid (not past the validTo date); otherwise, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.

Produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message.

Specific Error Codes:

  • [OutOfStock](ctp:api:type:OutOfStockError)
  • [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. If a [ProductTailoring](ctp:api:type:ProductTailoring) exists for the Product with the given id and the given Store, this endpoint returns the ProductProjection with tailored data. 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 with the provided id in the specified [Store](ctp:api:type:Store). Returns a 200 status if the ProductProjection exists, or a 404 status 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. If a [ProductTailoring](ctp:api:type:ProductTailoring) exists for the Product with the given key and the given Store, this endpoint returns the ProductProjection with tailored data. 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 with the provided key in the specified [Store](ctp:api:type:Store). Returns a 200 status if the ProductProjection exists, or a 404 status 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 one or more QuoteRequests exist for the provided query predicate. Returns a 200 status if any QuoteRequests match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the QuoteRequest exists, or a 404 status 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 with the provided key. Returns a 200 status if the QuoteRequest exists, or a 404 status 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 one or more Quotes exist for the provided query predicate. Returns a 200 status if any Quotes match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Quote exists, or a 404 status 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 with the provided key. Returns a 200 status if the Quote exists, or a 404 status 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 the active ShippingMethods that can ship to the shipping address of the provided Cart in a [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).

If a matching ShippingMethod has isDefault set to true, it is returned as the first item in the array.

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 provided Cart exists in a [Store](ctp:api:type:Store). Returns a 200 OK status if the ShippingMethod exists or a Not Found error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shippingMethods()
->matchingCart()
->head();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->get()</tt>

Retrieves ShoppingLists in a [Store](ctp:api:type:Store).

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->get();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->head()</tt>

Checks if one or more ShoppingLists exist for the provided query predicate in a [Store](ctp:api:type:Store). Returns a 200 status if any ShoppingLists match the query predicate or, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inStoreKeyWithStoreKeyValue("storeKey")
->shoppingLists()
->head();

<tt>withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->post(null)</tt>

Creates a ShoppingList in a [Store](ctp:api:type:Store). 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>

Retrieves a ShoppingList with the provided id in a [Store](ctp:api:type:Store). If a ShoppingList exists in a Project but does not have the store field, or the store field references a different 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 with the provided id in a [Store](ctp:api:type:Store). Returns a 200 status if the ShoppingList exists, or a 404 status 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>

Updates a ShoppingList in a [Store](ctp:api:type:Store) using one or more update actions. If a ShoppingList exists in a Project but does not have the store field, or the store field references a different 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>

Deletes a ShoppingList in a [Store](ctp:api:type:Store). If a ShoppingList exists in a Project but does not have the store field, or the store field references a different 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>

Retrieves a ShoppingList with the provided key in a [Store](ctp:api:type:Store). If a ShoppingList exists in a Project but does not have the store field, or the store field references a different 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 with the provided key in a [Store](ctp:api:type:Store). Returns a 200 status if the ShoppingList exists, or a 404 status 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>

Updates a ShoppingList in a [Store](ctp:api:type:Store) using one or more update actions. If a ShoppingList exists in a Project but does not have the store field, or the store field references a different 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>

Deletes a ShoppingList in a [Store](ctp:api:type:Store). If a ShoppingList exists in a Project but does not have the store field, or the store field references a different 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 one or more StagedQuotes exist for the provided query predicate. Returns a 200 status if any StagedQuotes match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the StagedQuote exists, or a 404 status 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 with the provided key. Returns a 200 status if the StagedQuote exists, or a 404 status 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 one or more InventoryEntries exist for the provided query predicate. Returns a 200 status if any Inventory Entries match the Query Predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->inventory()
->head();

<tt>withProjectKey("projectKey")->inventory()->post(null)</tt>

Creates an InventoryEntry in the Project.

If quantity limits are provided, existing Line Items that reference a Product Variant with an SKU that matches the Inventory Entry can be affected. For more information, see Quantity limits.

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 with the provided id. Returns a 200 status if the InventoryEntry exists, or a 404 status 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 with the provided key. Returns a 200 status if the InventoryEntry exists, or a 404 status 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.

If the Customer has multiple active Carts, the anonymous Cart is merged into the most recently modified active Cart.

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 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 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 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 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 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>

Retrieves Business Units for the authenticated Customer. Returns a 200 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 one or more BusinessUnits exist for the provided query predicate. Returns a 200 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 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 with the provided id. Returns a 200 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 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 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 with the provided key. Returns a 200 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 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>

Retrieves Carts for the authenticated Customer or anonymous user.

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 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 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no Cart exists with the provided 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 with the provided id. Returns a 200 status if the Cart exists.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no Cart exists with the provided 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 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no Cart exists with the provided 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 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no Cart exists with the provided 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.

After the email is verified, all email tokens issued previously through the email verification flow are invalidated. This invalidation of tokens is eventually consistent.

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).

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>

Retrieves Orders for the authenticated Customer or anonymous user.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no Orders exist for the provided query predicate.
  • If an 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 one or more Orders exist for the provided query predicate for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A Not Found error is returned in the following scenarios:

  • If no Orders exist that match the provided 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 and an active Shipping Method set. 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.

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>

Retrieves an Order with the provided id for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no Order exists for the provided 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 with the provided id for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A Not Found error is returned in the following scenarios:

  • If no Order exists for the provided 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>

Creates an Order from a [Quote](ctp:api:type:Quote) for the authenticated Customer. To create B2B Orders, the Customer must have the CreateMyOrdersFromMyQuotes [Permission](ctp:api:type:Permission).

The referenced Quote must have the Pending [state](ctp:api:type:QuoteState) and must be valid (not past the validTo date); otherwise, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.

Produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message.

Specific Error Codes:

  • [OutOfStock](ctp:api:type:OutOfStockError)
  • [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.

After the password is reset, all password tokens issued previously through the password reset flow are invalidated. In addition, any access and refresh tokens issued previously through the password flow and refresh token flow are invalidated. This invalidation of tokens is eventually consistent.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->password()
->reset()
->post(null);

<tt>withProjectKey("projectKey")->me()->payments()->get()</tt>

Retrieves Payments for the authenticated Customer or anonymous user.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->payments()
->get();

<tt>withProjectKey("projectKey")->me()->payments()->head()</tt>

Checks if one or more Payments exist for the provided query predicate for the authenticated Customer or anonymous user. Returns a 200 status if any Payments match the query predicate, or a 404 status 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 authenticated Customer or 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>

Retrieves a Payment with the provided id for the authenticated Customer or anonymous user.

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 with the provided id for the authenticated Customer or anonymous user. Returns a 200 status if the Payment exists, or a 404 status 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 the authenticated Customer or anonymous user using one or more update actions. 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 a Payment with the provided id for the authenticated Customer or anonymous user. 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>

Retrieves Quote Requests for the authenticated Customer. Returns a 200 status if successful.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->me()
->quoteRequests()
->get();

<tt>withProjectKey("projectKey")->me()->quoteRequests()->head()</tt>

Checks if one or more QuoteRequests exist for the provided query predicate. Returns a 200 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 with the provided id. Returns a 200 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 with the provided key. Returns a 200 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 one or more Quotes exist for the provided query predicate. Returns a 200 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 with the provided id. Returns a 200 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 with the provided key. Returns a 200 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>

Retrieves ShoppingLists for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList exists for the provided 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 one or more ShoppingLists exist for the provided query predicate for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A Not Found error is returned in the following scenarios:

  • If no ShoppingList exists for the provided 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 authenticated 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>

Retrieves a ShoppingList with the provided id for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList exists with the provided 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 with the provided id for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A Not Found error is returned in the following scenarios:

  • If no ShoppingList exists for the provided 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 the authenticated Customer or anonymous user using one or more update actions. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList exists for the provided 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 a ShoppingList for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList exists with the provided 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>

Retrieves a ShoppingList with the provided key for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList exists with the provided 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 with the provided key for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A Not Found error is returned in the following scenarios:

  • If no ShoppingList exists with the provided 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 the authenticated Customer or anonymous user using one or more update actions. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList exists for the provided 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 a ShoppingList for the authenticated Customer or anonymous user. Returns a 200 status if successful.

A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios:

  • If no ShoppingList exists for the provided 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 one or more Messages exist for the provided query predicate. Returns a 200 status if any Messages match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Message exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->messages()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->orders()->get()</tt>

Retrieves Orders in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->get();

<tt>withProjectKey("projectKey")->orders()->head()</tt>

Checks if one or more Orders exist for the provided query predicate. Returns a 200 status if any Orders match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->head();

<tt>withProjectKey("projectKey")->orders()->post(null)</tt>

Creates an Order from a Cart.

The Cart must have a shipping address and an active Shipping Method set.

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 the Order is created from a Recurring Order schedule, the [OrderCreatedFromRecurringOrder](ctp:api:type:OrderCreatedFromRecurringOrderMessage) Message is generated.

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>

Retrieves an Order with the provided id.

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 with the provided id. Returns a 200 status if the Order exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->orders()->withId("ID")->post(null)</tt>

Updates an Order in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->orders()->withId("ID")->delete()</tt>

Deletes an Order in the Project. 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>

Retrieves OrderEdits in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->get();

<tt>withProjectKey("projectKey")->orders()->edits()->head()</tt>

Checks if one or more OrderEdits exist for the provided query predicate. Returns a 200 status if any OrderEdits match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->head();

<tt>withProjectKey("projectKey")->orders()->edits()->post(null)</tt>

Creates an OrderEdit in the Project. 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>

Retrieves an OrderEdit with the provided id.

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 with the provided id. Returns a 200 status if the OrderEdit exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->orders()->edits()->withId("ID")->post(null)</tt>

Updates an OrderEdit in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->orders()->edits()->withId("ID")->delete()</tt>

Deletes an OrderEdit in the Project.

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>

Retrieves an OrderEdit with the provided key.

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 with the provided key. Returns a 200 status if the OrderEdit exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->orders()->edits()->withKey("key")->post(null)</tt>

Updates an OrderEdit in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->orders()->edits()->withKey("key")->delete()</tt>

Deletes an OrderEdit in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->edits()
->withKey("key")
->delete();

<tt>withProjectKey("projectKey")->orders()->importOrder()->post(null)</tt>

Creates an Order without needing to create a Cart first. 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>

Retrieves an Order with the provided orderNumber.

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 with the provided orderNumber. Returns a 200 status if the Order exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withOrderNumber("orderNumber")
->head();

<tt>withProjectKey("projectKey")->orders()->withOrderNumber("orderNumber")->post(null)</tt>

Updates an Order in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->withOrderNumber("orderNumber")
->post(null);

<tt>withProjectKey("projectKey")->orders()->withOrderNumber("orderNumber")->delete()</tt>

Deletes an Order in the Project. 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>

Creates an Order from a Quote. The referenced Quote must have the Pending [state](ctp:api:type:QuoteState) and must be valid (not past the validTo date); otherwise, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.

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)

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 status if the index exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->orders()
->search()
->head();

<tt>withProjectKey("projectKey")->paymentMethods()->get()</tt>

Retrieves all PaymentMethods in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->get();

<tt>withProjectKey("projectKey")->paymentMethods()->head()</tt>

Checks if one or more PaymentMethods exist for the provided query predicate. Returns a 200 status if any PaymentMethods match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->head();

<tt>withProjectKey("projectKey")->paymentMethods()->post(null)</tt>

Creates a PaymentMethod in the Project. This request generates the [PaymentMethodCreated](ctp:api:type:PaymentMethodCreatedMessage) Message.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->post(null);

<tt>withProjectKey("projectKey")->paymentMethods()->withId("ID")->get()</tt>

Retrieves a PaymentMethod with the provided id.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->withId("ID")
->get();

<tt>withProjectKey("projectKey")->paymentMethods()->withId("ID")->head()</tt>

Checks if a PaymentMethod exists with the provided id. Returns a 200 status if the PaymentMethod exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->paymentMethods()->withId("ID")->post(null)</tt>

Updates a PaymentMethod in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->paymentMethods()->withId("ID")->delete()</tt>

Deletes a PaymentMethod in the Project. This request generates the [PaymentMethodDeleted](ctp:api:type:PaymentMethodDeletedMessage) Message.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->withId("ID")
->delete();

<tt>withProjectKey("projectKey")->paymentMethods()->withKey("key")->get()</tt>

Retrieves a PaymentMethod with the provided key.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->withKey("key")
->get();

<tt>withProjectKey("projectKey")->paymentMethods()->withKey("key")->head()</tt>

Checks if a PaymentMethod exists with the provided key. Returns a 200 status if the PaymentMethod exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->paymentMethods()->withKey("key")->post(null)</tt>

Updates a PaymentMethod in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->paymentMethods()->withKey("key")->delete()</tt>

Deletes a PaymentMethod in the Project. This request generates the [PaymentMethodDeleted](ctp:api:type:PaymentMethodDeletedMessage) Message.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->paymentMethods()
->withKey("key")
->delete();

<tt>withProjectKey("projectKey")->payments()->get()</tt>

Retrieves Payments in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->get();

<tt>withProjectKey("projectKey")->payments()->head()</tt>

Checks if one or more Payments exist for the provided query predicate. Returns a 200 status if any Payments match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->head();

<tt>withProjectKey("projectKey")->payments()->post(null)</tt>

Creates a Payment in the Project. 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>

Retrieves a Payment with the provided id.

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 with the provided id. Returns a 200 status if the Payment exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->payments()->withId("ID")->post(null)</tt>

Updates a Payment in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->payments()->withId("ID")->delete()</tt>

Deletes a Payment in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withId("ID")
->delete();

<tt>withProjectKey("projectKey")->payments()->withKey("key")->get()</tt>

Retrieves a Payment with the provided key.

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 with the provided key. Returns a 200 status if the Payment exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->payments()->withKey("key")->post(null)</tt>

Updates a Payment in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->payments()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->payments()->withKey("key")->delete()</tt>

Deletes a Payment in the Project.

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 one or more ProductDiscounts exist for the provided query predicate. Returns a 200 status if any ProductDiscounts match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the ProductDiscount exists, or a 404 status 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 with the provided key. Returns a 200 status if the ProductDiscount exists, or a 404 status 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 the provided query predicate. Returns a 200 status if any ProductProjections match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the ProductProjection exists, or a 404 status 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 with the provided key. Returns a 200 status if the ProductProjection exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->productProjections()->search()->post(null)</tt>

For implementing funnel search on Product Listing Pages where users select multiple filters, use this POST method. To avoid URL length restrictions, this method passes the same query parameters as defined in the GET method, within the request body in URL-encoded format.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->productProjections()
->search()
->post(null);

<tt>withProjectKey("projectKey")->productProjections()->search()->get()</tt>

This method appends query parameters to the URL. The maximum allowed URL length is 8192 characters. Exceeding this limit will result in URL truncation, potentially leading to unexpected results. For funnel searches on Product Listing Pages, where users select multiple filters, we recommend the POST method which passes the query parameters within the request body, avoiding URL length restrictions.

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 one or more ProductSelections exist for the provided query predicate. Returns a 200 status if any ProductSelections match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the ProductSelection exists, or a 404 status 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 with the provided key. Returns a 200 status if the ProductSelection exists, or a 404 status 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 one or more ProductTailorings exist for the provided query predicate. Returns a 200 status if any ProductTailoring match the query predicate, or a 404 status 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 one or more ProductTypes exist for the provided query predicate. Returns a 200 status if any ProductTypes match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the ProductType exists, or a 404 status 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 with the provided key. Returns a 200 status if the ProductType exists, or a 404 status 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 one or more Products exist for the provided query predicate. Returns a 200 status if any Products match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Product exists, or a 404 status 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 with the provided key. Returns a 200 status if the Product exists, or a 404 status 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>

If indexing is in progress or if Product Search is inactive, an [ObjectNotFound](ctp:api:type:ObjectNotFoundError) error is returned. If inactive, you can reactivate it.

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 one or more QuoteRequests exist for the provided query predicate. Returns a 200 status if any QuoteRequests match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the QuoteRequest exists, or a 404 status 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 with the provided key. Returns a 200 status if the QuoteRequest exists, or a 404 status 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 one or more Quotes exist for the provided query predicate. Returns a 200 status if any Quotes match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Quote exists, or a 404 status 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 with the provided key. Returns a 200 status if the Quote exists, or a 404 status 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")->recurrencePolicies()->get()</tt>

Retrieves Recurrence Policies in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->get();

<tt>withProjectKey("projectKey")->recurrencePolicies()->head()</tt>

Checks if one or more Recurrence Policies exist for the provided query predicate. Returns a 200 status if any Recurrence Policies match the query predicate, or a [NotFound](ctp:api:type:ResourceNotFoundError) error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->head();

<tt>withProjectKey("projectKey")->recurrencePolicies()->post(null)</tt>

Creates a Recurrence Policy in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->post(null);

<tt>withProjectKey("projectKey")->recurrencePolicies()->withId("ID")->get()</tt>

Retrieves a Recurrence Policy with the provided id.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->withId("ID")
->get();

<tt>withProjectKey("projectKey")->recurrencePolicies()->withId("ID")->head()</tt>

Checks if a Recurrence Policy exists with the provided id. Returns a 200 status if the Recurrence Policy exists, or a [NotFound](ctp:api:type:ResourceNotFoundError) error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->recurrencePolicies()->withId("ID")->post(null)</tt>

Updates a Recurrence Policy using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->recurrencePolicies()->withId("ID")->delete()</tt>

Deletes a Recurrence Policy in the Project.

A Recurrence Policy can be deleted only if it is not referenced by any Embedded Price, Standalone Price, or (Custom) Line Item, otherwise a [ReferenceExists](ctp:api:type:ReferenceExistsError) error is returned.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->withId("ID")
->delete();

<tt>withProjectKey("projectKey")->recurrencePolicies()->withKey("key")->get()</tt>

Retrieves a Recurrence Policy with the provided key.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->withKey("key")
->get();

<tt>withProjectKey("projectKey")->recurrencePolicies()->withKey("key")->head()</tt>

Checks if a Recurrence Policy exists with the provided key. Returns a 200 status if the Recurrence Policy exists, or a [NotFound](ctp:api:type:ResourceNotFoundError) error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->recurrencePolicies()->withKey("key")->post(null)</tt>

Updates a Recurrence Policy using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->recurrencePolicies()->withKey("key")->delete()</tt>

Deletes a Recurrence Policy in the Project.

A Recurrence Policy can be deleted only if it is not referenced by any Embedded Price, Standalone Price, or (Custom) Line Item, otherwise a [ReferenceExists](ctp:api:type:ReferenceExistsError) error is returned.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurrencePolicies()
->withKey("key")
->delete();

<tt>withProjectKey("projectKey")->recurringOrders()->get()</tt>

Retrieves Recurring Orders in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->get();

<tt>withProjectKey("projectKey")->recurringOrders()->head()</tt>

Checks if one or more Recurring Orders exist for the provided query predicate. Returns a 200 status if any Recurring Orders match the query predicate, or a [NotFound](ctp:api:type:ResourceNotFoundError) error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->head();

<tt>withProjectKey("projectKey")->recurringOrders()->post(null)</tt>

Creates a Recurring Order in the Project. Produces the [RecurringOrderCreated](ctp:api:type:RecurringOrderCreatedMessage) message.

The Cart is validated to ensure that it is convertible to an [Order](ctp:api:type:Order). If the validation fails, an error is returned. If the expiration date has been reached when the [Recurring Order](ctp:api:type:RecurringOrder) is processed, its [RecurringOrderState](ctp:api:type:RecurringOrderState) will be updated to Expired, and no Order will be created.

If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Recurring Order creation may still successfully complete after the error is returned. If you receive this error, you should verify the status of the Recurring Order by querying a unique identifier supplied during the creation request, such as the key.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->post(null);

<tt>withProjectKey("projectKey")->recurringOrders()->withId("ID")->get()</tt>

Retrieves a Recurring Order with the provided id.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->withId("ID")
->get();

<tt>withProjectKey("projectKey")->recurringOrders()->withId("ID")->head()</tt>

Checks if a Recurring Order exists with the provided id. Returns a 200 status if the Recurring Order exists, or a [NotFound](ctp:api:type:ResourceNotFoundError) error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->recurringOrders()->withId("ID")->post(null)</tt>

Updates a Recurring Order using one or more update actions.

A Recurring Order can only be updated when it is not processing an Order. Otherwise, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->recurringOrders()->withId("ID")->delete()</tt>

Deletes a Recurring Order in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->withId("ID")
->delete();

<tt>withProjectKey("projectKey")->recurringOrders()->withKey("key")->get()</tt>

Retrieves a Recurring Order with the provided key.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->withKey("key")
->get();

<tt>withProjectKey("projectKey")->recurringOrders()->withKey("key")->head()</tt>

Checks if a Recurring Order exists with the provided key. Returns a 200 status if the Recurring Order exists, or a [NotFound](ctp:api:type:ResourceNotFoundError) error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->recurringOrders()->withKey("key")->post(null)</tt>

Updates a Recurring Order using one or more update actions.

A Recurring Order can only be updated when it is not processing an Order. Otherwise, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->recurringOrders()->withKey("key")->delete()</tt>

Deletes a Recurring Order in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->recurringOrders()
->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 one or more Reviews exist for the provided query predicate. Returns a 200 status if any Reviews match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Review exists, or a 404 status 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 with the provided key. Returns a 200 status if the Review exists, or a 404 status 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>

Retrieves all ShippingMethods in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->get();

<tt>withProjectKey("projectKey")->shippingMethods()->head()</tt>

Checks if one or more ShippingMethods exist for the provided query predicate. Returns a 200 OK status if any ShippingMethods match the query predicate or a Not Found error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->head();

<tt>withProjectKey("projectKey")->shippingMethods()->post(null)</tt>

Creates a ShippingMethod in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->post(null);

<tt>withProjectKey("projectKey")->shippingMethods()->withId("ID")->get()</tt>

Retrieves a ShippingMethod with the provided id.

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 with the provided id. Returns a 200 OK status if the ShippingMethod exists or a Not Found error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->shippingMethods()->withId("ID")->post(null)</tt>

Updates a ShippingMethod in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->shippingMethods()->withId("ID")->delete()</tt>

Deletes a ShippingMethod in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withId("ID")
->delete();

<tt>withProjectKey("projectKey")->shippingMethods()->withKey("key")->get()</tt>

Retrieves a ShippingMethod with the provided key.

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 with the provided key. Returns a 200 OK status if the ShippingMethod exists or a Not Found error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->shippingMethods()->withKey("key")->post(null)</tt>

Updates a ShippingMethod in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->shippingMethods()->withKey("key")->delete()</tt>

Deletes a ShippingMethod in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->withKey("key")
->delete();

<tt>withProjectKey("projectKey")->shippingMethods()->matchingCart()->get()</tt>

Retrieves the active ShippingMethods that can ship to the shipping address of the provided 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).

If a matching ShippingMethod has isDefault set to true, it is returned as the first item in the array.

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 provided Cart. Returns a 200 OK status if the ShippingMethod exists or a Not Found error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingCart()
->head();

<tt>withProjectKey("projectKey")->shippingMethods()->matchingCartLocation()->get()</tt>

Retrieves the active ShippingMethods that can ship to the provided [Location](ctp:api:type:Location) with a predicate that matches the provided 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).

If a matching ShippingMethod has isDefault set to true, it is returned as the first item in the array.

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 provided [Location](ctp:api:type:Location) exists for the provided Cart. Returns a 200 OK status if the ShippingMethod exists or a Not Found error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingCartLocation()
->head();

<tt>withProjectKey("projectKey")->shippingMethods()->matchingLocation()->get()</tt>

Retrieves the active ShippingMethods that can ship to the provided Location.

The following applies:

  • ShippingMethods that have a predicate defined are automatically disqualified.
  • If the currency parameter is provided, 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 provided, exactly one ShippingRate will contain it.
  • If a matching ShippingMethod has isDefault set to true, it is returned as the first item in the array.

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 provided [Location](ctp:api:type:Location) exists. Returns a 200 OK status if the ShippingMethod exists or a Not Found error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingLocation()
->head();

<tt>withProjectKey("projectKey")->shippingMethods()->matchingOrderedit()->get()</tt>

Retrieves the active ShippingMethods that can ship to the provided [Location](ctp:api:type:Location) for an [OrderEdit](ctp:api:type:OrderEdit).

If a matching ShippingMethod has isDefault set to true, it is returned as the first item in the array.

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 provided [Location](ctp:api:type:Location) exists for the provided [OrderEdit](ctp:api:type:OrderEdit). Returns a 200 OK status if the ShippingMethod exists or a Not Found error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shippingMethods()
->matchingOrderedit()
->head();

<tt>withProjectKey("projectKey")->shoppingLists()->get()</tt>

Retrieves ShoppingLists in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->get();

<tt>withProjectKey("projectKey")->shoppingLists()->head()</tt>

Checks if one or more ShoppingLists exist for the provided query predicate. Returns a 200 status if any ShoppingLists match the query predicate, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->head();

<tt>withProjectKey("projectKey")->shoppingLists()->post(null)</tt>

Create a ShoppingList in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->post(null);

<tt>withProjectKey("projectKey")->shoppingLists()->withId("ID")->get()</tt>

Retrieves a ShoppingList with the provided id.

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 with the provided id. Returns a 200 status if the ShoppingList exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withId("ID")
->head();

<tt>withProjectKey("projectKey")->shoppingLists()->withId("ID")->post(null)</tt>

Updates a ShoppingList in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withId("ID")
->post(null);

<tt>withProjectKey("projectKey")->shoppingLists()->withId("ID")->delete()</tt>

Deletes a ShoppingList in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withId("ID")
->delete();

<tt>withProjectKey("projectKey")->shoppingLists()->withKey("key")->get()</tt>

Retrieves a ShoppingList with the provided key.

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 with the provided key. Returns a 200 status if the ShoppingList exists, or a 404 status otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->shoppingLists()->withKey("key")->post(null)</tt>

Updates a ShoppingList in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->shoppingLists()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->shoppingLists()->withKey("key")->delete()</tt>

Deletes a ShoppingList in the Project.

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 one or more StagedQuotes exist for the provided query predicate. Returns a 200 status if any StagedQuotes match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the StagedQuote exists, or a 404 status 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 with the provided key. Returns a 200 status if the StagedQuote exists, or a 404 status 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 one or more StandalonePrices exist for the provided query predicate. Returns a 200 status if any StandalonePrices match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the StandalonePrice exists, or a 404 status 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 with the provided key. Returns a 200 status if the StandalonePrice exists, or a 404 status 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 one or more States exist for the provided query predicate. Returns a 200 status if any States match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the State exists, or a 404 status 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 with the provided key. Returns a 200 status if the State exists, or a 404 status 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 one or more Stores exist for the provided query predicate. Returns a 200 status if any Stores match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Store exists, or a 404 status 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 with the provided key. Returns a 200 status if the Store exists, or a 404 status 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 one or more Subscriptions exist for the provided query predicate. Returns a 200 status if any Subscriptions match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Subscription exists, or a 404 status 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 with the provided key. Returns a 200 status if the Subscription exists, or a 404 status 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 one or more Tax Categories exist for the provided query predicate. Returns a 200 status if any TaxCategories match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the TaxCategory exists, or a 404 status 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 with the provided key. Returns a 200 status if the Tax Category exists, or a 404 status 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 one or more Types exist for the provided query predicate. Returns a 200 status if any Types match the query predicate, or a 404 status 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 with the provided id. Returns a 200 status if the Type exists, or a 404 status 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 with the provided key. Returns a 200 status if the Type exists, or a 404 status 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>

Retrieves all Zones in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->get();

<tt>withProjectKey("projectKey")->zones()->head()</tt>

Checks if one or more Zones exist for the provided query predicate. Returns a 200 OK status if any Zones match the query predicate, or a Not Found error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->head();

<tt>withProjectKey("projectKey")->zones()->post(null)</tt>

Creates a Zone in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->post(null);

<tt>withProjectKey("projectKey")->zones()->withId("ID")->get()</tt>

Retrieves a Zone with the provided id.

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 with the provided id. Returns a 200 OK status if the Zone exists or a Not Found error 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>

Deletes a Zone in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withId("ID")
->delete();

<tt>withProjectKey("projectKey")->zones()->withKey("key")->get()</tt>

Retrieves a Zone with the provided key.

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 with the provided key. Returns a 200 OK status if the Zone exists or a Not Found error otherwise.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withKey("key")
->head();

<tt>withProjectKey("projectKey")->zones()->withKey("key")->post(null)</tt>

Updates a Zone in the Project using one or more update actions.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withKey("key")
->post(null);

<tt>withProjectKey("projectKey")->zones()->withKey("key")->delete()</tt>

Deletes a Zone in the Project.

Example

$builder = new ApiRequestBuilder();
$request = $builder
->withProjectKey("projectKey")
->zones()
->withKey("key")
->delete();