Skip to content

About Discount

Access scope

Multiple access scopes needed — refer to each endpoint for access scope requirements.

Genstore's discount system helps merchants create and manage promotional offers. It lets you define triggers, set discount rules, and control how customers save on purchases. This module handles everything from simple dollar-off deals to complex multi-product promotions.

Core Concepts

  • Discount: Price reduction configuration that can be set as a percentage or fixed amount
  • Trigger: Set of conditions that activate a discount, including:
    • Order Amount: Discount activates when order reaches specified amount.
    • Product Scope: Specific products or collections eligible for discount.
    • Usage Rules: Restrictions like user tier or usage limits.
  • Discount Types: Supported discount formats, such as order discounts or shipping fee reductions.

Core Features

  • Create Discount: Set up new discount rules and promotion configurations.
  • Update Discount: Modify existing discount rules and settings.
  • Delete Discount: Remove specified discount promotion.
  • Query Discount Details: Retrieve specific discount rules and settings.

WARNING

Review the impact on current orders before modifying active discounts, as changes affect pricing immediately.

Use Cases

  • Promotion Management: Operations teams can set up purchase discounts and free shipping rules, such as "$10 off orders over $100" or "Free shipping on orders over $100".
  • Discount Adjustment: Merchants can dynamically adjust discount strategies based on promotion performance.
  • Performance Analysis: Operations teams can review discount configurations and usage to evaluate promotion effectiveness.

Discount Object

The discount includes a set of applicable conditions, specifying the circumstances under which the discount is triggered or activated, referred to as the discount trigger. Once the applicable conditions are met, the discount can be applied to product prices, shipping fees, or other charges. Additionally, you can configure details such as the discount name, start time, and end time.

Properties

discountobject
discount.
- Hide child properties
triggerobject
Trigger or conditions for the promotion activity.
+ Show child properties
discountsobject
The outcome of the discount.
+ Show child properties
namestring
Discount name.
startTimestring
Discount start time.
promotionTypeobject
Categories of the discount activity.
+ Show child properties
endTimestring
Discount end time.
discountIdnumber
Unique identification of discount.
bash
{
  "discount": {
    "promotionType": {
      "categoryType": "PRODUCT_DISCOUNT",
      "generateType": {
        "discountCode": "71NLIYCH",
        "generateDiscountType": "CODE_DISCOUNT"
      },
      "discountType": "PRICE_REDUCTION"
    },
    "discounts": {
      "discountValueType": "FIXED_AMOUNT_OFF",
      "value": "10"
    },
    "name": "My Discount Simple",
    "startTime": "2024-11-11T10:05:19.421Z",
    "trigger": {
      "buyConditionValue": "10",
      "scopeType": "SPECIFIC_PRODUCTS",
      "usageSetting": {
        "combinations": [
          "PRODUCT",
          "ORDER"
        ],
        "customerOneUse": "false",
        "customerScopeType": "ALL",
        "discountCodeUseCount": "11"
      },
      "collectionList": {
        "name": "Spring Collection",
        "id": "1027"
      },
      "buyConditionType": "MINIMUM_NO",
      "productList": [
        {
          "discountProductSkuLists": [
            {
              "id": "107362071756584"
            }
          ],
          "name": "shoes",
          "id": "102744478756584"
        }
      ]
    },
    "endTime": "2024-11-11T10:05:19.421Z",
    "discountId": "1234123"
  }
}

POST Create discount

Create a discount.

Access scope

Requires ANY of the following access scopes: write_discounts

Endpoint

POST /api/202412/discounts 

Request Params

discountobject
Discount.
- Hide child properties
triggerobject
Trigger or conditions for the promotion activity.
+ Show child properties
discountsobject
The outcome of the discount.
+ Show child properties
namestring
Discount name.
startTimestring
Discount start time.
promotionTypeobject
Categories of the discount activity.
+ Show child properties
endTimestring
Discount end time.

Response Data

