Skip to content

Commit

Permalink
Merge branch 'main' into STRF-12941
Browse files Browse the repository at this point in the history
  • Loading branch information
bc-traciporter authored Jan 23, 2025
2 parents 77a92b6 + 4002811 commit 0524450
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 32 deletions.
44 changes: 22 additions & 22 deletions docs/store-operations/promotions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Promotions are a way to give discounts based on whether the shopper has met spec

There are two ways to make a promotion.

1. Create a [Rule](/docs/rest-management/promotions) that includes a [Condition](/docs/rest-management/promotions) on which to take an action. For example, buy one (condition) get one free (action). The shopper must meet the condition of having a certain item in the cart before getting another item free.
1. Create a Rule that includes a Condition on which to take an action. For example, buy one (condition) get one free (action). The shopper must meet the condition of having a certain item in the cart before getting another item free.

2. Create a promotion with just an action. For example, take 20% off the most expensive item in the cart. The shopper does not need to satisfy any special conditions, and the promotion will apply automatically.

Expand Down Expand Up @@ -89,30 +89,30 @@ Before starting, make sure you have:
}
```

First, give the promotion a name. This name will appear in the control panel for the merchant and as part of the response. Then we need to build the rule. Remember, a rule consists of a [Condition](/docs/rest-management/promotions) and an [Action](/docs/rest-management/promotions). To create the rule, you need the action, condition, and the remaining configuration fields.
First, give the promotion a name. This name will appear in the control panel for the merchant and as part of the response. Then we need to build the rule. Remember, a rule consists of a Condition and an Action. To create the rule, you need the action, condition, and the remaining configuration fields.

### Creating the action

There are five possible actions for promotions:
* [Cart Items Action](/docs/rest-management/promotions) will apply to the individual items in the cart.
* [Cart Value Action](/docs/rest-management/promotions) will apply to the promotion value of the entire cart.
* [Shipping Action](/docs/rest-management/promotions) will give a discount on shipping, which can be limited to specific zones.
* [Gift Item Action](/docs/rest-management/promotions) will give a gift item for free.
* [Fixed Price Set Action](/docs/rest-management/promotions) will give a fixed price for a set of items.
* Cart Items Action will apply to the individual items in the cart.
* Cart Value Action will apply to the promotion value of the entire cart.
* Shipping Action will give a discount on shipping, which can be limited to specific zones.
* Gift Item Action will give a gift item for free.
* Fixed Price Set Action will give a fixed price for a set of items.

In this example, we will create a buy one, get one discount. We’ll use Cart Items Action, or `cart_items`, since the shopper will purchase an item, and the discount applies after the item is in the cart.

#### Discount

[Discount](/docs/rest-management/promotions) type can be a percentage amount or a fixed amount. You will use a fixed amount when the promotion offers X dollars off an item or items. Percentage discounts offer a percentage off an item or items. When the promotion is to buy one get one free, you will use the percentage discount because one item will be free or 100% off. Using the percent discount avoids having to calculate the item price every time.
Discount type can be a percentage amount or a fixed amount. You will use a fixed amount when the promotion offers X dollars off an item or items. Percentage discounts offer a percentage off an item or items. When the promotion is to buy one get one free, you will use the percentage discount because one item will be free or 100% off. Using the percent discount avoids having to calculate the item price every time.

In this example, we will use the `percentage_amount` set to 100.

#### Strategy

[Strategy](/docs/rest-management/promotions) decides how the discount applies when multiple items are in the cart. `LEAST_EXPENSIVE` sorts the items in ascending order by price, and the discount applies to the cheapest item. You can also change the Strategy to apply to the `MOST_EXPENSIVE` item in the cart.
Strategy decides how the discount applies when multiple items are in the cart. `LEAST_EXPENSIVE` sorts the items in ascending order by price, and the discount applies to the cheapest item. You can also change the Strategy to apply to the `MOST_EXPENSIVE` item in the cart.

In this example, we will use the `LEAST_EXPENSIVE` [Strategy](/docs/rest-management/promotions).
In this example, we will use the `LEAST_EXPENSIVE` strategy.

#### As total

Expand Down Expand Up @@ -260,10 +260,10 @@ So far, the promotion should look like the following:
### Creating the condition

We can base the condition on one of the following condition types:
* [Cart Condition](/docs/rest-management/promotions) Uses the cart contents
* [And Condition](/docs/rest-management/promotions) Logical and operator
* [Or Condition](/docs/rest-management/promotions) Logical or operator
* [Not Condition](/docs/rest-management/promotions) Logical not operator
* Cart Condition Uses the cart contents
* And Condition Logical and operator
* Or Condition Logical or operator
* Not Condition Logical not operator

Cart condition allows you to set the items (products), `minimum_quantity` and, `minimum_spend`. Setting the `minimum_quantity` determines how many items the shopper needs in the cart for the promotion to trigger. The promotion can buy one, buy two, etc. The `minimum_spend` is how much the shopper needs to spend for the discount to trigger. If left blank or not included, it assumes the shopper does not have a `minimum_spend`. In our buy one get one example, the number of products, not the amount purchased, triggers the discount, so you do not need to include it.

Expand Down Expand Up @@ -577,7 +577,7 @@ Accept: application/json
```


