www/apps/resources/references/promotion/interfaces/promotion.CampaignBudgetDTO/page.mdx
import { TypeList } from "docs-ui"
The campaign budget details.
<TypeList types={[{"name":"id","type":"string","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"CampaignBudgetTypeValues","description":"The type of the campaign budget:\n\n- spend indicates that the budget is limited by the amount discounted by the promotions in the associated campaign.\n- usage indicates that the budget is limited by the number of times the promotions of the associated campaign have been used.\n- use_by_attribute indicates that the budget is limited by the number of times the promotions of the associated campaign have been used by a specific attribute value (for example, per customer)\n- spend_by_attribute indicates that the budget is limited by the amount discounted by the promotions in the associated campaign by a specific attribute value (for example, per customer)","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"null \| number","description":"The limit of the campaign budget.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"number","description":"The usage from the campaign budget's limit:\n\n- If the budget's type is spend, the value of this attribute is the amount discounted so far by the promotions in the associated campaign.\n- If the budget's type is usage, the value of this attribute is the number of times the promotions of the associated campaign have been used so far.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"string","description":"The currency of the campaign.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute","type":"string","description":"The attribute that the budget limit is applied to. By default,\nthe budget is applied globally. If the type is use_by_attribute, this field indicates the \nattribute the budget is tracked by. For example, customer_id means the budget is tracked per customer.","optional":true,"defaultValue":"","example":"customer_id","expandable":false,"children":[],"since":"2.11.0"},{"name":"usages","type":"CampaignBudgetUsageDTO[]","description":"The usages of the campaign budget. This is only set if the\nbudget's type is use_by_attribute or spend_by_attribute.\nEach usage tracks the budget usage for a specific attribute value.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"string","description":"The ID of the campaign budget usage.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute_value","type":"string","description":"The value of the attribute that the promotion was used by.\nFor example, if the budget campaign's attribute is customer_id,',\nthis value will be the ID of the customer that used the promotion.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"number","description":"The amount of times the promotion was used or\nthe amount of money discounted by the promotion,\ndepending on the campaign budget's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"budget_id","type":"string","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_used","type":"Record<string, any>","description":"The raw used value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"string","description":"The date and time the campaign budget usage was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"string","description":"The date and time the campaign budget usage was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"string","description":"The date and time the campaign budget usage was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}],"since":"2.11.0"}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CampaignBudgetDTO"/>