discountobject
Discount.
- Hide child properties
triggerobject
Trigger or conditions for the promotion activity.
+ Show child properties
discountsobject
The outcome of the discount.
+ Show child properties
namestring
Discount name.
startTimestring
Discount start time.
promotionTypeobject
Categories of the discount activity.
+ Show child properties
endTimestring
Discount end time.
discountIdnumber
Unique identification of discount.
bash
curl -X POST \ 
https://{shop}.genmystore.com/api/202412/discounts" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"discount":{
		"promotionType":{
			"categoryType":"PRODUCT_DISCOUNT",
			"generateType":{
				"discountCode":"71NLIYCH",
				"generateDiscountType":"CODE_DISCOUNT"
			},
			"discountType":"PRICE_REDUCTION"
		},
		"discounts":{
			"discountValueType":"FIXED_AMOUNT_OFF",
			"value":"10"
		},
		"name":"My Discount Simple",
		"startTime":"2024-11-11T10:05:19.421Z",
		"trigger":{
			"buyConditionValue":"10",
			"scopeType":"SPECIFIC_PRODUCTS",
			"freeShippingLimit":"12.6",
			"usageSetting":{
				"combinations":[
					"PRODUCT",
					"ORDER"
				],
				"customerOneUse":"false",
				"customerScopeType":"ALL",
				"discountCodeUseCount":"11",
				"segments":[
					{
						"id":"123"
					}
				]
			},
			"collectionList":[
				{
					"id":"123"
				}
			],
			"freeShippingCountryList":[
				"OA",
				"CN"
			],
			"buyConditionType":"MINIMUM_NO",
			"productList":[
				{
					"discountProductSkuLists":[
						{
							"id":"107362071756584"
						}
					],
					"id":"102744478756584"
				}
			]
		},
		"endTime":"2024-11-11T10:05:19.421Z"
	}
}'
json
HTTP/1.1 200 OK
{
  "discount": {
    "promotionType": {
      "categoryType": "PRODUCT_DISCOUNT",
      "generateType": {
        "discountCode": "71NLIYCH",
        "generateDiscountType": "CODE_DISCOUNT"
      },
      "discountType": "PRICE_REDUCTION"
    },
    "discounts": {
      "discountValueType": "FIXED_AMOUNT_OFF",
      "value": "10"
    },
    "name": "My Discount Simple",
    "startTime": "2024-11-11T10:05:19.421Z",
    "trigger": {
      "buyConditionValue": "10",
      "freeShippingCountryList ": [
        "OA",
        "CN"
      ],
      "scopeType": "SPECIFIC_PRODUCTS",
      "freeShippingLimit": "12.6",
      "usageSetting": {
        "combinations": [
          "PRODUCT",
          "ORDER"
        ],
        "customerOneUse": "false",
        "customerScopeType": "ALL",
        "discountCodeUseCount": "11",
        "segments": [
          {
            "id": "123"
          }
        ]
      },
      "collectionList": [
        {
          "id": "123"
        }
      ],
      "buyConditionType": "MINIMUM_NO",
      "productList": [
        {
          "discountProductSkuLists": [
            {
              "id": "107362071756584"
            }
          ],
          "name": "shoes",
          "id": "102744478756584"
        }
      ]
    },
    "endTime": "2024-11-11T10:05:19.421Z",
    "discountId": "21003695070100"
  }
}

PUT Update discount

Edit the discount.

Access scope

Requires ANY of the following access scopes: write_discounts

Endpoint

PUT /api/202412/discounts/{discountId} 

Request Params

discountobject
Discount.
- Hide child properties
triggerobject
Trigger or conditions for the promotion activity.
+ Show child properties
discountsobject
The outcome of the discount.
+ Show child properties
namestring
Discount name.
startTimestring
Discount start time.
promotionTypeobject
Categories of the discount activity.
+ Show child properties
endTimestring
Discount end time.
discountIdnumber
Unique identification of discount.

Response Data

