API Documentation
B2C Commerce Release Notes
Get Started with OCAPI
Hooks for Data API
Hooks for Shop API
Attention!
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
The following hooks exist in OCAPI version 24.5.
Content hooks for Data API.
dw.ocapi.data.content.content.afterCreate
PUT /libraries/{library_id}/content/{content_id}
afterCreate (library : dw.content.Library, content : dw.content.Content, create : ContentAsset) : dw.system.Status
The function is called after the new content asset was created.
dw.ocapi.data.content.content.afterDelete
DELETE /libraries/{library_id}/content/{content_id}
afterDelete (library : dw.content.Library) : dw.system.Status
The function is called after the content asset was deleted.
dw.ocapi.data.content.content.afterUpdate
PATCH /libraries/{library_id}/content/{content_id}
afterUpdate (library : dw.content.Library, content : dw.content.Content, update : ContentAsset) : dw.system.Status
The function is called after the content asset is updated with update document.
dw.ocapi.data.content.content.beforeCreate
PUT /libraries/{library_id}/content/{content_id}
beforeCreate (library : dw.content.Library, create : ContentAsset) : dw.system.Status
The function is called before the content asset is created with the given document.
dw.ocapi.data.content.content.beforeDelete
DELETE /libraries/{library_id}/content/{content_id}
beforeDelete (library : dw.content.Library, content : dw.content.Content) : dw.system.Status
The function is called before the content asset is deleted.
dw.ocapi.data.content.content.beforeUpdate
PATCH /libraries/{library_id}/content/{content_id}
beforeUpdate (library : dw.content.Library, content : dw.content.Content, update : ContentAsset) : dw.system.Status
The function is called before the content asset is updated with update document.
Content folder hooks for Data API.
dw.ocapi.data.content.folder.afterCreate
PUT /libraries/{library_id}/folders/{folder_id}
afterCreate (library : dw.content.Library, folder : dw.content.Folder, create : ContentFolder) : dw.system.Status
The function is called after the new content folder was created.
dw.ocapi.data.content.folder.afterDelete
DELETE /libraries/{library_id}/folders/{folder_id}
afterDelete (library : dw.content.Library) : dw.system.Status
The function is called after the content folder was deleted.
dw.ocapi.data.content.folder.afterUpdate
PATCH /libraries/{library_id}/folders/{folder_id}
afterUpdate (library : dw.content.Library, folder : dw.content.Folder, update : ContentFolder) : dw.system.Status
The function is called after the content folder is updated with update document.
dw.ocapi.data.content.folder.beforeCreate
PUT /libraries/{library_id}/folders/{folder_id}
beforeCreate (library : dw.content.Library, create : ContentFolder) : dw.system.Status
The function is called before the content folder is created with the given document.
dw.ocapi.data.content.folder.beforeDelete
DELETE /libraries/{library_id}/folders/{folder_id}
beforeDelete (library : dw.content.Library, folder : dw.content.Folder) : dw.system.Status
The function is called before the content folder is deleted.
dw.ocapi.data.content.folder.beforeUpdate
PATCH /libraries/{library_id}/folders/{folder_id}
beforeUpdate (library : dw.content.Library, folder : dw.content.Folder, update : ContentFolder) : dw.system.Status
The function is called before the content folder is updated with update document.
Customer hooks for Data API.
dw.ocapi.data.customer_list.customer.afterDELETE
DELETE /customer_lists/{list_id}/customers/{customer_no}
afterDelete (customerListId : String) : dw.system.Status
The function is called after the customer was deleted.
dw.ocapi.data.customer_list.customer.afterPATCH
PATCH /customer_lists/{list_id}/customers/{customer_no}
afterPatch (customer : dw.customer.Customer, update : Customer, customerListId : String) : dw.system.Status
The function is called after the customer is updated with update document.
dw.ocapi.data.customer_list.customer.beforeDELETE
DELETE /customer_lists/{list_id}/customers/{customer_no}
beforeDelete (customer : dw.customer.Customer, customerListId : String) : dw.system.Status
The function is called before the customer is deleted.
dw.ocapi.data.customer_list.customer.beforePATCH
PATCH /customer_lists/{list_id}/customers/{customer_no}
beforePatch (customer : dw.customer.Customer, update : Customer, customerListId : String) : dw.system.Status
The function is called before the customer is updated with update document.
Customers hooks for Data API.
dw.ocapi.data.customer_list.customers.afterPOST
POST /customer_lists/{list_id}/customers
afterPost (customer : dw.customer.Customer, create : Customer, customerListId : String) : dw.system.Status
The function is called after the new customer was created.
dw.ocapi.data.customer_list.customers.afterPUT
PUT /customer_lists/{list_id}/customers/{customer_no}
afterPut (customer : dw.customer.Customer, create : Customer, customerListId : String) : dw.system.Status
The function is called after the new customer was created.
dw.ocapi.data.customer_list.customers.beforePOST
POST /customer_lists/{list_id}/customers
beforePost (create : Customer, customerListId : String) : dw.system.Status
The function is called before the customer is created with the given document.
dw.ocapi.data.customer_list.customers.beforePUT
PUT /customer_lists/{list_id}/customers/{customer_no}
beforePut (create : Customer, customerListId : String) : dw.system.Status
The function is called before the customer is created with the given document.
Customer address hooks for Data API.
dw.ocapi.data.customer_list.customer.address.afterDELETE
DELETE /customer_lists/{list_id}/customers/{customer_no}/addresses/{address_id}
afterDelete (customer : dw.customer.Customer, customerListId : String) : dw.system.Status
The function is called after the customer address was deleted.
dw.ocapi.data.customer_list.customer.address.afterPATCH
PATCH /customer_lists/{list_id}/customers/{customer_no}/addresses/{address_id}
afterPatch (customer : dw.customer.Customer, customerAddress : dw.customer.CustomerAddress, update : CustomerAddress, customerListId : String) : dw.system.Status
The function is called after the customer address is updated with update document.
dw.ocapi.data.customer_list.customer.address.beforeDELETE
DELETE /customer_lists/{list_id}/customers/{customer_no}/addresses/{address_id}
beforeDelete (customer : dw.customer.Customer, customerAddress : dw.customer.CustomerAddress, customerListId : String) : dw.system.Status
The function is called before the customer is deleted.
dw.ocapi.data.customer_list.customer.address.beforePATCH
PATCH /customer_lists/{list_id}/customers/{customer_no}/addresses/{address_id}
beforePatch (customer : dw.customer.Customer, customerAddress : dw.customer.CustomerAddress, update : CustomerAddress, customerListId : String) : dw.system.Status
The function is called before the customer address is updated with update document.
Customer addresses hooks for Data API.
dw.ocapi.data.customer_list.customer.addresses.afterPOST
POST /customer_lists/{list_id}/customers/{customer_no}/addresses
afterPost (customer : dw.customer.Customer, customerAddress : dw.customer.CustomerAddress, create : CustomerAddress, customerListId : String) : dw.system.Status
The function is called after the new customer address was created.
dw.ocapi.data.customer_list.customer.addresses.beforePOST
POST /customer_lists/{list_id}/customers/{customer_no}/addresses
beforePost (customer : dw.customer.Customer, create : CustomerAddress, customerListId : String) : dw.system.Status
The function is called before a customer address is created with the given document.
Object hooks for Data API.
dw.ocapi.data.object.afterDelete
DELETE /custom_objects/{object_type}/{key}
afterDelete () : dw.system.Status
The function is called after the custom object was deleted.
dw.ocapi.data.object.afterDelete
DELETE /sites/{site_id}/custom_objects/{object_type}/{key}
afterDelete () : dw.system.Status
The function is called after the custom object was deleted.
dw.ocapi.data.object.afterPatch
PATCH /custom_objects/{object_type}/{key}
afterPatch (customObject : dw.object.CustomObject, create : CustomObject) : dw.system.Status
The function is called after the custom object was updated with update document.
dw.ocapi.data.object.afterPatch
PATCH /sites/{site_id}/custom_objects/{object_type}/{key}
afterPatch (customObject : dw.object.CustomObject, create : CustomObject) : dw.system.Status
The function is called after the custom object was updated with update document.
dw.ocapi.data.object.afterPut
PUT /custom_objects/{object_type}/{key}
afterPut (customObject : dw.object.CustomObject, create : CustomObject) : dw.system.Status
The function is called after the custom object was created with create document.
nulldw.ocapi.data.object.afterPut
PUT /sites/{site_id}/custom_objects/{object_type}/{key}
afterPut (customObject : dw.object.CustomObject, create : CustomObject) : dw.system.Status
The function is called after the custom object was created with create document.
nulldw.ocapi.data.object.beforeDelete
DELETE /custom_objects/{object_type}/{key}
beforeDelete (customObject : dw.object.CustomObject) : dw.system.Status
The function is called before the custom object is removed.
dw.ocapi.data.object.beforeDelete
DELETE /sites/{site_id}/custom_objects/{object_type}/{key}
beforeDelete (customObject : dw.object.CustomObject) : dw.system.Status
The function is called before the custom object is removed.
dw.ocapi.data.object.beforePatch
PATCH /custom_objects/{object_type}/{key}
beforePatch (customObject : dw.object.CustomObject, update : CustomObject) : dw.system.Status
The function is called before the custom object is updated with update document.
dw.ocapi.data.object.beforePatch
PATCH /sites/{site_id}/custom_objects/{object_type}/{key}
beforePatch (customObject : dw.object.CustomObject, update : CustomObject) : dw.system.Status
The function is called before the custom object is updated with update document.
dw.ocapi.data.object.beforePut
PUT /custom_objects/{object_type}/{key}
beforePut (create : CustomObject) : dw.system.Status
The function is called before the custom object is created with create document.
nulldw.ocapi.data.object.beforePut
PUT /sites/{site_id}/custom_objects/{object_type}/{key}
beforePut (create : CustomObject) : dw.system.Status
The function is called before the custom object is created with create document.
nullUsers hooks for Data API.
dw.ocapi.data.users.afterPATCH
PATCH /users/this/password
afterPatch (login : String, email : String) : dw.system.Status
The function is called after the user's password is updated.
Attention!