OCAPI Hooks for Shop API

The following hooks exist in OCAPI.

Auth hooks for Shop API.


dw.ocapi.shop.auth.afterPOST

POST /customers/auth

Method details

afterPOST (customer : dw.customer.Customer, authRequestType : dw.value.EnumValue) : dw.system.Status

The function is called after the customer has been authenticated.

Parameters:
customer - the authenticated customer
authRequestType - does the request specify a guest, login or refresh authentication
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.auth.beforePOST

POST /customers/auth

Method details

beforePOST (authorizationHeader : String, authRequestType : dw.value.EnumValue) : dw.system.Status

The function is called before the customer has been authenticated.

Parameters:
authorizationHeader - the authorization header. Differs depending on the type:
  • guest - no content relevant to the authentication.
  • credentials - Base64 encoded username and password. For example Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=. It is possible to extract the username or password: var credentials = authHeader.substr(6); // cut out Basic var base64decoded : String = StringUtils.decodeBase64(credentials, "UTF-8"); var userName : String = base64decoded.split(":")[0]; var password : String = base64decoded.split(":")[1];
  • refresh - A refresh token, for example Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXX
  • session - no content relevant to the authentication. Authentication based on cookies.
authRequestType - does the request specify a guest, login or refresh authentication
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.auth.modifyPOSTResponse

POST /customers/auth

Method details

modifyPOSTResponse (customer : dw.customer.Customer, customerResponse : Customer, authRequestType : dw.value.EnumValue) : dw.system.Status

Parameters:
customer - the auth customer
customerResponse - customer response object
authRequestType - auth request type enum
Returns:
a non-null Status ends the hook execution

Basket hooks for Shop API.


dw.ocapi.shop.basket.afterDELETE

DELETE /baskets/{basket_id}

Method details

afterDELETE (basketId : String) : dw.system.Status

The function is called after removing a basket.

Parameters:
basketId - the identifier of the removed basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.afterPATCH

PATCH /baskets/{basket_id}

Method details

afterPATCH (basket : dw.order.Basket, basketInput : Basket) : dw.system.Status

The function is called after updating of the basket.

Parameters:
basket - the basket that was updated
basketInput - the basket delta containing the desired changes
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.afterPOST

POST /baskets

Method details

afterPOST (basket : dw.order.Basket) : dw.system.Status

The function is called after the basket was created.

Parameters:
basket - the created basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.agent.afterPUT

PUT /baskets/{basket_id}/agent

Method details

afterPUT (basket : dw.order.Basket) : dw.system.Status

The function is called after a put of a basket as an agent basket.

Parameters:
basket - the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.agent.beforePUT

PUT /baskets/{basket_id}/agent

Method details