discountobject
Discount.
- Hide child properties
triggerobject
Trigger or conditions for the promotion activity.
+ Show child properties
discountsobject
The outcome of the discount.
+ Show child properties
namestring
Discount name.
startTimestring
Discount start time.
promotionTypeobject
Categories of the discount activity.
+ Show child properties
endTimestring
Discount end time.
discountIdnumber
Unique identification of discount.
bash
curl -X PUT \ 
https://{shop}.genmystore.com/api/202412/discounts/{discountId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"discount":{
		"promotionType":{
			"categoryType":"PRODUCT_DISCOUNT",
			"generateType":{
				"discountCode":"71NLIYCH",
				"generateDiscountType":"CODE_DISCOUNT"
			},
			"discountType":"PRICE_REDUCTION"
		},
		"discounts":{
			"discountValueType":"FIXED_AMOUNT_OFF",
			"value":"10"
		},
		"name":"My Discount Simple",
		"startTime":"2024-11-11T10:05:19.421Z",
		"trigger":{
			"buyConditionValue":"10",
			"scopeType":"SPECIFIC_PRODUCTS",
			"freeShippingLimit":"12.6",
			"usageSetting":{
				"combinations":[
					"PRODUCT",
					"ORDER"
				],
				"customerOneUse":"false",
				"customerScopeType":"ALL",
				"discountCodeUseCount":"11",
				"segments":[
					{
						"id":"123"
					}
				]
			},
			"collectionList":[
				{
					"id":"123"
				}
			],
			"freeShippingCountryList":[
				"OA",
				"CN"
			],
			"buyConditionType":"MINIMUM_NO",
			"productList":[
				{
					"discountProductSkuLists":[
						{
							"id":"107362071756584"
						}
					],
					"name":"shoes",
					"id":"102744478756584"
				}
			]
		},
		"endTime":"2024-11-11T10:05:19.421Z",
		"discountId":"21003695070100"
	}
}'
json
HTTP/1.1 200 OK
{
  "discount": {
    "promotionType": {
      "categoryType": "PRODUCT_DISCOUNT",
      "generateType": {
        "discountCode": "71NLIYCH",
        "generateDiscountType": "CODE_DISCOUNT"
      },
      "discountType": "PRICE_REDUCTION"
    },
    "discounts": {
      "discountValueType": "FIXED_AMOUNT_OFF",
      "value": "10"
    },
    "name": "My Discount Simple",
    "startTime": "2024-11-11T10:05:19.421Z",
    "trigger": {
      "buyConditionValue": "10",
      "scopeType": "SPECIFIC_PRODUCTS",
      "freeShippingLimit": "12.6",
      "usageSetting": {
        "combinations": [
          "PRODUCT",
          "ORDER"
        ],
        "customerOneUse": "false",
        "customerScopeType": "ALL",
        "discountCodeUseCount": "11",
        "segments": [
          {
            "id": "123"
          }
        ]
      },
      "collectionList": [
        {
          "id": "123"
        }
      ],
      "freeShippingCountryList": [
        "OA",
        "CN"
      ],
      "buyConditionType": "MINIMUM_NO",
      "productList": [
        {
          "discountProductSkuLists": [
            {
              "id": "107362071756584"
            }
          ],
          "name": "shoes",
          "id": "102744478756584"
        }
      ]
    },
    "endTime": "2024-11-11T10:05:19.421Z",
    "discountId": "21003695070100"
  }
}

PUT Update discount status

Activate or deactivate the discount.

Access scope

Requires ANY of the following access scopes: write_discounts

Endpoint

PUT /api/202412/discounts/{discountId}/status 

Request Params

discountobject
The discount object with status that needs to be updated.
- Hide child properties
operateTypestring
Operate type. Enum: ACTIVE - activate the discount; INACTIVE - deactivate the discount.

Response Data

discountobject
Return the discount object.
- Hide child properties
discountIdnumber
Unique identification of discount.
namestring
Discount name.
statusstring
Discount status. Enum: NOT_RUN - discount have not running; RUN - discount is running; TIME_OVER - discount is timeout.
bash
curl -X PUT \ 
https://{shop}.genmystore.com/api/202412/discounts/{discountId}/status" \ 
-H "X-Genstore-Access-Token: {access_token}" \ 
-H "Content-Type: application/json" \ 
-d '{
	"discount":{
		"operateType":"INACTIVE"
	}
}'
json
HTTP/1.1 200 OK
{
  "discount": {
    "name": "My Discount Simple",
    "discountId": "21003695070100",
    "status": "RUN"
  }
}

DELETE Delete discount

Delete the created discount.

Access scope

Requires ANY of the following access scopes: write_discounts

Endpoint

DELETE /api/202412/discounts/{discountId} 

Request Params

discountIdnumber
A globally-unique discount ID.

Response Data

{}
bash
curl -X DELETE \ 
https://{shop}.genmystore.com/api/202412/discounts/{discountId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \
json
HTTP/1.1 200 OK
{}

GET Get discount details

Query for discount details.

Access scope

Requires ANY of the following access scopes: write_discounts read_discounts

Endpoint

GET /api/202412/discounts/{discountId} 

Request Params

discountIdnumber
Unique identification of discount.

Response Data