To see the list of codes attached to a promotion, send a request to the [Get coupon codes](/docs/rest-management/promotions/coupon-codes-bulk#get-coupon-codes-beta) endpoint. The promotion code is not available using the [Get a promotion](/docs/rest-management/promotions/promotions-single#get-promotion-beta) endpoint.
To see the list of codes attached to a promotion, send a request to the [Get coupon codes](/docs/rest-management/promotions/coupon-codes-bulk#get-coupon-codes-beta) endpoint. The promotion code is not available using the [Get a promotion](/docs/rest-management/promotions/promotions-single#get-promotion) endpoint.

<Tabs items={['Request', 'Response']}>
<Tab>
Expand Down Expand Up @@ -696,11 +696,11 @@ Rules do not need conditions (e.g., 10% off All Common Good Brand). Here, omit t

## Product level discount and order level discount

Order level discount only comes from [Cart Value Action](/docs/rest-management/promotions); it does not allow for you to exclude line items. Product level discounts only come from [Cart Items Action](/docs/rest-management/promotions) which excludes line items while the discounts display on individual eligible items.
Order level discount only comes from Cart Value Action; it does not allow for you to exclude line items. Product level discounts only come from Cart Items Action which excludes line items while the discounts display on individual eligible items.

### Actual discounting behavior

[Cart Value Action](/docs/rest-management/promotions) only applies to order subtotal, that is, line items in the cart, but not shipping or handling fees. When applying order level discounts, all line items in the cart receive equal amounts -- this design allows you to attribute discounts to individual line items for correct tax calculation.
Cart Value Action only applies to order subtotal, that is, line items in the cart, but not shipping or handling fees. When applying order level discounts, all line items in the cart receive equal amounts -- this design allows you to attribute discounts to individual line items for correct tax calculation.

Product level discounts display as discounts on each line item with a strikethrough.

Expand All @@ -716,7 +716,7 @@ Product level discounts always apply before order level discounts regardless of


## Customer-specific promotions
Use the [Cart Value Action](/docs/rest-management/promotions) property to limit the number of customers eligible for a specific promotion.
Use the Cart Value Action property to limit the number of customers eligible for a specific promotion.

The following promotion will only apply to the customers in the VIP group (group ID 1) with a minimum total order count of 10.

Expand Down Expand Up @@ -841,7 +841,7 @@ Two items that belong to both brand X and category Y:
}
```

The following promotion uses [Cart Items Action > Item Matcher > Not Item Matcher > Categories Item Matcher](/docs/rest-management/promotions). This promotion gives all items in the cart 15% off except for items in the sale category. This promotion also does not have a condition. There is nothing the shopper needs to do to apply the discount.
The following promotion uses Cart Items Action > Item Matcher > Not Item Matcher > Categories Item Matcher. This promotion gives all items in the cart 15% off except for items in the sale category. This promotion also does not have a condition. There is nothing the shopper needs to do to apply the discount.

```json filename="Example request: 15% off except sale" showLineNumbers copy
{
Expand Down Expand Up @@ -917,13 +917,13 @@ The stop attribute controls whether to skip all the promotions with lower priori


### Apply once
Apply once controls whether a promotion can run multiple times or just once. If you configure the promotion to repeat, we run a loop to check if a condition is satisfied, then apply action until a condition is no longer satisfied. Notice that under certain conditions/action combinations, this may result in an infinite loop that moves the promotion into “INVALID” status. This is part of the [Rule object](/docs/rest-management/promotions).
Apply once controls whether a promotion can run multiple times or just once. If you configure the promotion to repeat, we run a loop to check if a condition is satisfied, then apply action until a condition is no longer satisfied. Notice that under certain conditions/action combinations, this may result in an infinite loop that moves the promotion into “INVALID” status. This is part of the Rule object.


### As total
If set to `true`, the promotion is distributed among the items in the cart. For example, if the discount is $10 and two eligible items are in the cart, the discount is spread among the items. In this case, each item will get a $5 discount.

If set to `false`, then the promotion will apply to each item. For example, if the discount is $10, each item will be discounted by $10, making the total discount $20. This is part of the [Cart Items Action](/docs/rest-management/promotions).
If set to `false`, then the promotion will apply to each item. For example, if the discount is $10, each item will be discounted by $10, making the total discount $20. This is part of the Cart Items Action.

### Include items considered by condition

Expand All @@ -937,4 +937,4 @@ When the cart only has one item, it will not discount the item in the cart. When

*Buy two from category X, receive $10, buy three from category X, receive $15*:

When the cart contains two items from category X, both items will get the $10 discount. This is part of the [Cart Items Action](/docs/rest-management/promotions).
When the cart contains two items from category X, both items will get the $10 discount. This is part of the Cart Items Action.
2 changes: 1 addition & 1 deletion docs/store-operations/promotions/multi-currency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ You can configure the promotion to target all enabled transactional currencies w

Multi-currency promotions intentionally only support percentage-based discounts (not amount-based discounts). You will not be able to create an amount-based promotion in multiple currencies. This choice prevents discounting based on fluctuating currency rates as some currencies have broader foreign exchange rates than others (for example, a 10 USD discount is substantially different from 10 JPY).

The following is an example of a coupon promotion offered to all international customers worldwide in their local transactional currency. The WELCOME10 coupon applies a 10% discount off the order, and you can digitally distribute the coupon through social media channels (e.g., Instagram, Facebook, TikTok) or email marketing. Use the [Create a promotion](/docs/rest-management/promotions/promotions-bulk#create-promotion-beta) endpoint followed by the [Create a coupon code](/docs/rest-management/promotions/coupon-codes-single#create-a-coupon-code-beta) endpoint.
The following is an example of a coupon promotion offered to all international customers worldwide in their local transactional currency. The WELCOME10 coupon applies a 10% discount off the order, and you can digitally distribute the coupon through social media channels (e.g., Instagram, Facebook, TikTok) or email marketing. Use the [Create a promotion](/docs/rest-management/promotions/promotions-single#create-promotion) endpoint followed by the [Create a coupon code](/docs/rest-management/promotions/coupon-codes-single#create-a-coupon-code) endpoint.

```http filename="Example request: Create a multi-currency promotion" showLineNumbers copy
POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/v3/promotions
Expand Down
6 changes: 3 additions & 3 deletions docs/storefront/wordpress/platform-integration/code.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# BigCommerce for WordPress Plugin Code Reference

To search the BigCommerce for WordPress (BC4WP) codebase for detailed entries on available hooks, functions, classes, and methods, visit the [BigCommerce Plugin Code Reference](https://bigcommerce.moderntribe.qa/).
To search the BigCommerce for WordPress (BC4WP) codebase for detailed entries on available hooks, functions, classes, and methods, visit the [BigCommerce Plugin Code Reference](https://bc-wordpress-reference.vercel.app/).

## Usage notes

The following list contains additional notes on the usage of the hooks, functions, classes, and methods found in the [BigCommerce Plugin Code Reference](https://bigcommerce.moderntribe.qa/) that allow you to extend and customize the BC4WP plugin:
The following list contains additional notes on the usage of the hooks, functions, classes, and methods found in the [BigCommerce Plugin Code Reference](https://bc-wordpress-reference.vercel.app/) that allow you to extend and customize the BC4WP plugin:

### Classes

- Refinery - filters product results on product archive or product category archive pages.
- Refinery - filters product results on product archive or product category archive pages.
2 changes: 1 addition & 1 deletion reference/catalog/categories_catalog.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ paths:
- Categories (deprecated)
deprecated: true
summary: Create a Category
description: "When possible, use the [Category Trees - Create categories](/docs/rest-catalog/category-trees/categories#create-categories) endpoint instead.\n\nCreates a *Category*.\n\nUse this endpoint when an API only works with categories of a default BigCommerce storefront (`channel_id=1`). \n\nUse the [Create categories](/docs/rest-catalog/category-trees/categories#create-categories) endpoint when an API works with categories across different category trees that belong to different storefront channels.\n\n**Required Fields**:\n- `parent_id`: \n\t- To create a child category, set the `parent_id` to the parent category.\n\t- To create a top level category, set the `parent_id` to `0`.\n- `name`\n\n**Read-Only Fields**:\n- `id`\n\n**Limits**:\n- 16,000 categories per store limit.\n- 1,000 categories per product limit.\n- 50 characters category name length.\n- 8 levels of category depth limit.\n- 65,535 characters category description length limit.\n\n **Note:**\n The default rate limit for this endpoint is 40 concurrent requests.\n"
description: "When possible, use the [Category Trees - Create categories](/docs/rest-catalog/category-trees/categories#create-categories) endpoint instead.\n\nCreates a *Category*.\n\nUse this endpoint when an API only works with categories of a default BigCommerce storefront (`channel_id=1`). \n\nUse the [Create categories](/docs/rest-catalog/category-trees/categories#create-categories) endpoint when an API works with categories across different category trees that belong to different storefront channels.\n\n**Required Fields**:\n- `parent_id`: \n\t- To create a child category, set the `parent_id` to the parent category.\n\t- To create a top level category, set the `parent_id` to `0`.\n- `name`\n\n**Read-Only Fields**:\n- `id`\n\n**Limits**:\n- 16,000 categories per store limit.\n- 1,000 categories per product limit.\n- 50 characters category name length.\n- 8 levels of child categories depth limit.\n- 65,535 characters category description length limit."
operationId: createCategory
parameters:
- $ref: '#/components/parameters/ContentType'
Expand Down
4 changes: 2 additions & 2 deletions reference/catalog/products_catalog.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9645,13 +9645,13 @@ components:
DateModifiedMaxParam:
name: 'date_modified:max'
in: query
description: 'Filter items by `date_modified`. For example, `date_modified:max=2020-06-15`.'
description: 'Filter items by `date_modified`. If the `date modified:max` does not include hours, minutes and seconds, the API automatically adds the current time of the request to the date. For example, `date_modified:max=2025-01-15` or `date_modified:max=2025-01-15T00:03:17Z`.'
schema:
type: string
DateModifiedMinParam:
name: 'date_modified:min'
in: query
description: 'Filter items by `date_modified`. For example, `date_modified:min=2018-06-15`.'
description: 'Filter items by `date_modified`. If the `date modified:min` does not include hours, minutes and seconds, the API automatically adds the current time of the request to the date. For example, `date_modified:min=2025-01-15` or `date_modified:min=2025-01-15T00:03:17Z`.'
schema:
type: string
DateLastImportedParam:
Expand Down
6 changes: 3 additions & 3 deletions reference/customers.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ paths:
$ref: '#/components/schemas/ErrorResponse'
'/customers/{customerId}/metafields/{metafieldId}':
get:
summary: Get Customer Metafields List
summary: Get a Customer Metafield
description: |
Lists available metafields for a customer. To retrieve the list, use `customerId` and `metafieldId` in the query parameters.
operationId: getMetafieldsCustomerId
Expand Down Expand Up @@ -1868,11 +1868,11 @@ paths:
title: The resource at that URL is not found.
type: 'https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes'
delete:
summary: Delete Customer Metafields
summary: Delete a Customer Metafield
tags:
- Metafields
description: |
Deletes customer metafields. To delete customer metafields, use 'customerId' and 'metafieldId' in the query parameters.
Deletes a customer metafield. To delete a customer metafield, use 'customerId' and 'metafieldId' in the query parameters.
parameters:
- $ref: '#/components/parameters/customerId'
- $ref: '#/components/parameters/metafieldId'
Expand Down
3 changes: 3 additions & 0 deletions reference/settings.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ paths:
Uploads an image file to use as the storefront favicon. Supported MIME types include GIF, JPEG, and PNG.
- Channel ID can be used as a query parameter for updating channel-specific settings. If omitted, you will interact with the global settings only.
- The uploaded image can be up to 10 MB. Larger files result in an error.
parameters:
- $ref: '#/components/parameters/ContentType'
- $ref: '#/components/parameters/ChannelIdParam'
Expand All @@ -375,6 +376,8 @@ paths:
responses:
'204':
description: OK
'422':
description: Failed to save!
tags:
- Favicon Image
'/settings/inventory/notifications':
Expand Down

0 comments on commit 0524450

Please sign in to comment.