Skip to main content
Skip to main content

registerUsage - Promotion Module Reference

This documentation provides a reference to the registerUsage method. This belongs to the Promotion Module.

This method adjusts the budget for each campaign associated with the promotions' specified computed actions. It adjusts the used property of a CampaignBudget to account for the adjustment amounts in the specified associated computed actions.

Example

await promotionModuleService.registerUsage([
{
action: "addItemAdjustment",
item_id: "cali_123",
amount: 50,
code: "50OFF",
},
{
action: "addShippingMethodAdjustment",
shipping_method_id: "casm_123",
amount: 5000,
code: "FREESHIPPING",
},
])

Parameters

computedActionsComputeActions[]Required
The computed actions to adjust their promotion's campaign budget.

Returns

PromisePromise<void>Required
Resolves when the campaign budgets have been adjusted successfully.
Was this section helpful?