Manager Approval Rules API (0.1)
Download OpenAPI specification:Download
Represents a set of rules which triggers a mandatory approval request within the order fulfillment
process, typically during checkout in NewStore Associate App.
For example cash_payment_rule
or discount_rule
.
List approval rules
Retrieves all manager approval rules.
Authorizations:
Responses
Response samples
- 200
- 500
{- "rules": [
- {
- "criteria": [
- {
- "name": "payment_method",
- "value": "cash"
}, - {
- "name": "payment_method",
- "value": "gift_card"
}
], - "description": "Split payment with cash and giftcard rule.",
- "label": "cash_gift_card_rule"
}, - {
- "criteria": [
- {
- "name": "discount_percentage",
- "value": "90"
}
], - "description": "Discount rule.",
- "label": "discount_percentage_90"
}, - {
- "criteria": [
- {
- "name": "has_discount",
- "value": "true"
}
], - "description": "Discount rule.",
- "label": "all_discounts_rule"
}, - {
- "criteria": [
- {
- "name": "payment_method",
- "value": "gift_card"
}
], - "description": "Giftcard payment rule.",
- "label": "gift_card_payments_rule"
}, - {
- "criteria": [
- {
- "name": "payment_method",
- "value": "manual_credit_card"
}
], - "description": "Adyen manual credit card rule.",
- "label": "manual_credit_card_adyen_payments_rule"
}, - {
- "criteria": [
- {
- "name": "payment_method",
- "value": "cash"
}
], - "description": "Cash payment rule.",
- "label": "cash_payments_rule"
}
]
}
Create approval rule
Creates a rule containing the criteria that determines if an order needs approval before it can be placed by an associate via NewStore Associate App.
You can use the following criteria to set approval rules:
Criterion name | Type |
---|---|
has_discount |
Boolean |
discount_value |
Number |
discount_percentage |
Number |
discount_level |
order or item |
payment_methods |
Array |
is_return |
Boolean |
is_blind_return |
Boolean |
refund_value |
Number |
has_tax_exemption |
Boolean |
order_value |
Number |
Note: NewStore Associate App allows the associate to apply discounts either on order
level or on
item
level using the discount_level
property. If no value for discount_level
is specified, it is set
to order
by default.
You can apply a fixed discount amount to an order or item(s) using the discount_value
property.
If an order or item matches or exceeds the criteria specified in the approval rules, the order will need approval on the app.
Authorizations:
Request Body schema: application/json
label required | string A short identifier for the approval rule. Cannot contain spaces. |
description required | string The human readable description to display the rule on frontend applications. |
required | Array of objects or objects or objects or objects non-empty The criteria that determine if an order requires manager approval. |
Responses
Request samples
- Payload
Orders with a discount of 80% or more need approval on the app.
{- "label": "RestrictDiscountsAbove80Percent",
- "description": "Discounts equal or above 80%",
- "criteria": [
- {
- "name": "has_discount",
- "value": "true"
}, - {
- "name": "discount_percentage",
- "value": "80"
}, - {
- "name": "discount_level",
- "value": "order"
}
]
}
Response samples
- 201
- 400
- 409
- 500
{- "successful": true,
- "message": ""
}
Update approval rule
Updates the specified approval rule.
Note: Requires the /{label}
to identify the rule
Authorizations:
path Parameters
label required | string The unique identifier of a manager approval rule. |
Request Body schema: application/json
label required | string A short identifier for the approval rule. Cannot contain spaces. |
description required | string The human readable description to display the rule on frontend applications. |
required | Array of objects or objects or objects or objects non-empty The criteria that determine if an order requires manager approval. |
Responses
Request samples
- Payload
{- "label": "RestrictDiscountsAbove80Percent",
- "description": "Discounts equal or above 80%",
- "criteria": [
- {
- "name": "has_discount",
- "value": "true"
}, - {
- "name": "discount_percentage",
- "value": "80"
}, - {
- "name": "discount_level",
- "value": "order"
}
]
}
Response samples
- 200
- 400
- 404
- 500
{- "successful": true,
- "message": ""
}
Delete approval rule
Deletes the specified rule.
Note: Requires the /{label}
to identify the rule
Authorizations:
path Parameters
label required | string The unique identifier of a manager approval rule. |
Responses
Response samples
- 200
- 404
- 500
{- "successful": true,
- "message": ""
}