Skip to content

PR03 - Create a promotion

Request

Call Frequency
Maximum usage: Once per minute
Read More
Security
Shop-API-Key(Required scopes: ROLE_SHOP_ADMIN)
Query
shop_idinteger, (int64)

Use this parameter when your user has access to several shops. If not specified, the shop_id from your default shop will be used.

Bodyapplication/json
application_to_cartArray of objects

If applicable, promo code to associate to the promotion

channel_codesArray of strings

Channels on which the promotion is applied. If none, promotion applied on all channels

customer_group_idsArray of strings

The customer groups on which the promotion is applied. If none, promotion applies to all customer groups.

customer_organization_idsArray of strings

The customer organizations on which the promotion is applied. If none, promotion applies to all customer organizations.

end_datestring, (date-time)

End date of the promotion period of activity

internal_descriptionstringrequired

Internal description of the promotion, set by the shop

internal_idstringrequired

Promotion identifier

public_descriptionsArray of objects

The public descriptions of the promotion, with the locales they apply to

rewardobjectrequired
start_datestring, (date-time)required

Start date of the promotion period of activity

triggerobjectrequired
curl -i -X POST \
  'https://your-instance.mirakl.net/api/promotions?shop_id=0' \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "application_to_cart": [
      {
        "promo_code": "SUMMER20"
      }
    ],
    "channel_codes": [
      "US"
    ],
    "customer_group_ids": [
      "Group2"
    ],
    "customer_organization_ids": [
      "Org1"
    ],
    "end_date": "2023-08-30T22:00:00.000Z",
    "internal_description": "Summer sale event",
    "internal_id": "SUMMERSALE_3",
    "public_descriptions": [
      {
        "locale": "en_US",
        "value": "Summer promotions"
      },
      {
        "locale": "fr_FR",
        "value": "Promotions d'\''été"
      }
    ],
    "reward": {
      "max_quantity_to_discount": 1,
      "percentage_off": 10,
      "selection": {
        "type": "BRAND",
        "values": [
          "Samsung",
          "Belkin"
        ]
      },
      "type": "PERCENTAGE_OFF"
    },
    "start_date": "2023-04-03T16:18:59.922Z",
    "trigger": {
      "quantity_purchased": 1,
      "same_item_purchased": false,
      "selection": {
        "type": "ALL"
      },
      "type": "EVERY_QUANTITY"
    }
  }'

Responses

Created

Headers
Locationany

URI of the created promotion