beforePUT (basketId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
basketId - the basket id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.agent.modifyPUTResponse

PUT /baskets/{basket_id}/agent

Method details

modifyPUTResponse (basket : dw.order.Basket, basketResponse : Basket) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.approaching_discounts.beforeGET

GET /baskets/{basket_id}/approaching_discounts

Method details

beforeGET (basketId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
basketId - the basket id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.approaching_discounts.modifyGETResponse

GET /baskets/{basket_id}/approaching_discounts

Method details

modifyGETResponse (approachingDiscountResultResponse : ApproachingDiscountResult) : dw.system.Status

Parameters:
approachingDiscountResultResponse - approaching discount result response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.beforeDELETE

DELETE /baskets/{basket_id}

Method details

beforeDELETE (basket : dw.order.Basket) : dw.system.Status

The function is called before removing a basket.

Parameters:
basket - the basket to be removed
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.beforeGET

GET /baskets/{basket_id}

Method details

beforeGET (basketId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
basketId - the basket id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.beforePATCH

PATCH /baskets/{basket_id}

Method details

beforePATCH (basket : dw.order.Basket, basketInput : Basket) : dw.system.Status

The function is called before updating of the basket.

Parameters:
basket - the basket to be updated
basketInput - the basket delta containing the desired changes
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.beforePOST_v2

POST /baskets

Method details

beforePOST_v2 (basketRequest : Basket) : dw.system.Status

The function is called before the request will be processed.

Parameters:
basketRequest - the basket request
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.billing_address.afterPUT

PUT /baskets/{basket_id}/billing_address

Method details

afterPUT (basket : dw.order.Basket, billingAddress : OrderAddress) : dw.system.Status

The function is called after setting of the billing address to the basket.

Parameters:
basket - the basket based on which the order is created
billingAddress - the billing address that was set to the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.billing_address.beforePUT

PUT /baskets/{basket_id}/billing_address

Method details

beforePUT (basket : dw.order.Basket, billingAddress : OrderAddress) : dw.system.Status

The function is called before setting of the billing address to the basket.

Parameters:
basket - the basket based on which the order is created
billingAddress - the billing address to be set to the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.billing_address.modifyPUTResponse

PUT /baskets/{basket_id}/billing_address

Method details

modifyPUTResponse (basket : dw.order.Basket, basketResponse : Basket, addressRequest : OrderAddress) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
addressRequest - address request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.coupon.afterDELETE

DELETE /baskets/{basket_id}/coupons/{coupon_item_id}

Method details

afterDELETE (basket : dw.order.Basket, couponItemID : String) : dw.system.Status

The function is called after removing a coupon from a basket.

Parameters:
basket - the basket the coupon get removed from
couponItemID - the coupon information
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.coupon.afterPOST

POST /baskets/{basket_id}/coupons

Method details

afterPOST (basket : dw.order.Basket, couponItem : CouponItem) : dw.system.Status

The function is called after adding a coupon to a basket.

Parameters:
basket - the basket the coupon get added to
couponItem - the coupon information
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.coupon.beforeDELETE

DELETE /baskets/{basket_id}/coupons/{coupon_item_id}

Method details

beforeDELETE (basket : dw.order.Basket, couponItemID : String) : dw.system.Status

The function is called before removing a coupon from a basket.

Parameters:
basket - the basket the coupon get removed from
couponItemID - the coupon information
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.coupon.beforePOST

POST /baskets/{basket_id}/coupons

Method details

beforePOST (basket : dw.order.Basket, couponItem : CouponItem) : dw.system.Status

The function is called before adding a coupon to a basket.

Parameters:
basket - the basket the coupon get added to
couponItem - the coupon information
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.coupon.modifyDELETEResponse

DELETE /baskets/{basket_id}/coupons/{coupon_item_id}

Method details

modifyDELETEResponse (basket : dw.order.Basket, basketResponse : Basket, couponItemId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
couponItemId - coupon item id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.coupon.modifyPOSTResponse

POST /baskets/{basket_id}/coupons

Method details

modifyPOSTResponse (basket : dw.order.Basket, basketResponse : Basket, couponRequest : CouponItem) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
couponRequest - coupon request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.customer.afterPUT

PUT /baskets/{basket_id}/customer

Method details

afterPUT (basket : dw.order.Basket, customerInfo : CustomerInfo) : dw.system.Status

The function is called after setting of customer information for the basket.

Parameters:
basket - the basket based on which the order is created
customerInfo - the customer information that were set to the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.customer.beforePUT

PUT /baskets/{basket_id}/customer

Method details

beforePUT (basket : dw.order.Basket, customerInfo : CustomerInfo) : dw.system.Status

The function is called before setting of customer information for the basket.

Parameters:
basket - the basket based on which the order is created
customerInfo - the customer information to be set to the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.customer.modifyPUTResponse

PUT /baskets/{basket_id}/customer

Method details

modifyPUTResponse (basket : dw.order.Basket, basketResponse : Basket, customerRequest : CustomerInfo) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
customerRequest - customer request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.gift_certificate_item.afterDELETE

DELETE /baskets/{basket_id}/gift_certificate_items/{gift_certificate_item_id}

Method details

afterDELETE (basket : dw.order.Basket, giftCertificateItemId : String) : dw.system.Status

The function is called after deleting a gift certificate item from a basket.

Parameters:
basket - the basket based on which the order is created
giftCertificateItemId - the id of the deleted gift certificate item
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.gift_certificate_item.afterPATCH

PATCH /baskets/{basket_id}/gift_certificate_items/{gift_certificate_item_id}

Method details

afterPATCH (basket : dw.order.Basket, giftCertificateItemId : String, item : GiftCertificateItem) : dw.system.Status

The function is called after updating a gift certificate item of a basket.

Parameters:
basket - the basket based on which the order is created
giftCertificateItemId - the id of the updated gift certificate item
item - the new gift certificate item data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.gift_certificate_item.afterPOST

POST /baskets/{basket_id}/gift_certificate_items

Method details

afterPOST (basket : dw.order.Basket, item : GiftCertificateItem) : dw.system.Status

The function is called after adding a gift certificate item to a basket.

Parameters:
basket - the basket based on which the order is created
item - the gift certificate item to add
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.gift_certificate_item.beforeDELETE

DELETE /baskets/{basket_id}/gift_certificate_items/{gift_certificate_item_id}

Method details

beforeDELETE (basket : dw.order.Basket, giftCertificateItemId : String) : dw.system.Status

The function is called before deleting a gift certificate item from a basket.

Parameters:
basket - the basket based on which the order is created
giftCertificateItemId - the id of the gift certificate item to be deleted
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.gift_certificate_item.beforePATCH

PATCH /baskets/{basket_id}/gift_certificate_items/{gift_certificate_item_id}

Method details

beforePATCH (basket : dw.order.Basket, giftCertificateItemId : String, item : GiftCertificateItem) : dw.system.Status

The function is called before updating a gift certificate item of a basket.

Parameters:
basket - the basket based on which the order is created
giftCertificateItemId - the id of the gift certificate item to be updated
item - the new gift certificate item data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.gift_certificate_item.beforePOST

POST /baskets/{basket_id}/gift_certificate_items

Method details

beforePOST (basket : dw.order.Basket, item : GiftCertificateItem) : dw.system.Status

The function is called before adding a gift certificate item to a basket.

Parameters:
basket - the basket based on which the order is created
item - the gift certificate item to add
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.gift_certificate_item.modifyDELETEResponse

DELETE /baskets/{basket_id}/gift_certificate_items/{gift_certificate_item_id}

Method details

modifyDELETEResponse (basket : dw.order.Basket, basketResponse : Basket, giftCertificateItemId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
giftCertificateItemId - the id of the deleted gift certificate item
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.gift_certificate_item.modifyPATCHResponse

PATCH /baskets/{basket_id}/gift_certificate_items/{gift_certificate_item_id}

Method details

modifyPATCHResponse (basket : dw.order.Basket, basketResponse : Basket, giftCertificateItemId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
giftCertificateItemId - the id of the updated gift certificate item
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.gift_certificate_item.modifyPOSTResponse

POST /baskets/{basket_id}/gift_certificate_items

Method details

modifyPOSTResponse (basket : dw.order.Basket, basketResponse : Basket, certificateItemRequest : GiftCertificateItem) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
certificateItemRequest - certificateItem request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.item.afterDELETE

DELETE /baskets/{basket_id}/items/{item_id}

Method details

afterDELETE (basket : dw.order.Basket, productItemId : String) : dw.system.Status

The function is called after a basket item is removed.

Parameters:
basket - the basket based on which the order is created
productItemId - the id of the removed product item
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.item.afterPATCH

PATCH /baskets/{basket_id}/items/{item_id}

Method details

afterPATCH (basket : dw.order.Basket, item : ProductItem) : dw.system.Status

The function is called after updating of the basket's item.

Parameters:
basket - the basket based on which the order is created
item - the product item delta containing the desired changes to the product item
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.item.beforeDELETE

DELETE /baskets/{basket_id}/items/{item_id}

Method details

beforeDELETE (basket : dw.order.Basket, productItemId : String) : dw.system.Status

The function is called before a basket item is removed.

Parameters:
basket - the basket based on which the order is created
productItemId - the id of the product item to be removed
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.item.beforePATCH

PATCH /baskets/{basket_id}/items/{item_id}

Method details

beforePATCH (basket : dw.order.Basket, item : ProductItem) : dw.system.Status

The function is called before updating of the basket's item.

Parameters:
basket - the basket based on which the order is created
item - the product item delta containing the desired changes to the product item
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.item.modifyDELETEResponse

DELETE /baskets/{basket_id}/items/{item_id}

Method details

modifyDELETEResponse (basket : dw.order.Basket, basketResponse : Basket, productItemId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
productItemId - productItemId request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.item.modifyPATCHResponse

PATCH /baskets/{basket_id}/items/{item_id}

Method details

modifyPATCHResponse (basket : dw.order.Basket, basketResponse : Basket, productItemId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
productItemId - productItemId request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.items.afterPOST

POST /baskets/{basket_id}/items

Method details

afterPOST (basket : dw.order.Basket, items : ProductItem) : dw.system.Status

Parameters:
basket - the target basket
items - productItems array of product items
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.items.beforePOST

POST /baskets/{basket_id}/items

Method details

beforePOST (basket : dw.order.Basket, items : ProductItem) : dw.system.Status

Parameters:
basket - the target basket
items - productItems array of product items
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.items.modifyPOSTResponse

POST /baskets/{basket_id}/items

Method details

modifyPOSTResponse (basket : dw.order.Basket, basketResponse : Basket, productItems : ProductItem) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
productItems - productItems array of product items
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.modifyGETResponse

GET /baskets/{basket_id}

Method details

modifyGETResponse (basket : dw.order.Basket, basketResponse : Basket) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.modifyPATCHResponse

PATCH /baskets/{basket_id}

Method details

modifyPATCHResponse (basket : dw.order.Basket, basketResponse : Basket) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.modifyPOSTResponse

POST /baskets

Method details

modifyPOSTResponse (basket : dw.order.Basket, basketResponse : Basket) : dw.system.Status

Parameters:
basket - the created basket
basketResponse - basket response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.note.afterDELETE

DELETE /baskets/{basket_id}/notes/{note_id}

Method details

afterDELETE (basket : dw.order.Basket, note : dw.object.Note) : dw.system.Status

The function is called after a note is deleted.

Parameters:
basket - the basket
note - the note to be removed
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.note.afterPOST

POST /baskets/{basket_id}/notes

Method details

afterPOST (basketId : String, note : Note) : dw.system.Status

The function is called after a note is added.

Parameters:
basket - the basket
note - the note to be added
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.note.beforeDELETE

DELETE /baskets/{basket_id}/notes/{note_id}

Method details

beforeDELETE (basket : dw.order.Basket, note : dw.object.Note) : dw.system.Status

The function is called before a note is deleted.

Parameters:
basket - the basket
note - the note to be removed
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.note.beforePOST

POST /baskets/{basket_id}/notes

Method details

beforePOST (basketId : String, note : Note) : dw.system.Status

The function is called before a note is added.

Parameters:
basketId - the basket
note - the note to be added
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.note.modifyDELETEResponse

DELETE /baskets/{basket_id}/notes/{note_id}

Method details

modifyDELETEResponse (basket : dw.order.Basket, basketResponse : Basket, noteId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
noteId - deleted note id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.note.modifyPOSTResponse

POST /baskets/{basket_id}/notes

Method details

modifyPOSTResponse (basket : dw.order.Basket, basketResponse : Basket, noteRequest : Note) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
noteRequest - note request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.notes.beforeGET

GET /baskets/{basket_id}/notes

Method details

beforeGET (basketId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
basketId - the basket id the notes result retrieved for.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.notes.modifyGETResponse_v2

GET /baskets/{basket_id}/notes

Method details

modifyGETResponse_v2 (basket : dw.order.Basket, notesResponse : NotesResult) : dw.system.Status

Parameters:
basket - the basket the notes result retrieved for.
notesResponse - notes response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_instrument.afterDELETE

DELETE /baskets/{basket_id}/payment_instruments/{payment_instrument_id}

Method details

afterDELETE (basket : dw.order.Basket) : dw.system.Status

It is called after the order payment instrument is removed from the basket.

Parameters:
basket - the basket the payment instrument was removed from
paymentInstrument - the payment instrument to be deleted
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_instrument.afterPATCH

PATCH /baskets/{basket_id}/payment_instruments/{payment_instrument_id}

Method details

afterPATCH (basket : dw.order.Basket, paymentInstrument : dw.order.OrderPaymentInstrument, paymentInstrumentRequest : BasketPaymentInstrumentRequest) : dw.system.Status

The function is called after updating a payment instrument of a basket.

Parameters:
basket - the basket based on which the order is created
paymentInstrument - the updated payment instrument
paymentInstrumentRequest - the new payment instrument data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_instrument.afterPOST

POST /baskets/{basket_id}/payment_instruments

Method details

afterPOST (basket : dw.order.Basket, paymentInstrument : BasketPaymentInstrumentRequest) : dw.system.Status

The function is called after payment instrument adding to a basket.

Parameters:
basket - the basket based on which the order is created
paymentInstrument - the payment instrument added to the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_instrument.beforeDELETE

DELETE /baskets/{basket_id}/payment_instruments/{payment_instrument_id}

Method details

beforeDELETE (basket : dw.order.Basket, delete : dw.order.OrderPaymentInstrument) : dw.system.Status

It is called before the order payment instrument is removed from the basket.

Parameters:
basket - the basket to remove the payment instrument from
delete - the order payment instrument document.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_instrument.beforePATCH

PATCH /baskets/{basket_id}/payment_instruments/{payment_instrument_id}

Method details

beforePATCH (basket : dw.order.Basket, paymentInstrument : dw.order.OrderPaymentInstrument, newPaymentInstrument : BasketPaymentInstrumentRequest) : dw.system.Status

The function is called before updating a payment instrument of a basket.

Parameters:
basket - the basket based on which the order is created
paymentInstrument - the payment instrument to be updated
newPaymentInstrument - the new payment instrument data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_instrument.beforePOST

POST /baskets/{basket_id}/payment_instruments

Method details

beforePOST (basket : dw.order.Basket, paymentInstrument : BasketPaymentInstrumentRequest) : dw.system.Status

The function is called before payment instrument adding to a basket.

Parameters:
basket - the basket based on which the order is created
paymentInstrument - the payment instrument to be added to the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_instrument.modifyDELETEResponse

DELETE /baskets/{basket_id}/payment_instruments/{payment_instrument_id}

Method details

modifyDELETEResponse (basket : dw.order.Basket, basketResponse : Basket, paymentInstrumentId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
paymentInstrumentRequest - payment instrument id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_instrument.modifyPATCHResponse

PATCH /baskets/{basket_id}/payment_instruments/{payment_instrument_id}

Method details

modifyPATCHResponse (basket : dw.order.Basket, basketResponse : Basket, paymentInstrumentId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
paymentInstrumentRequest - payment instrument id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_instrument.modifyPOSTResponse

POST /baskets/{basket_id}/payment_instruments

Method details

modifyPOSTResponse (basket : dw.order.Basket, basketResponse : Basket, paymentInstrumentRequest : BasketPaymentInstrumentRequest) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
paymentInstrumentRequest - payment instrument request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_methods.afterGET

GET /baskets/{basket_id}/payment_methods

Method details

afterGET (basket : dw.order.Basket, paymentMethods : PaymentMethodResult) : dw.system.Status

Called before returning the list of available payment methods to the customer. Allowing modifications of the result.

Parameters:
basket - the basket
paymentMethods - the available payment methods
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_methods.beforeGET

GET /baskets/{basket_id}/payment_methods

Method details

beforeGET (basketId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
basketId - the basket id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.payment_methods.modifyGETResponse_v2

GET /baskets/{basket_id}/payment_methods

Method details

modifyGETResponse_v2 (basket : dw.order.Basket, paymentMethodResultResponse : PaymentMethodResult) : dw.system.Status

Parameters:
basket - the basket the payment method result retrieved for.
paymentMethodResultResponse - paymentMethodResult response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.price_adjustment.afterDELETE

DELETE /baskets/{basket_id}/price_adjustments/{price_adjustment_id}

Method details

afterDELETE (basket : dw.order.Basket, priceAdjustmentId : String) : dw.system.Status

The function is called after a custom price adjustment was removed.

Parameters:
basket - the basket
priceAdjustmentId - the id of the deleted price adjustment
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.price_adjustment.afterPATCH

PATCH /baskets/{basket_id}/price_adjustments/{price_adjustment_id}

Method details

afterPATCH (basket : dw.order.Basket, priceAdjustmentId : String, priceAdjustmentWO : PriceAdjustment) : dw.system.Status

The function is called after a custom price adjustment was updated.

Parameters:
basket - the basket
priceAdjustmentId - the id of the updated price adjustment
priceAdjustmentWO - the new price adjustment data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.price_adjustment.afterPOST

POST /baskets/{basket_id}/price_adjustments

Method details

afterPOST (basket : dw.order.Basket, request : PriceAdjustmentRequest) : dw.system.Status

The function is called after a custom price adjustment was added.

Parameters:
basket - the basket
request - The request for the price adjustment
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.price_adjustment.beforeDELETE

DELETE /baskets/{basket_id}/price_adjustments/{price_adjustment_id}

Method details

beforeDELETE (basket : dw.order.Basket, priceAdjustmentId : String) : dw.system.Status

The function is called before a custom price adjustment is removed.

Parameters:
basket - the basket
priceAdjustmentId - the id of the price adjustment to be deleted
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.price_adjustment.beforePATCH

PATCH /baskets/{basket_id}/price_adjustments/{price_adjustment_id}

Method details

beforePATCH (basket : dw.order.Basket, priceAdjustmentId : String, priceAdjustmentWO : PriceAdjustment) : dw.system.Status

The function is called before a custom price adjustment is updated.

Parameters:
basket - the basket
priceAdjustmentId - the id of the price adjustment to be updated
priceAdjustmentWO - the new price adjustment data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.price_adjustment.beforePOST

POST /baskets/{basket_id}/price_adjustments

Method details

beforePOST (basket : dw.order.Basket, request : PriceAdjustmentRequest) : dw.system.Status

The function is called before a custom price adjustment is added.

Parameters:
basket - the basket
request - The request for the price adjustment
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.price_adjustment.modifyDELETEResponse

DELETE /baskets/{basket_id}/price_adjustments/{price_adjustment_id}

Method details

modifyDELETEResponse (basket : dw.order.Basket, basketResponse : Basket, priceAdjustmentId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
priceAdjustmentId - price adjustment id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.price_adjustment.modifyPATCHResponse

PATCH /baskets/{basket_id}/price_adjustments/{price_adjustment_id}

Method details

modifyPATCHResponse (basket : dw.order.Basket, basketResponse : Basket, priceAdjustmentId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
priceAdjustmentId - price adjustment id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.price_adjustment.modifyPOSTResponse

POST /baskets/{basket_id}/price_adjustments

Method details

modifyPOSTResponse (basket : dw.order.Basket, basketResponse : Basket, priceAdjustmentRequest : PriceAdjustmentRequest) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
priceAdjustmentRequest - price adjustment request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.reference.afterPOST

POST /baskets/reference

Method details

afterPOST (sourceBasket : dw.order.Basket, basket : dw.order.Basket, request : BasketReference) : dw.system.Status

Parameters:
sourceBasket - the basket to copy the data from
basket - the created basket
basketReferenceRequest - the basket reference input document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.reference.beforePOST

POST /baskets/reference

Method details

beforePOST (sourceBasket : dw.order.Basket, request : BasketReference) : dw.system.Status

Parameters:
sourceBasket - the basket to copy the data from
basketReferenceRequest - the basket reference input document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.reference.modifyPOSTResponse

POST /baskets/reference

Method details

modifyPOSTResponse (basket : dw.order.Basket, basketResponse : Basket, basketReferenceRequest : BasketReference) : dw.system.Status

Parameters:
basket - the created basket
basketResponse - the basket response object
basketReferenceRequest - the basket reference input document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.afterDELETE

DELETE /baskets/{basket_id}/shipments/{shipment_id}

Method details

afterDELETE (basket : dw.order.Basket, shipmentId : String) : dw.system.Status

Called after the basket's shipment was removed.

Parameters:
basket - the basket that was updated
shipmentId - the id of the deleted shipment
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.afterPATCH

PATCH /baskets/{basket_id}/shipments/{shipment_id}

Method details

afterPATCH (basket : dw.order.Basket, shipment : dw.order.Shipment, shipmentInfo : Shipment) : dw.system.Status

The function is called after patching of a shipment for a basket.

Parameters:
basket - the basket based on which the shipment was changed
shipment - the shipment that has been updated
shipmentInfo - the shipment information for the shipment update
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.afterPOST

POST /baskets/{basket_id}/shipments

Method details

afterPOST (basket : dw.order.Basket, shipment : Shipment) : dw.system.Status

The function is called after the creation of a shipment for a basket.

Parameters:
basket - the basket based on which the shipment was created
shipment - the shipment information for the shipment creation
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.beforeDELETE

DELETE /baskets/{basket_id}/shipments/{shipment_id}

Method details

beforeDELETE (basket : dw.order.Basket, shipment : dw.order.Shipment) : dw.system.Status

Called before the basket's shipment is removed.

Parameters:
basket - the basket to be updated
shipment - the shipment to be deleted
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.beforePATCH

PATCH /baskets/{basket_id}/shipments/{shipment_id}

Method details

beforePATCH (basket : dw.order.Basket, shipment : dw.order.Shipment, shipmentInfo : Shipment) : dw.system.Status

The function is called before changing of a shipment for a basket.

Parameters:
basket - the basket based on which the shipment will be updated
shipment - the current shipment to be updated
shipmentInfo - the shipment information for the shipment update (update data)
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.beforePOST

POST /baskets/{basket_id}/shipments

Method details

beforePOST (basket : dw.order.Basket, shipment : Shipment) : dw.system.Status

The function is called before the creation of a shipment for a basket.

Parameters:
basket - the basket based on which the shipment will be created
shipment - the shipment information for the shipment creation
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.modifyDELETEResponse

DELETE /baskets/{basket_id}/shipments/{shipment_id}

Method details

modifyDELETEResponse (basket : dw.order.Basket, basketResponse : Basket, shipmentId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
shipmentId - shipment id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.modifyPATCHResponse

PATCH /baskets/{basket_id}/shipments/{shipment_id}

Method details

modifyPATCHResponse (basket : dw.order.Basket, basketResponse : Basket, shipmentId : String) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
shipmentId - shipment id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.modifyPOSTResponse

POST /baskets/{basket_id}/shipments

Method details

modifyPOSTResponse (basket : dw.order.Basket, basketResponse : Basket, shipmentRequest : Shipment) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
shipmentRequest - shipment request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.shipping_address.afterPUT

PUT /baskets/{basket_id}/shipments/{shipment_id}/shipping_address

Method details

afterPUT (basket : dw.order.Basket, shipment : dw.order.Shipment, shippingAddress : OrderAddress) : dw.system.Status

The function is called after setting of the shipping address to a certain shipment of the basket.

Parameters:
basket - the basket based on which the order is created
shipment - the shipment information for the shipment creation
shippingAddress - the shipping address that was set to the shipment
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.shipping_address.beforePUT

PUT /baskets/{basket_id}/shipments/{shipment_id}/shipping_address

Method details

beforePUT (basket : dw.order.Basket, shipment : dw.order.Shipment, shippingAddress : OrderAddress) : dw.system.Status

The function is called before setting of the shipping address to a certain shipment of the basket.

Parameters:
basket - the basket based on which the order is created
shipment - the shipment information for the shipment creation
shippingAddress - the shipping address to be set to the shipment
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.shipping_address.modifyPUTResponse

PUT /baskets/{basket_id}/shipments/{shipment_id}/shipping_address

Method details

modifyPUTResponse (basket : dw.order.Basket, basketResponse : Basket, orderAddressRequest : OrderAddress) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
orderAddressRequest - order address request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.shipping_method.afterPUT

PUT /baskets/{basket_id}/shipments/{shipment_id}/shipping_method

Method details

afterPUT (basket : dw.order.Basket, shipment : dw.order.Shipment, shippingMethod : ShippingMethod) : dw.system.Status

The function is called after setting of the shipping method to a certain shipment of the basket.

Parameters:
basket - the basket based on which the order is created
shipment - the shipment information for the shipment creation
shippingMethod - the shipping method that was set to the shipment
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.shipping_method.beforePUT

PUT /baskets/{basket_id}/shipments/{shipment_id}/shipping_method

Method details

beforePUT (basket : dw.order.Basket, shipment : dw.order.Shipment, shippingMethod : ShippingMethod) : dw.system.Status

The function is called before setting of the shipping method to a certain shipment of the basket.

Parameters:
basket - the basket based on which the order is created
shipment - the shipment information for the shipment creation
shippingMethod - the shipping method to be set to the shipment
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipment.shipping_method.modifyPUTResponse

PUT /baskets/{basket_id}/shipments/{shipment_id}/shipping_method

Method details

modifyPUTResponse (basket : dw.order.Basket, basketResponse : Basket, shippingMethodRequest : ShippingMethod) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
shippingMethodRequest - shipping method request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipments.shipping_methods.beforeGET

GET /baskets/{basket_id}/shipments/{shipment_id}/shipping_methods

Method details

beforeGET (basketId : String, shipmentId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
basketId - the target basket id
shipmentId - the shipment id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.shipments.shipping_methods.modifyGETResponse_v2

GET /baskets/{basket_id}/shipments/{shipment_id}/shipping_methods

Method details

modifyGETResponse_v2 (shipment : dw.order.Shipment, shippingMethodResult : ShippingMethodResult) : dw.system.Status

Parameters:
shipment - the shipment the shipping methods result retrieved for.
shippingMethodResult - shipping method result object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.storefront.afterPUT

PUT /baskets/{basket_id}/storefront

Method details

afterPUT (basket : dw.order.Basket) : dw.system.Status

The function is called after a put of a basket as storefront basket.

Parameters:
basket - the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.storefront.beforePUT

PUT /baskets/{basket_id}/storefront

Method details

beforePUT (basketId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
basket - the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.storefront.modifyPUTResponse

PUT /baskets/{basket_id}/storefront

Method details

modifyPUTResponse (basket : dw.order.Basket, basketResponse : Basket) : dw.system.Status

Parameters:
basket - the target basket
basketResponse - basket response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

DELETE /baskets/{basket_id}/coupons/{coupon_item_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

DELETE /baskets/{basket_id}/items/{item_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

DELETE /baskets/{basket_id}/notes/{note_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

DELETE /baskets/{basket_id}/payment_instruments/{payment_instrument_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

DELETE /baskets/{basket_id}/price_adjustments/{price_adjustment_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

DELETE /baskets/{basket_id}/shipments/{shipment_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

GET /baskets/{basket_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

PATCH /baskets/{basket_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

PATCH /baskets/{basket_id}/items/{item_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

PATCH /baskets/{basket_id}/payment_instruments/{payment_instrument_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

PATCH /baskets/{basket_id}/shipments/{shipment_id}

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

POST /baskets

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

POST /baskets/{basket_id}/coupons

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

POST /baskets/{basket_id}/gift_certificate_items

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

POST /baskets/{basket_id}/items

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

POST /baskets/{basket_id}/notes

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

POST /baskets/{basket_id}/payment_instruments

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

POST /baskets/{basket_id}/price_adjustments

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

POST /baskets/{basket_id}/shipments

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

POST /orders

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

PUT /baskets/{basket_id}/billing_address

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

PUT /baskets/{basket_id}/customer

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

PUT /baskets/{basket_id}/shipments/{shipment_id}/shipping_address

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.basket.validateBasket

PUT /baskets/{basket_id}/shipments/{shipment_id}/shipping_method

Method details

validateBasket (basketResponse : Basket, duringSubmit : boolean) : dw.system.Status

Allows the addition of custom flashes or removal of internal flashes. The presence of a flash indicates that the basket cannot yet be submitted. Parameter duringSubmit indicates the current call is during the basket submit process. Default implementation returns ERROR if duringSubmit and any flash exists.

Example showing addition, listing, and removal of flashes:

Parameters:
basketResponse - the basket response to be validated, before any OCAPI property selection is applied
duringSubmit - should the basket be checked for submit
Returns:
a non-null Status ends the hook execution

Category hooks for Shop API.


dw.ocapi.shop.category.beforeGET

GET /categories/({id},...,{id})

Method details

beforeGET (categoryId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
categoryId - the id of the category
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.category.beforeGET

GET /categories/{id}

Method details

beforeGET (categoryId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
categoryId - the id of the category
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.category.modifyGETResponse

GET /categories/({id},...,{id})

Method details

modifyGETResponse (scriptCategory : dw.catalog.Category, doc : Category) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptCategory - an instance of dw.catalog.Category
doc - the document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.category.modifyGETResponse

GET /categories/{id}

Method details

modifyGETResponse (scriptCategory : dw.catalog.Category, doc : Category) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptCategory - an instance of dw.catalog.Category
doc - the document
Returns:
a non-null Status ends the hook execution

Content hooks for Shop API.


dw.ocapi.shop.content.beforeGET

GET /content/({id},...,{id})

Method details

beforeGET (contentId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
contentId - the id of the content assert
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.content.beforeGET

GET /content/{id}

Method details

beforeGET (contentId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
contentId - the id of the content assert
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.content.modifyGETResponse

GET /content/({id},...,{id})

Method details

modifyGETResponse (scriptContent : dw.content.Content, doc : Content) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptContent - an instance of dw.content.Content
doc - the document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.content.modifyGETResponse

GET /content/{id}

Method details

modifyGETResponse (scriptContent : dw.content.Content, doc : Content) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptContent - an instance of dw.content.Content
doc - the document
Returns:
a non-null Status ends the hook execution

Content search hooks for Shop API.


dw.ocapi.shop.content_search.beforeGET

GET /content_search

Method details

beforeGET () : dw.system.Status

The function is called before the request will be processed.

Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.content_search.modifyGETResponse

GET /content_search

Method details

modifyGETResponse (doc : ContentSearchResult) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution

Custom object hooks for Shop API.


dw.ocapi.shop.custom_object.beforeGET

GET /custom_objects/{object_type}/{key}

Method details

beforeGET (objectType : String, key : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
objectType - the ID of the object type
key - the key attribute value of the custom object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.custom_object.modifyGETResponse

GET /custom_objects/{object_type}/{key}

Method details

modifyGETResponse (scriptCustomObject : dw.object.CustomObject, doc : CustomObject) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptCustomObject - an instance of dw.object.CustomObject
doc - the document
Returns:
a non-null Status ends the hook execution

Customer hooks for Shop API.


dw.ocapi.shop.customer.afterPATCH

PATCH /customers/{customer_id}

Method details

afterPATCH (customer : dw.customer.Customer, customerInput : Customer) : dw.system.Status

The function is called after a customer was updated.

Parameters:
customer - the customer to be updated
customerInput - the input customer containing the patch changes
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.afterPOST

POST /customers

Method details

afterPOST (customer : dw.customer.Customer, registration : CustomerRegistration) : dw.system.Status

The function is called after a new customer registration.

Parameters:
customer - the registered customer
registration - the customer registration information
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.auth.afterPOST

POST /customers/{customer_id}/auth

Method details

afterPOST (customer : dw.customer.Customer) : dw.system.Status

The function is called after the customer has been authenticated.

Parameters:
customer - the customer that is authenticated
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.auth.beforePOST

POST /customers/{customer_id}/auth

Method details

beforePOST (customer : dw.customer.Customer) : dw.system.Status

The function is called before the customer has been authenticated.

Parameters:
customer - the customer that is authenticated
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.auth.modifyPOSTResponse

POST /customers/{customer_id}/auth

Method details

modifyPOSTResponse (customer : dw.customer.Customer, customerResponse : Customer) : dw.system.Status

Parameters:
customer - target customer
customerResponse - customer response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.baskets.beforeGET

GET /customers/{customer_id}/baskets

Method details

beforeGET (customerId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - the customer id the baskets result retrieved for.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.baskets.modifyGETResponse_v2

GET /customers/{customer_id}/baskets

Method details

modifyGETResponse_v2 (customer : dw.customer.Customer, customerBasketsResultResponse : BasketsResult) : dw.system.Status

Parameters:
customer - the customer the baskets result retrieved for.
customerBasketsResultResponse - customer basket result response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.beforeGET

GET /customers/{customer_id}

Method details

beforeGET (customerId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - The customer id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.beforePATCH

PATCH /customers/{customer_id}

Method details

beforePATCH (customer : dw.customer.Customer, customerInput : Customer) : dw.system.Status

The function is called before a customer is updated.

Parameters:
customer - the customer to be updated
customerInput - the input customer containing the patch changes
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.beforePOST

POST /customers

Method details

beforePOST (registration : CustomerRegistration) : dw.system.Status

The function is called before a new customer registration.

Parameters:
registration - the customer registration information
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.modifyGETResponse

GET /customers/{customer_id}

Method details

modifyGETResponse (customer : dw.customer.Customer, customerResponse : Customer) : dw.system.Status

Parameters:
customer - target customer
customerResponse - customer response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.modifyPATCHResponse

PATCH /customers/{customer_id}

Method details

modifyPATCHResponse (customer : dw.customer.Customer, customerResponse : Customer) : dw.system.Status

Parameters:
customer - target customer
customerResponse - customer response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.modifyPOSTResponse

POST /customers

Method details

modifyPOSTResponse (customer : dw.customer.Customer, customerResponse : Customer) : dw.system.Status

Parameters:
customer - created customer
customerResponse - customer response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.orders.beforeGET

GET /customers/{customer_id}/orders

Method details

beforeGET (customerId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - the customer id the orders are retrieved for.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.orders.modifyGETResponse_v2

GET /customers/{customer_id}/orders

Method details

modifyGETResponse_v2 (customer : dw.customer.Customer, customerOrderResultResponse : CustomerOrderResult) : dw.system.Status

Parameters:
customer - the customer the orders are retrieved for.
customerOrderResultResponse - customer order result response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.password_reset.afterPOST

POST /customers/{customer_id}/password_reset

Method details

afterPOST (customer : dw.customer.Customer, resetToken : String) : dw.system.Status

Allows resetting a customer password. See the example below sending an email with a password reset link.

Parameters:
customer - the customer for whom to reset the password
resetToken - the token generated by the system to be used for the reset
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.password_reset.beforePOST

POST /customers/{customer_id}/password_reset

Method details

beforePOST (customer : dw.customer.Customer) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customer - the customer for whom to reset the password
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.payment_instrument.afterDELETE

DELETE /customers/{customer_id}/payment_instruments/{payment_instrument_id}

Method details

afterDELETE (customer : dw.customer.Customer, paymentInstrumentId : String) : dw.system.Status

The function is called after removing a payment instrument of a customer.

Parameters:
customer - the customer for whom to delete the payment instrument
paymentInstrumentId - the id of the payment instrument that was deleted
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.payment_instrument.afterPOST

POST /customers/{customer_id}/payment_instruments

Method details

afterPOST (customer : dw.customer.Customer, paymentInstrument : CustomerPaymentInstrumentRequest) : dw.system.Status

The function is called after a payment instrument was added to a customer.

Parameters:
customer - the customer for whom to add the payment instrument
paymentInstrument - the payment instrument that was added
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.payment_instrument.beforeDELETE

DELETE /customers/{customer_id}/payment_instruments/{payment_instrument_id}

Method details

beforeDELETE (customer : dw.customer.Customer, paymentInstrumentId : String) : dw.system.Status

The function is called before removing a payment instrument of a customer.

Parameters:
customer - the customer for whom to delete the payment instrument
paymentInstrumentId - the id of the payment instrument to be deleted
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.payment_instrument.beforeGET

GET /customers/{customer_id}/payment_instruments/{payment_instrument_id}

Method details

beforeGET (customerId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - target customer id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.payment_instrument.beforePOST

POST /customers/{customer_id}/payment_instruments

Method details

beforePOST (customer : dw.customer.Customer, paymentInstrument : CustomerPaymentInstrumentRequest) : dw.system.Status

The function is called before a payment instrument is added to a customer.

Parameters:
customer - the customer for whom to add the payment instrument
paymentInstrument - the payment instrument to be added
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.payment_instrument.modifyGETResponse

GET /customers/{customer_id}/payment_instruments/{payment_instrument_id}

Method details

modifyGETResponse (customer : dw.customer.Customer, customerPaymentInstrument : dw.customer.CustomerPaymentInstrument, customerPaymentInstrumentResponse : CustomerPaymentInstrument) : dw.system.Status

Parameters:
customer - target customer
customerPaymentInstrument - payment instrument
customerPaymentInstrumentResponse - customer payment instrument response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.payment_instrument.modifyPOSTResponse

POST /customers/{customer_id}/payment_instruments

Method details

modifyPOSTResponse (customer : dw.customer.Customer, customerPaymentInstrument : dw.customer.CustomerPaymentInstrument, customerPaymentInstrumentResponse : CustomerPaymentInstrument) : dw.system.Status

Parameters:
Customer - target customer
customerPaymentInstrument - payment instrument
customerPaymentInstrumentResponse - customer payment instrument response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.payment_instruments.beforeGET

GET /customers/{customer_id}/payment_instruments

Method details

beforeGET (customerId : String, paymentMethodId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - the customer id the customer payment instruments result retrieved for.
paymentMethodId - the id of the payment method, if null - all payment instruments are retrieved
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.payment_instruments.modifyGETResponse_v2

GET /customers/{customer_id}/payment_instruments

Method details

modifyGETResponse_v2 (customer : dw.customer.Customer, customerPaymentInstrumentResultResponse : CustomerPaymentInstrumentResult) : dw.system.Status

Parameters:
customer - the customer the customer payment instruments result retrieved for.
customerPaymentInstrumentResultResponse - customer payment instrument result response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.afterDELETE

DELETE /customers/{customer_id}/product_lists/{list_id}

Method details

afterDELETE (customer : dw.customer.Customer, productListId : String) : dw.system.Status

The function is called after a customer product list is deleted.

Parameters:
customer - the customer
productListId - the product list id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.afterPATCH

PATCH /customers/{customer_id}/product_lists/{list_id}

Method details

afterPATCH (customer : dw.customer.Customer, productList : CustomerProductList) : dw.system.Status

The function is called after modifying a customer product list.

Parameters:
customer - the customer
productList - the product list
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.beforeDELETE

DELETE /customers/{customer_id}/product_lists/{list_id}

Method details

beforeDELETE (customer : dw.customer.Customer, productList : dw.customer.ProductList) : dw.system.Status

The function is called before a customer product list is deleted.

Parameters:
customer - the customer
productList - the product list
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.beforeGET

GET /customers/{customer_id}/product_lists/{list_id}

Method details

beforeGET (customerId : String, productListId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - The customer id.
productListId - The product list id.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.beforePATCH

PATCH /customers/{customer_id}/product_lists/{list_id}

Method details

beforePATCH (customer : dw.customer.Customer, productList : CustomerProductList) : dw.system.Status

The function is called before modifying a customer product list.

Parameters:
customer - the customer
productList - the product list
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.afterDELETE

DELETE /customers/{customer_id}/product_lists/{list_id}/items/{item_id}

Method details

afterDELETE (customer : dw.customer.Customer, productList : dw.customer.ProductList, itemId : String) : dw.system.Status

The function is called after deleting an item from a customer product list.

Parameters:
customer - the customer
productList - the product list
itemId - the id of the deleted item
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.afterPATCH

PATCH /customers/{customer_id}/product_lists/{list_id}/items/{item_id}

Method details

afterPATCH (customer : dw.customer.Customer, productList : dw.customer.ProductList, item : CustomerProductListItem) : dw.system.Status

The function is called after updating an item of a customer product list.

Parameters:
customer - the customer
productList - the product list
item - the updated item
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.beforeDELETE

DELETE /customers/{customer_id}/product_lists/{list_id}/items/{item_id}

Method details

beforeDELETE (customer : dw.customer.Customer, productList : dw.customer.ProductList, item : dw.customer.ProductListItem) : dw.system.Status

The function is called before deleting an item from a customer product list.

Parameters:
customer - the customer
productList - the product list
item - the product list item to delete
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.beforeGET

GET /customers/{customer_id}/product_lists/{list_id}/items/{item_id}

Method details

beforeGET (customerId : String, productListId : String, productListItemId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - target customer id
productListId - the customers product list id the product list item purchase result retrieved for.
productListItemId - the product list id item the product list item purchase result retrieved for.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.beforePATCH

PATCH /customers/{customer_id}/product_lists/{list_id}/items/{item_id}

Method details

beforePATCH (customer : dw.customer.Customer, productList : dw.customer.ProductList, item : CustomerProductListItem) : dw.system.Status

The function is called before updating an item of a customer product list.

Parameters:
customer - the customer
productList - the product list
item - the product list item to update
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.modifyGETResponse

GET /customers/{customer_id}/product_lists/{list_id}/items/{item_id}

Method details

modifyGETResponse (customer : dw.customer.Customer, productListItem : dw.customer.ProductListItem, customerProductListItemResponse : CustomerProductListItem) : dw.system.Status

Parameters:
customer - target customer
productListItem - target product list item
customerProductListItemResponse - customer product list item response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.modifyPATCHResponse

PATCH /customers/{customer_id}/product_lists/{list_id}/items/{item_id}

Method details

modifyPATCHResponse (customer : dw.customer.Customer, productList : dw.customer.ProductList, customerProductListItemResponse : CustomerProductListItem, customerProductListItemRequest : CustomerProductListItem) : dw.system.Status

Parameters:
customer - target customer
productList - target product list
customerProductListItemRequest - customer product list item request object
customerProductListItemResponse - customer product list item response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.modifyPOSTResponse

POST /customers/{customer_id}/product_lists/{list_id}/items

Method details

modifyPOSTResponse (customer : dw.customer.Customer, productList : dw.customer.ProductList, customerProductListItemResponse : CustomerProductListItem, customerProductListItemRequest : CustomerProductListItem) : dw.system.Status

Parameters:
customer - target customer
productList - target product list
customerProductListItemResponse - customer product list item response object
customerProductListItemRequest - customer product list item request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.purchase.afterPATCH

PATCH /customers/{customer_id}/product_lists/{list_id}/items/{item_id}/purchases/{purchase_id}

Method details

afterPATCH (customer : dw.customer.Customer, productList : dw.customer.ProductList, productListItem : dw.customer.ProductListItem, purchase : CustomerProductListItemPurchase) : dw.system.Status

The function is called after updating a purchase of a customer product list item.

Parameters:
customer - the customer
productList - the product list
productListItem - the product list item
purchase - the updated purchase
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.purchase.beforeGET

GET /customers/{customer_id}/product_lists/{list_id}/items/{item_id}/purchases/{purchase_id}

Method details

beforeGET (customerId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - target customer id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.purchase.beforePATCH

PATCH /customers/{customer_id}/product_lists/{list_id}/items/{item_id}/purchases/{purchase_id}

Method details

beforePATCH (customer : dw.customer.Customer, productList : dw.customer.ProductList, productListItem : dw.customer.ProductListItem, purchase : CustomerProductListItemPurchase) : dw.system.Status

The function is called before updating a purchase of a customer product list item.

Parameters:
customer - the customer
productList - the product list
productListItem - the product list item
purchase - the product list item purchase to update
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.purchase.modifyGETResponse

GET /customers/{customer_id}/product_lists/{list_id}/items/{item_id}/purchases/{purchase_id}

Method details

modifyGETResponse (customer : dw.customer.Customer, productListItemPurchase : dw.customer.ProductListItemPurchase, customerProductListItemPurchaseResponse : CustomerProductListItemPurchase) : dw.system.Status

Parameters:
customer - target customer
productListItemPurchase - target product list item purchase
customerProductListItemPurchaseResponse - customer product list item purchase response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.purchase.modifyPATCHResponse

PATCH /customers/{customer_id}/product_lists/{list_id}/items/{item_id}/purchases/{purchase_id}

Method details

modifyPATCHResponse (customer : dw.customer.Customer, productList : dw.customer.ProductList, productListItem : dw.customer.ProductListItem, customerProductListItemPurchaseResponse : CustomerProductListItemPurchase, customerProductListItemPurchaseRequest : CustomerProductListItemPurchase) : dw.system.Status

Parameters:
customer - target customer
productList - target product list
productListItem - target product list item
customerProductListItemPurchaseRequest - customer product list item purchase request object
customerProductListItemPurchaseResponse - customer product list item purchase response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.purchases.afterPOST

POST /customers/{customer_id}/product_lists/{list_id}/items/{item_id}/purchases

Method details

afterPOST (customer : dw.customer.Customer, productList : dw.customer.ProductList, productListItem : dw.customer.ProductListItem, purchase : CustomerProductListItemPurchase) : dw.system.Status

The function is called after adding a purchase to a customer product list item.

Parameters:
customer - the customer
productList - the product list
productListItem - the product list item
purchase - the item added to the customer product list
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.purchases.beforeGET

GET /customers/{customer_id}/product_lists/{list_id}/items/{item_id}/purchases

Method details

beforeGET (customerId : String, listId : String, itemId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - the customer id the product list item purchase result retrieved for.
listId - the customers product list id the product list item purchase result retrieved for.
itemId - the product list id item the product list item purchase result retrieved for.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.purchases.beforePOST

POST /customers/{customer_id}/product_lists/{list_id}/items/{item_id}/purchases

Method details

beforePOST (customer : dw.customer.Customer, productList : dw.customer.ProductList, productListItem : dw.customer.ProductListItem, purchase : CustomerProductListItemPurchase) : dw.system.Status

The function is called before adding a purchase to a customer product list item.

Parameters:
customer - the customer
productList - the product list
productListItem - the product list item
purchase - the purchase to add to the customer product list item
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.purchases.modifyGETResponse_v2

GET /customers/{customer_id}/product_lists/{list_id}/items/{item_id}/purchases

Method details

modifyGETResponse_v2 (customer : dw.customer.Customer, productList : dw.customer.ProductList, productListItem : dw.customer.ProductListItem, customerProductListItemPurchaseResultResponse : CustomerProductListItemPurchaseResult) : dw.system.Status

Parameters:
customer - the customer the product list item purchase result retrieved for.
productList - the customers product list the product list item purchase result retrieved for.
productListItem - the product list item the product list item purchase result retrieved for.
customerProductListItemPurchaseResultResponse - customer product list item purchase result response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.item.purchases.modifyPOSTResponse

POST /customers/{customer_id}/product_lists/{list_id}/items/{item_id}/purchases

Method details

modifyPOSTResponse (customer : dw.customer.Customer, productList : dw.customer.ProductList, productListItem : dw.customer.ProductListItem, customerProductListItemPurchaseResponse : CustomerProductListItemPurchase, customerProductListItemPurchaseRequest : CustomerProductListItemPurchase) : dw.system.Status

Parameters:
customer - target customer
productList - target product list
productListItem - target product list item
customerProductListItemPurchaseResponse - customer product list item purchase response object
customerProductListItemPurchaseRequest - customer product list item purchase request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.items.afterPOST

POST /customers/{customer_id}/product_lists/{list_id}/items

Method details

afterPOST (customer : dw.customer.Customer, productList : dw.customer.ProductList, item : CustomerProductListItem) : dw.system.Status

The function is called after adding an item to a customer product list.

Parameters:
customer - the customer
productList - the product list
item - the item added to the customer product list
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.items.beforeGET

GET /customers/{customer_id}/product_lists/{list_id}/items

Method details

beforeGET (customerId : String, productListId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - the customer id the customer product list items result retrieved for.
productListId - the product list id the customer product list items result retrieved for.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.items.beforePOST

POST /customers/{customer_id}/product_lists/{list_id}/items

Method details

beforePOST (customer : dw.customer.Customer, productList : dw.customer.ProductList, item : CustomerProductListItem) : dw.system.Status

The function is called before adding an item to a customer product list.

Parameters:
customer - the customer
productList - the product list
item - the item to add to the customer product list
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.items.modifyGETResponse_v2

GET /customers/{customer_id}/product_lists/{list_id}/items

Method details

modifyGETResponse_v2 (customer : dw.customer.Customer, productList : dw.customer.ProductList, customerProductListItemResultResponse : CustomerProductListItemResult) : dw.system.Status

Parameters:
customer - the customer the customer product list items result retrieved for.
productList - the product list the customer product list items result retrieved for.
customerProductListItemResultResponse - customer product list item result response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.modifyGETResponse

GET /customers/{customer_id}/product_lists/{list_id}

Method details

modifyGETResponse (customer : dw.customer.Customer, productList : dw.customer.ProductList, customerProductListResponse : CustomerProductList) : dw.system.Status

Parameters:
customer - target customer
productList - target product list
customerProductListResponse - customer product list response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.modifyPATCHResponse

PATCH /customers/{customer_id}/product_lists/{list_id}

Method details

modifyPATCHResponse (customer : dw.customer.Customer, productList : dw.customer.ProductList, customerProductListResponse : CustomerProductList) : dw.system.Status

Parameters:
customer - target customer
productList - target product list
customerProductListResponse - customer product list response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_list.modifyPOSTResponse

POST /customers/{customer_id}/product_lists

Method details

modifyPOSTResponse (customer : dw.customer.Customer, productList : dw.customer.ProductList, customerProductListResponse : CustomerProductList) : dw.system.Status

Parameters:
customer - target customer
productList - product list
customerProductListResponse - customer product list response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_lists.afterPOST

POST /customers/{customer_id}/product_lists

Method details

afterPOST (customer : dw.customer.Customer, productList : CustomerProductList) : dw.system.Status

The function is called after creating a new product list for the specified customer.

Parameters:
customer - the customer
productList - the created product list
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_lists.beforeGET

GET /customers/{customer_id}/product_lists

Method details

beforeGET (customerId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - the customer id the customer product lists result retrieved for.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_lists.beforePOST

POST /customers/{customer_id}/product_lists

Method details

beforePOST (customer : dw.customer.Customer, productList : CustomerProductList) : dw.system.Status

The function is called before creating a new product list for the specified customer.

Parameters:
customer - the customer
productList - the product list to create
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.product_lists.modifyGETResponse_v3

GET /customers/{customer_id}/product_lists

Method details

modifyGETResponse_v3 (customer : dw.customer.Customer, customerProductListResultResponse : CustomerProductListResult) : dw.system.Status

Parameters:
customer - the customer the customer product lists result retrieved for.
customerProductListResultResponse - customer product list pageable result response object
Returns:
a non-null Status ends the hook execution

Customers hooks for Shop API.


dw.ocapi.shop.customers.password_reset.afterPOST

POST /customers/password_reset

Method details

afterPOST (customer : dw.customer.Customer, resetToken : String) : dw.system.Status

Allows resetting a customer's password. See the example below sending an email with a password reset link.

Parameters:
customer - the customer for whom to reset the password
resetToken - the token generated by the system to be used for the reset
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customers.password_reset.beforePOST

POST /customers/password_reset

Method details

beforePOST (passwordReset : PasswordReset) : dw.system.Status

Allows resetting a customer's password. The validation of the customer information provided in the the password reset document is done after this hook is called.

Returns:
a non-null Status ends the hook execution

Customer address hooks for Shop API.


dw.ocapi.shop.customer.address.afterDELETE

DELETE /customers/{customer_id}/addresses/{address_name}

Method details

afterDELETE (customer : dw.customer.Customer, addressName : String) : dw.system.Status

The function is called after removing an address of a customer.

Parameters:
customer - the customer for whom the address was deleted
addressName - the name of the address that was deleted
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.address.afterPATCH

PATCH /customers/{customer_id}/addresses/{address_name}

Method details

afterPATCH (customer : dw.customer.Customer, addressName : String, customerAddress : CustomerAddress) : dw.system.Status

The function is called after updating an address of a customer.

Parameters:
customer - the customer for whom the address was updated
addressName - the name of the address that was updated
customerAddress - the customer address request data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.address.beforeDELETE

DELETE /customers/{customer_id}/addresses/{address_name}

Method details

beforeDELETE (customer : dw.customer.Customer, addressName : String) : dw.system.Status

The function is called before removing an address of a customer.

Parameters:
customer - the customer for whom to delete the address
addressName - the name of the address to be deleted
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.address.beforeGET

GET /customers/{customer_id}/addresses/{address_name}

Method details

beforeGET (customerId : String, addressName : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customer - target customer
customerAddress - target customer address
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.address.beforePATCH

PATCH /customers/{customer_id}/addresses/{address_name}

Method details

beforePATCH (customer : dw.customer.Customer, addressName : String, customerAddress : CustomerAddress) : dw.system.Status

The function is called before updating an address of a customer.

Parameters:
customer - the customer for whom to update the address
addressName - the name of the address to be updated
customerAddress - the customer address request data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.address.modifyGETResponse

GET /customers/{customer_id}/addresses/{address_name}

Method details

modifyGETResponse (customer : dw.customer.Customer, customerAddress : dw.customer.CustomerAddress, customerAddressResponse : CustomerAddress) : dw.system.Status

Parameters:
customer - target customer
customerAddress - target customer address
customerAddressResponse - customer address response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.address.modifyPATCHResponse

PATCH /customers/{customer_id}/addresses/{address_name}

Method details

modifyPATCHResponse (customer : dw.customer.Customer, customerAddress : dw.customer.CustomerAddress, customerAddressResponse : CustomerAddress, customerAddressRequest : CustomerAddress) : dw.system.Status

Parameters:
customerAddress - target customer address
customerAddressResponse - customer address response object
customerAddressRequest - customer address request object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.address.modifyPOSTResponse

POST /customers/{customer_id}/addresses

Method details

modifyPOSTResponse (customer : dw.customer.Customer, customerAddress : dw.customer.CustomerAddress, customerAddressResponse : CustomerAddress, customerAddressRequest : CustomerAddress) : dw.system.Status

The function is called before returning response.

Parameters:
customer - the customer for whom the address was added.
customerAddress - created customer address
customerAddressResponse - customer address response object.
customerAddressRequest - the customer address request object.
Returns:
a non-null Status ends the hook execution

Customer addresses hooks for Shop API.


dw.ocapi.shop.customer.addresses.afterPOST

POST /customers/{customer_id}/addresses

Method details

afterPOST (customer : dw.customer.Customer, addressName : String, customerAddress : CustomerAddress) : dw.system.Status

The function is called after adding an address to a customer.

Parameters:
customer - the customer for whom the address was added
addressName - the name of the address that was added
customerAddress - the customer address request data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.addresses.beforeGET

GET /customers/{customer_id}/addresses

Method details

beforeGET (customerId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
customerId - the customer id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.addresses.beforePOST

POST /customers/{customer_id}/addresses

Method details

beforePOST (customer : dw.customer.Customer, addressName : String, customerAddress : CustomerAddress) : dw.system.Status

The function is called before adding an address to a customer.

Parameters:
customer - the customer for whom to add the address
addressName - the name of the address to be added
customerAddress - the customer address request data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.customer.addresses.modifyGETResponse

GET /customers/{customer_id}/addresses

Method details

modifyGETResponse (customerAddressResultResponse : CustomerAddressResult) : dw.system.Status

Parameters:
customerAddressResultResponse - customer addresses result response
Returns:
a non-null Status ends the hook execution

Folder hooks for Shop API.


dw.ocapi.shop.folder.beforeGET

GET /folders/({id},...,{id})

Method details

beforeGET (id : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
id - The id of the requested content folder.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.folder.beforeGET

GET /folders/{id}

Method details

beforeGET (id : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
id - The id of the requested content folder.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.folder.modifyGETResponse

GET /folders/({id},...,{id})

Method details

modifyGETResponse (scriptFolder : dw.content.Folder, doc : ContentFolder) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptFolder - an instance of dw.content.Folder
doc - the document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.folder.modifyGETResponse

GET /folders/{id}

Method details

modifyGETResponse (scriptFolder : dw.content.Folder, doc : ContentFolder) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptFolder - an instance of dw.content.Folder
doc - the document
Returns:
a non-null Status ends the hook execution

Gift certificate hooks for version 24.5.

dw.ocapi.shop.gift_certificate.beforePOST

POST /gift_certificate

Method details

beforePOST (giftCertificateRequest : GiftCertificateRequest) : dw.system.Status

The function is called before the request will be processed.

Parameters:
giftCertificateRequest - The request containing the gift certificate code.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.gift_certificate.modifyPOSTResponse

POST /gift_certificate

Method details

modifyPOSTResponse (giftCertificate : dw.order.GiftCertificate, giftCertificateResponse : GiftCertificate) : dw.system.Status

Parameters:
giftCertificate - the target gift certificate
giftCertificateResponse - gift certificate response object
Returns:
a non-null Status ends the hook execution

Order hooks for Shop API.


dw.ocapi.shop.order.afterPATCH

PATCH /orders/{order_no}

Method details

afterPATCH (order : dw.order.Order, orderInput : Order) : dw.system.Status

The function is called after an order was patched.

Parameters:
order - the order that was changed
orderInput - the input data from the REST call
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.afterPOST

POST /orders

Method details

afterPOST (order : dw.order.Order) : dw.system.Status

The function is called after an order was created from the basket.

Parameters:
order - the order that was created for the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.afterPUT

PUT /orders/{order_no}

Method details

afterPUT (order : dw.order.Order) : dw.system.Status

The function is called after an order is created for the basket with the caller supplying the order number.

Parameters:
order - the order that was created for the basket
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.beforeGET

GET /orders/{order_no}

Method details

beforeGET (orderNo : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
orderNo - the order number
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.beforePATCH

PATCH /orders/{order_no}

Method details

beforePATCH (order : dw.order.Order, orderInput : Order) : dw.system.Status

The function is called before an order is patched.

Parameters:
order - the order that will be changed
orderInput - the input data from the REST call
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.beforePOST

POST /orders

Method details

beforePOST (basket : dw.order.Basket) : dw.system.Status

The function is called before an order is created for the basket.

Parameters:
basket - the basket based on which the order is created
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.beforePUT

PUT /orders/{order_no}

Method details

beforePUT (ctor : dw.order.Basket) : dw.system.Status

The function is called before an order is created for the basket with the caller supplying the order number.

Parameters:
basket - the basket based on which the order is created
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.modifyGETResponse

GET /orders/{order_no}

Method details

modifyGETResponse (order : dw.order.Order, orderResponse : Order) : dw.system.Status

Parameters:
order - target order
orderResponse - order response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.modifyPATCHResponse

PATCH /orders/{order_no}

Method details

modifyPATCHResponse (order : dw.order.Order, orderResponse : Order) : dw.system.Status

Parameters:
order - target order
orderResponse - order response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.modifyPOSTResponse

POST /orders

Method details

modifyPOSTResponse (order : dw.order.Order, orderResponse : Order) : dw.system.Status

Parameters:
order - target order
orderResponse - order response object
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.modifyPUTResponse

PUT /orders/{order_no}

Method details

modifyPUTResponse (order : dw.order.Order, orderResponse : Order) : dw.system.Status

Parameters:
order - target order
orderResponse - order response object
Returns:
a non-null Status ends the hook execution

Order payment hooks for Shop API.


dw.order.payment.authorize

PATCH /orders/{order_no}/payment_instruments/{payment_instrument_id}

Method details

authorize (order : dw.order.Order, paymentDetails : dw.order.OrderPaymentInstrument) : dw.system.Status

Custom payment authorization - modify the order as needed.

  • Prerequisite: An order has been created using the data api or via the storefront.
  • Return Status.OK: Corresponding payment transaction is marked as authorized (usually a custom property is used for this).
  • Return Status.ERROR: Order is held, authorization needs to be repeated.

Parameters:
order - the order
paymentDetails - specified payment details
Returns:
  • Status.OK successful authorization.
  • Status.ERROR authorization failed.

dw.order.payment.authorize

POST /orders/{order_no}/payment_instruments

Method details

authorize (order : dw.order.Order, paymentDetails : dw.order.OrderPaymentInstrument) : dw.system.Status

Custom payment authorization - modify the order as needed.

  • Prerequisite: An order has been created using the data api or via the storefront.
  • Return Status.OK: Corresponding payment transaction is marked as authorized (usually a custom property is used for this).
  • Return Status.ERROR: Order is held, authorization needs to be repeated.

Parameters:
order - the order
paymentDetails - specified payment details
Returns:
  • Status.OK successful authorization.
  • Status.ERROR authorization failed.

dw.order.payment.authorizeCreditCard

PATCH /orders/{order_no}/payment_instruments/{payment_instrument_id}

Method details

authorizeCreditCard (order : dw.order.Order, paymentDetails : dw.order.OrderPaymentInstrument, cvn : String) : dw.system.Status

Custom payment authorization of a credit card - modify the order as needed.

  • Prerequisite: An order has been created using the data api or via the storefront.
  • Return Status.OK: Corresponding payment transaction is marked as authorized (usually a custom property is used for this).
  • Return Status.ERROR: Order is held, authorization needs to be repeated.

Parameters:
order - the order
paymentDetails - specified payment details
cvn - the credit card verification number
Returns:
  • Status.OK successful authorization.
  • Status.ERROR authorization failed.

dw.order.payment.authorizeCreditCard

POST /orders/{order_no}/payment_instruments

Method details

authorizeCreditCard (order : dw.order.Order, paymentDetails : dw.order.OrderPaymentInstrument, cvn : String) : dw.system.Status

Custom payment authorization of a credit card - modify the order as needed.

  • Prerequisite: An order has been created using the data api or via the storefront.
  • Return Status.OK: Corresponding payment transaction is marked as authorized (usually a custom property is used for this).
  • Return Status.ERROR: Order is held, authorization needs to be repeated.

Parameters:
order - the order
paymentDetails - specified payment details
cvn - the credit card verification number
Returns:
  • Status.OK successful authorization.
  • Status.ERROR authorization failed.

dw.ocapi.shop.order.validateOrder

DELETE /orders/{order_no}/payment_instruments/{payment_instrument_id}

Method details

validateOrder (order : Order) : dw.system.Status

Validate an order after the order has been updated. The hook is called outside a database transaction, so modifications to the order are not possible. Allows the addition of custom flashes to convey information to the client. Example showing addition of flashes:

Parameters:
order - the modified order
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.validateOrder

PATCH /orders/{order_no}/payment_instruments/{payment_instrument_id}

Method details

validateOrder (order : Order) : dw.system.Status

Validate an order after the order has been updated. The hook is called outside a database transaction, so modifications to the order are not possible. Allows the addition of custom flashes to convey information to the client. Example showing addition of flashes:

Parameters:
order - the modified order
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.validateOrder

POST /orders/{order_no}/payment_instruments

Method details

validateOrder (order : Order) : dw.system.Status

Validate an order after the order has been updated. The hook is called outside a database transaction, so modifications to the order are not possible. Allows the addition of custom flashes to convey information to the client. Example showing addition of flashes:

Parameters:
order - the modified order
Returns:
a non-null Status ends the hook execution

Order note hooks for Shop API.


dw.ocapi.shop.order.note.afterDELETE

DELETE /orders/{order_no}/notes/{note_id}

Method details

afterDELETE (order : dw.order.Order, note : dw.object.Note) : dw.system.Status

The function is called after a note is deleted.

Parameters:
order - the order
note - the note to be removed
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.note.beforeDELETE

DELETE /orders/{order_no}/notes/{note_id}

Method details

beforeDELETE (order : dw.order.Order, note : dw.object.Note) : dw.system.Status

The function is called before a note is deleted.

Parameters:
order - the order
note - the note to be removed
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.note.beforePOST

POST /orders/{order_no}/notes

Method details

beforePOST (orderNo : String, note : Note) : dw.system.Status

The function is called before the request will be processed.

Parameters:
orderNo - The id of the order from which you want to retrieve notes.
note - The note to be added.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.note.modifyDELETEResponse

DELETE /orders/{order_no}/notes/{note_id}

Method details

modifyDELETEResponse (order : dw.order.Order, orderResponse : Order, noteId : String) : dw.system.Status

Parameters:
order - target order
orderResponse - order response object
noteId - note id to delete
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.note.modifyPOSTResponse

POST /orders/{order_no}/notes

Method details

modifyPOSTResponse (order : dw.order.Order, orderResponse : Order) : dw.system.Status

Parameters:
order - target order
orderResponse - order response object
Returns:
a non-null Status ends the hook execution

Order notes hooks for Shop API.


dw.ocapi.shop.order.notes.beforeGET

GET /orders/{order_no}/notes

Method details

beforeGET (orderNo : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
orderNo - The id of the order from which you want to retrieve notes.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.notes.modifyGETResponse_v2

GET /orders/{order_no}/notes

Method details

modifyGETResponse_v2 (order : dw.order.Order, notesResultResponse : NotesResult) : dw.system.Status

Parameters:
order - the order the notes result retrieved for.
notesResultResponse - notes result response object
Returns:
a non-null Status ends the hook execution

Order payment instruments hooks for Shop API.


dw.ocapi.shop.order.payment_instrument.afterDELETE

DELETE /orders/{order_no}/payment_instruments/{payment_instrument_id}

Method details

afterDELETE (order : dw.order.Order, paymentInstrument : dw.order.OrderPaymentInstrument) : dw.system.Status

The function is called after removing a payment instrument of an order.

Parameters:
order - the modified order
paymentInstrument - the removed payment instrument
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.payment_instrument.afterPATCH

PATCH /orders/{order_no}/payment_instruments/{payment_instrument_id}

Method details

afterPATCH (order : dw.order.Order, paymentInstrument : dw.order.OrderPaymentInstrument, newPaymentInstrument : OrderPaymentInstrumentRequest, successfullyAuthorized : boolean) : dw.system.Status

The function is called after updating a payment instrument of an order.

Parameters:
order - the modified order
paymentInstrument - the updated payment instrument
newPaymentInstrument - the new payment instrument data
successfullyAuthorized - was the payment instrument successfully authorized.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.payment_instrument.afterPOST

POST /orders/{order_no}/payment_instruments

Method details

afterPOST (order : dw.order.Order, paymentInstrument : OrderPaymentInstrumentRequest, successfullyAuthorized : boolean) : dw.system.Status

The function is called after a payment instrument was added to the order.

Parameters:
order - the modified order
paymentInstrument - the payment instrument that was added to the order
successfullyAuthorized - was the payment instrument successfully authorized.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.payment_instrument.beforeDELETE

DELETE /orders/{order_no}/payment_instruments/{payment_instrument_id}

Method details

beforeDELETE (order : dw.order.Order, paymentInstrument : dw.order.OrderPaymentInstrument) : dw.system.Status

The function is called before removing a payment instrument of an order.

Parameters:
order - the modified order
paymentInstrument - the payment instrument to be removed
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.payment_instrument.beforePATCH

PATCH /orders/{order_no}/payment_instruments/{payment_instrument_id}

Method details

beforePATCH (order : dw.order.Order, paymentInstrument : dw.order.OrderPaymentInstrument, newPaymentInstrument : OrderPaymentInstrumentRequest) : dw.system.Status

The function is called before updating a payment instrument of an order.

Parameters:
order - the modified order
paymentInstrument - the payment instrument to be updated
newPaymentInstrument - the new payment instrument data
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.payment_instrument.beforePOST

POST /orders/{order_no}/payment_instruments

Method details

beforePOST (order : dw.order.Order, paymentInstrument : OrderPaymentInstrumentRequest) : dw.system.Status

The function is called before a payment instrument is added to the order.

Parameters:
order - the modified order
paymentInstrument - the payment instrument to be added to the order
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.payment_instrument.modifyDELETEResponse

DELETE /orders/{order_no}/payment_instruments/{payment_instrument_id}

Method details

modifyDELETEResponse (order : dw.order.Order, orderResponse : Order, paymentInstrumentId : String) : dw.system.Status

Parameters:
order - target order
orderResponse - order response object
paymentInstrumentId - payment instrument id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.payment_instrument.modifyPATCHResponse

PATCH /orders/{order_no}/payment_instruments/{payment_instrument_id}

Method details

modifyPATCHResponse (order : dw.order.Order, orderResponse : Order, paymentInstrumentId : String) : dw.system.Status

Parameters:
order - target order
orderResponse - order response object
paymentInstrumentId - payment instrument id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.payment_instrument.modifyPOSTResponse

POST /orders/{order_no}/payment_instruments

Method details

modifyPOSTResponse (order : dw.order.Order, orderResponse : Order) : dw.system.Status

Parameters:
order - target order
orderResponse - order response object
Returns:
a non-null Status ends the hook execution

Order payment methods hooks for Shop API.


dw.ocapi.shop.order.payment_methods.beforeGET

GET /orders/{order_no}/payment_methods

Method details

beforeGET (orderNumber : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
orderNumber - the order number
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.order.payment_methods.modifyGETResponse_v2

GET /orders/{order_no}/payment_methods

Method details

modifyGETResponse_v2 (order : dw.order.Order, paymentMethodResultResponse : PaymentMethodResult) : dw.system.Status

Parameters:
order - the order the payment method result retrieved for.
paymentMethodResultResponse - payment method result response object
Returns:
a non-null Status ends the hook execution

Order search hooks for Shop API.


dw.ocapi.shop.order_search.modifyPOSTResponse

POST /order_search

Method details

modifyPOSTResponse (orderSearchResultResponse : OrderSearchResult) : dw.system.Status

Parameters:
orderSearchResultResponse - order search result response object.
Returns:
a non-null Status ends the hook execution

Price adjustment limits hooks for Shop API.


dw.ocapi.shop.price_adjustment_limits.beforeGET

GET /price_adjustment_limits

Method details

beforeGET () : dw.system.Status

The function is called before the request will be processed.

Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.price_adjustment_limits.modifyGETResponse

GET /price_adjustment_limits

Method details

modifyGETResponse (priceAdjLimitResponse : PriceAdjustmentLimits) : dw.system.Status

Parameters:
priceAdjLimitResponse - the PriceAdjustmentLimit response object
Returns:
a non-null Status ends the hook execution

Product hooks for Shop API.


dw.ocapi.shop.product.beforeGET

GET /products/({id},...,{id})

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}/availability

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}/bundled_products

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}/images

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}/links

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}/options

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}/prices

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}/promotions

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}/recommendations

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}/set_products

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.beforeGET

GET /products/{id}/variations

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the incoming product id from the URL.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/({id},...,{id})

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}/availability

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}/bundled_products

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}/images

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}/links

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}/options

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}/prices

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}/promotions

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}/recommendations

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}/set_products

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.modifyGETResponse

GET /products/{id}/variations

Method details

modifyGETResponse (scriptProduct : dw.catalog.Product, doc : Product) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
scriptProduct - an instance of dw.catalog.Product
Returns:
a non-null Status ends the hook execution

Product shipping hooks for Shop API.


dw.ocapi.shop.product.shipping_methods.beforeGET

GET /products/{id}/shipping_methods

Method details

beforeGET (productId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
productId - the requested product id
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product.shipping_methods.modifyGETResponse_v2

GET /products/{id}/shipping_methods

Method details

modifyGETResponse_v2 (product : dw.catalog.Product, shippingMethodResultResponse : ShippingMethodResult) : dw.system.Status

Parameters:
product - the product the shipping methods result retrieved for.
shippingMethodResultResponse - shipping method result response
Returns:
a non-null Status ends the hook execution

Product list hooks for Shop API.


dw.ocapi.shop.product_list.beforeGET

GET /product_lists/{list_id}

Method details

beforeGET (listId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
listId - The id of the list.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_list.item.beforeGET

GET /product_lists/{list_id}/items/{item_id}

Method details

beforeGET (listId : String, itemId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
listId - The id of the list.
itemId - The id of the item.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_list.item.modifyGETResponse

GET /product_lists/{list_id}/items/{item_id}

Method details

modifyGETResponse (productList : dw.customer.ProductList, productListItem : dw.customer.ProductListItem, publicProductListItemResponse : PublicProductListItem) : dw.system.Status

Parameters:
productList - product list.
productListItem - product list item.
publicProductListItemResponse - public product list item response object.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_list.items.beforeGET

GET /product_lists/{list_id}/items

Method details

beforeGET (listId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
listId - The id of the list.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_list.items.modifyGETResponse

GET /product_lists/{list_id}/items

Method details

modifyGETResponse_v2 (productList : dw.customer.ProductList, publicProductListItemResultResponse : PublicProductListItemResult) : dw.system.Status

Parameters:
productList - the product list the items are retrieved for.
publicProductListItemResultResponse - public product list item result response object.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_list.modifyGETResponse

GET /product_lists/{list_id}

Method details

modifyGETResponse (productList : dw.customer.ProductList, publicProductListResponse : PublicProductList) : dw.system.Status

Parameters:
productList - product list.
publicProductListResponse - public product list response object.
Returns:
a non-null Status ends the hook execution

Product lists hooks for Shop API.


dw.ocapi.shop.product_lists.beforeGET

GET /product_lists

Method details

beforeGET (email : String, firstName : String, lastName : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
email - The email address of the customer, the product lists belong to.
firstName - The first name of the customer, the product lists belong to.
lastName - The last name of the customer, the product lists belong to.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_lists.modifyGETResponse

GET /product_lists

Method details

modifyGETResponse (publicProductListResultResponse : PublicProductListResult) : dw.system.Status

Parameters:
publicProductListResultResponse - public product list result response object.
Returns:
a non-null Status ends the hook execution

Product search hooks for Shop API.


dw.ocapi.shop.product_search.beforeGET

GET /product_search

Method details

beforeGET () : dw.system.Status

The function is called before the request will be processed.

Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.beforeGET

GET /product_search/availability

Method details

beforeGET () : dw.system.Status

The function is called before the request will be processed.

Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.beforeGET

GET /product_search/images

Method details

beforeGET () : dw.system.Status

The function is called before the request will be processed.

Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.beforeGET

GET /product_search/prices

Method details

beforeGET () : dw.system.Status

The function is called before the request will be processed.

Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.beforeGET

GET /product_search/represented_products

Method details

beforeGET () : dw.system.Status

The function is called before the request will be processed.

Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.beforeGET

GET /product_search/variations

Method details

beforeGET () : dw.system.Status

The function is called before the request will be processed.

Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.modifyGETResponse

GET /product_search

Method details

modifyGETResponse (doc : ProductSearchResult) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.modifyGETResponse

GET /product_search/availability

Method details

modifyGETResponse (doc : ProductSearchResult) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.modifyGETResponse

GET /product_search/images

Method details

modifyGETResponse (doc : ProductSearchResult) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.modifyGETResponse

GET /product_search/prices

Method details

modifyGETResponse (doc : ProductSearchResult) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.modifyGETResponse

GET /product_search/represented_products

Method details

modifyGETResponse (doc : ProductSearchResult) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.product_search.modifyGETResponse

GET /product_search/variations

Method details

modifyGETResponse (doc : ProductSearchResult) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution

Promotion hooks for Shop API.


dw.ocapi.shop.promotion.beforeGET

GET /promotions/({id},...,{id})

Method details

beforeGET (id : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
id - The id of the requested promotion.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.promotion.beforeGET

GET /promotions/{id}

Method details

beforeGET (id : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
id - The id of the requested promotion.
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.promotion.modifyGETResponse

GET /promotions/({id},...,{id})

Method details

modifyGETResponse (scriptPromotion : dw.campaign.Promotion, doc : Promotion) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptPromotion - an instance of dw.campaign.Promotion
doc - the document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.promotion.modifyGETResponse

GET /promotions/{id}

Method details

modifyGETResponse (scriptPromotion : dw.campaign.Promotion, doc : Promotion) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptPromotion - an instance of dw.campaign.Promotion
doc - the document
Returns:
a non-null Status ends the hook execution

Promotions hooks for Shop API.


dw.ocapi.shop.promotions.beforeGET

GET /promotions

Method details

beforeGET (campaignId : String, startDate : String, endDate : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
campaignId - Find the promotions assigned to this campaign (mandatory)
startDate - The start date of the promotion in ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ
endDate - The end date of the promotion in ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.promotions.modifyGETResponse

GET /promotions

Method details

modifyGETResponse (doc : PromotionResult) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution

Search suggestions hooks for Shop API.


dw.ocapi.shop.search_suggestion.beforeGET

GET /search_suggestion

Method details

beforeGET () : dw.system.Status

The function is called before the request will be processed.

Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.search_suggestion.modifyGETResponse

GET /search_suggestion

Method details

modifyGETResponse (doc : SuggestionResult) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution

Site hooks for Shop API.


dw.ocapi.shop.site.beforeGET

GET /site

Method details

beforeGET (siteId : String) : dw.system.Status

The function is called before the request will be processed.

Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.site.modifyGETResponse

GET /site

Method details

modifyGETResponse (doc : Site) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution

Store hooks for Shop API.


dw.ocapi.shop.store.beforeGET

GET /stores/{id}

Method details

beforeGET (id : String, siteId : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
id - The id of the requested store.
siteId - The ID of the site to get the store from
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.store.modifyGETResponse

GET /stores/({id},...,{id})

Method details

modifyGETResponse (scriptStore : dw.catalog.Store, doc : Store) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptStore - an instance of dw.catalog.Store
doc - the document
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.store.modifyGETResponse

GET /stores/{id}

Method details

modifyGETResponse (scriptStore : dw.catalog.Store, doc : Store) : dw.system.Status

The function is called after the request has been processed.

Parameters:
scriptStore - an instance of dw.catalog.Store
doc - the document
Returns:
a non-null Status ends the hook execution

Stores hooks for Shop API.


dw.ocapi.shop.stores.beforeGET

GET /stores

Method details

beforeGET (latitude : Double, longitude : Double, countryCode : String, postalCode : String) : dw.system.Status

The function is called before the request will be processed.

Parameters:
latitude - The geo coordinate latitude to search for stores (value range -90.00 .. 90.00).
longitude - The geo coordinate longitude to search for stores (value range -180.00 .. 180.00).
countryCode - The two letter ISO country code e.g. "US".
postalCode - The postal code e.g. "01801".
Returns:
a non-null Status ends the hook execution

dw.ocapi.shop.stores.modifyGETResponse

GET /stores

Method details

modifyGETResponse (doc : StoreResult) : dw.system.Status

The function is called after the request has been processed.

Parameters:
doc - the document
Returns:
a non-null Status ends the hook execution