Composable Frontend 2.0 Learn more 

  • Promotions/
    Promotion Management/
    Create Fixed Bundle Discount Promotions

    Create Fixed Bundle Discount Promotions

    POST Create Fixed Bundle Discount Promotions

    https://useast.api.elasticpath.com/v2/promotions/
    

    Line-item discounts are only supported by the line calculation method. For more information about this method, see the Calculation Method section. Hierarchy-based promotions are not supported for fixed bundle discount promotions. To promote a bundle, create the bundle in Product Experience Manager, and then create a promotion for that bundle. For more informatiom, see Bundles in Product Experience Manager.

    Parameters

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Body

    NameRequiredTypeDescription
    typeRequiredstringSpecifies the type of the resource. The type of resource for promotions is, promotion.
    nameRequiredstringSpecifies a name for the promotion.
    descriptionRequiredstringSpecifies a description for the promotion.
    enabledRequiredbooleanSpecifies whether the promotion is enabled. The options are true or false, and the default setting is false.
    automaticRequiredbooleanSpecifies whether the promotion is applied automatically to the cart or a code is required to apply the promotion. The default setting is false. When this value is set to true, a code is autogenerated. If this value is set to false, you must create the code manually. For more information about creating codes, see the Create Promotion Codes section.
    promotion_typeRequiredstringSpecifies the type of the promotion. Use bundle_fixed_discount for bundle promotions.
    max_applications_per_cartOptionalintegerSpecifies the maximum number of application of the promotion per cart.
    min_cart_valueOptionalarraySpecifies an array of currency-value objects, min_cart_value[].currency and min_cart_value[].amount, that provide the minimum cart value required for the promotion to apply. You can add one or several value specifications in different currencies.
    schemaRequiredobjectSpecifies the bundle requirements and currencies. In bundle requirements, specify the product SKUs and required quantity of products to apply bundle promotion.
    startRequiredstringSpecifies the start date and time of the promotion or the start date of the promotion. You can provide a specific time in the HH:MM format. For example, "start": "2000-01-01 12:00". If no time is specified, the default start and end time is set to 00:00.
    endRequiredstringSpecifies the end date and time of the promotion or the end date of the promotion.

    The schema object

    NameRequiredTypeDescription
    schema.requirements.targetsRequiredarray [string]Specifies an array of required product SKUs or IDs for the bundle discount promotion. For example, for requirements: [{quantity: 1, targets: ["a", "b"]}, {quantity: 1, targets: ["c", "d"]}], this means the promotion requires one of either SKU a or b and one of either SKU c or d in the cart to qualify for the bundle discount.
    schema.requirements.quantityRequiredintegerSpecifies the quantities of products to be applied for the promotion.
    schema.currencies[].amountRequiredintegerSpecifies the bundle price amount when cart items are qualified for the promotion. For example, when a shopper buys 1 SKU a and 1 sku c in the cart, the amount is $100. This means $100 is the total amount for both SKUs in the cart.
    schema.currencies[].currencyRequiredstringSpecifies a three-letter currency code. For example, USD.
    schema.target_catalogsOptionalarray [string]Specifies the unique identifiers of the catalogs to be applied for this promotion. If you do not set this parameter, promotion will be applied to all catalogs.

    Request Example

    curl -X POST 'https://useast.api.elasticpath.com/v2/promotions' \
         -H "Authorization: Bearer XXXX" \
         -H "content-type: application/json" \
         -d $ {
           "data": {
             "type": "promotion",
             "name": "Fixed bundle promotion example",
             "description": "SKU1 and SKU2 for $150",
             "enabled": true,
             "automatic": true,
             "promotion_type": "bundle_fixed_discount",
             "max_applications_per_cart":1,
             "schema": {
               "requirements": [
              {
                  "targets": [
                    "SKU1"
                ],
                 "quantity": 1
              },
              {
                "targets": [
                  "SKU2"
                ],
                "quantity": 1
              }
            ],
               "currencies": [
              {
                 "amount": 15000,
                 "currency": "USD"
              }
            ],
               "target_catalogs": ["09b9359f-897f-407f-89a2-702e167fe781"]
          },
          "start": "2000-01-01",
          "end": "2100-01-01"
        }
      }'
    

    Response Example

    201 Created

    {
        "data": {
            "type": "promotion",
            "id": "cb7f218f-bb02-43f3-a05b-88cad8e34339",
            "name": "Fixed bundle promotion example",
            "description": "SKU1 and SKU2 for $150",
            "enabled": true,
            "automatic": true,
            "promotion_type": "bundle_fixed_discount",
            "max_applications_per_cart": 1,
            "schema": {
                "requirements": [
                    {
                        "targets": ["SKU1"],
                        "quantity": 1
                    },
                    {
                        "targets": ["SKU2"],
                        "quantity": 1
                    }
                ],
                "currencies": [
                    {
                        "currency": "USD",
                        "amount": 15000
                    }
                ],
                "target_catalogs": ["09b9359f-897f-407f-89a2-702e167fe781"]
            },
            "start": "2000-01-01T00:00:00Z",
            "end": "2100-01-01T00:00:00Z",
            "created_by": "seller@elasticpath.com",
            "updated_by": "another_seller@elasticpath.com",
            "meta": {
                "timestamps": {
                    "created_at": "2021-06-30T17:30:01.662Z",
                    "updated_at": "2021-06-30T17:30:01.662Z"
                }
            }
        }
    }
    
    Previous
    Create X for Amount Discount Promotion