discountobject
Discount.
- Hide child properties
triggerobject
Trigger or conditions for the promotion activity.
+ Show child properties
discountsobject
The outcome of the discount.
+ Show child properties
namestring
Discount name.
startTimestring
Discount start time.
promotionTypeobject
Categories of the discount activity.
+ Show child properties
endTimestring
Discount end time.
discountIdnumber
Unique identification of discount.
statusstring
Discount status. Enum: NOT_RUN - discount have not running; RUN - discount is running; TIME_OVER - discount is timeout.
bash
curl -X GET \ 
https://{shop}.genmystore.com/api/202412/discounts/{discountId}" \ 
-H "X-Genstore-Access-Token: {access_token}" \
json
HTTP/1.1 200 OK
{
  "discount": {
    "promotionType": {
      "categoryType": "PRODUCT_DISCOUNT",
      "generateType": {
        "discountCode": "71NLIYCH",
        "generateDiscountType": "CODE_DISCOUNT"
      },
      "discountType": "PRICE_REDUCTION"
    },
    "discounts": {
      "discountValueType": "FIXED_AMOUNT_OFF",
      "value": "10"
    },
    "name": "My Discount Simple",
    "startTime": "2024-11-11T10:05:19.421Z",
    "trigger": {
      "buyConditionValue": "10",
      "scopeType": "SPECIFIC_PRODUCTS",
      "usageSetting": {
        "combinations": [
          "PRODUCT",
          "ORDER"
        ],
        "customerOneUse": "false",
        "customerScopeType": "ALL",
        "discountCodeUseCount": "11"
      },
      "collectionList": [
        {
          "id": "123"
        }
      ],
      "buyConditionType": "MINIMUM_NO",
      "productList": [
        {
          "discountProductSkuLists": [
            {
              "id": "107362071756584"
            }
          ],
          "name": "shoes",
          "id": "102744478756584"
        }
      ]
    },
    "endTime": "2024-11-11T10:05:19.421Z",
    "discountId": "21003695070100",
    "status": "RUN"
  }
}

GET Query discount

Query discount list.

Access scope

Requires ANY of the following access scopes: write_discounts read_discounts

Endpoint

GET /api/202412/discounts 

Request Params

limitnumber
Limit on the number of items per page.
pageTokenstring
Query pagination cursor, required from the second call onwards.
namestring
Discount name.
startTimestring
Discount start time.
endTimestring
Discount end time.
statusstring
Discount status. Enum: NOT_RUN - discount have not running;RUN - discount is running;TIME_OVER - discount is timeout.
generateDiscountTypestring
Type of discount creation. Enum: CODE_DISCOUNT - with discount code; AUTOMATIC_DISCOUNT - automatically.
categoryTypestring
Classification of discount target: product discount or order discount. Enum: PRODUCT_DISCOUNT - product discount; ORDER_DISCOUNT - order discount.
discountTypestring
Classification of discount effect: price reduction on a single item or an order discount. Enum: PRICE_REDUCTION - price reduction for product scope; ORDER_DISCOUNT - discount for order scope.
discountCodestring
Discount code.
sinceIdnumber
In the first page, paginate starting from sinceId.

Response Data

discountsarray
Discount list.
- Hide child properties
namestring
Discount name.
discountIdnumber
Unique identification of discount.
statusstring
Discount status. Enum: NOT_RUN - discount have not running; RUN - discount is running; TIME_OVER - discount is timeout.
discountCodestring
Discount code.
categoryTypestring
Classification of discount target: product discount or order discount.
generateDiscountTypestring
Type of discount creation.
discountTypestring
Type of discount: item-level or order-level price reduction. Enum: PRICE_REDUCTION - Applies to individual items; ORDER_DISCOUNT - Applies to entire order.
startTimestring
Discount start time.
endTimestring
Discount end time.
bash
curl -X GET \ 
https://{shop}.genmystore.com/api/202412/discounts" \ 
-H "X-Genstore-Access-Token: {access_token}" \
json
HTTP/1.1 200 OK
{
  "discounts": [
    {
      "categoryType": "PRODUCT_DISCOUNT",
      "discountCode": "DYXYAB",
      "name": "Discount A",
      "discountType": "PRICE_REDUCTION",
      "startTime": "2024-11-11T10:05:19.421Z",
      "endTime": "2024-11-11T10:06:19.421Z",
      "discountId": "21003695070100",
      "status": "NOT_RUN",
      "generateDiscountType": "CODE_DISCOUNT"
    }
  ]
}