1 {"slug":"/references/promotion/models/CampaignBudgetUsage","title":"CampaignBudgetUsage - Promotion Module Data Models Reference","frontmatter":{"displayed_sidebar":"promotionModelReference","slug":"/references/promotion/models/CampaignBudgetUsage","sidebar_label":"CampaignBudgetUsage"},"toc":[],"blocks":[{"kind":"markdown","html":"This documentation provides a reference to the CampaignBudgetUsage data model. It belongs to the Promotion Module."},{"kind":"note","variant":"note","html":"This is available starting from [Medusa v2.11.0](https://github.com/medusajs/medusa/releases/tag/v2.11.0)."},{"kind":"sourceCodeLink","link":"https://github.com/medusajs/medusa/blob/020565398e436a2bc65777a3b1ad347b4735d6df/packages/modules/promotion/src/models/campaign-budget-usage.ts#L7"},{"kind":"typeList","sectionTitle":"CampaignBudgetUsage","types":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the campaign budget usage.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute_value","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The attribute value of the campaign budget usage","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"types","type":"[SearchFacetKind](/references/types/SearchTypes/types/types.SearchTypes.SearchFacetKind)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`\"text\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"used","type":"`BigNumberProperty`","description":"The used of the campaign budget usage","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"BelongsTo&#60;[CampaignBudget](/references/promotion/models/CampaignBudget)&#62;","description":"The associated budget.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the campaign budget.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"EnumProperty&#60;typeof [CampaignBudgetType](/references/utils/PromotionUtils/enums/utils.PromotionUtils.CampaignBudgetType)&#62;","description":"The type of the campaign budget","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The currency code of the campaign budget.","optional":true,"defaultValue":"","example":"usd","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"limit","type":"`BigNumberProperty`","description":"The limit of the campaign budget","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`BigNumberProperty`","description":"How much of the budget has been used. if the `limit` is `spend`, this property holds the total amount discounted so far. if the `limit` is `usage`, it holds the number of times the campaign's promotions have been used so far.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign","type":"BelongsTo&#60;[Campaign](/references/promotion/models/Campaign)&#62;","description":"The associated campaign.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the campaign.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The name of the campaign","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The description of the campaign","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"campaign_identifier","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The campaign's identifier, such as a Google Tag ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"starts_at","type":"`DateTimeProperty`","description":"The date that the campaign starts.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ends_at","type":"`DateTimeProperty`","description":"The date that the campaign ends.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"HasOne&#60;[CampaignBudget](/references/promotion/models/CampaignBudget)&#62;","description":"The associated budget.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"promotions","type":"HasMany&#60;[Promotion](/references/promotion/models/Promotion)&#62;","description":"The associated promotions.","optional":false,"defaultValue":"","expandable":true,"children":[]}]},{"name":"attribute","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The attribute of the campaign budget","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$dataType","type":"`string`","description":"A type-only property to infer the JavaScript data-type\nof the schema property","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"#retrievable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#providerOptions","type":"`Record<string, Record&#60;string, unknown&#62;>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#filterable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#sortable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#facetable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#array","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"#searchable","type":"`boolean` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"dataType","type":"`object`","description":"The runtime dataType for the schema. It is not the same as\nthe \"$dataType\".","optional":false,"defaultValue":"","expandable":false,"children":[]}],"since":"2.11.0"},{"name":"usages","type":"HasMany&#60;[CampaignBudgetUsage](/references/promotion/models/CampaignBudgetUsage)&#62;","description":"The associated usages.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the campaign budget usage.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"attribute_value","type":"[TextProperty](/references/utils/classes/utils.TextProperty)","description":"The attribute value of the campaign budget usage","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"used","type":"`BigNumberProperty`","description":"The used of the campaign budget usage","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"budget","type":"BelongsTo&#60;[CampaignBudget](/references/promotion/models/CampaignBudget)&#62;","description":"The associated budget.","optional":false,"defaultValue":"","expandable":true,"children":[]}],"since":"2.11.0"}]}]}]}