Assigns a price group to an order, or unassigns it. Set Assigned to true to assign the price group and false to remove it.
Before you begin#
- The API token needs
OrderPriceGroup_Update_Assigned, either assigned directly under Functions or through a group. See Create an API token. - Requests must be signed if the token requires it. See Make a signed request with HMAC.
- You need the order’s
Order_IDand the price group’s ID or name.
Example requests#
Assign a price group#
Assigns the price group test to order 1000.
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "OrderPriceGroup_Update_Assigned",
"Order_ID": 1000,
"PriceGroup_Name": "test",
"Assigned": true
}
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
PriceGroup_IDEdit_PriceGroupPriceGroup_Name |
Integer String String |
ID of the Price Group. Price Group name Price Group name. Pass one of these three. |
|
Order_ID |
Number | Order ID | |
Assigned |
Boolean | Yes | true/false whether price group is assigned to the order |
Example response#
{
"success": 1
}
Response parameters#
| Parameter | Type | Description |
|---|---|---|
success |
boolean | boolean value for if the request was successful |
Error responses#
| Error Code | Error Message | Error Description |
|---|---|---|
MER-JSN-ORD-00025 |
Order not found | Order ID not found |
MER-PGR-JSN-00101 |
Price Group not found | Price Group not found |
Related functions#
| Function | Use it to |
|---|---|
PriceGroupList_Load_Query |
Find price groups and their IDs |
OrderCoupon_Update_Assigned |
Assign a coupon to an order |
OrderList_Load_Query |
Find the order |
PriceGroupCustomer_Update_Assigned |
Assign a price group to a customer |
Try in Postman#
In the Miva: JSON API: Authenticated collection, open Orders > OrderPriceGroup_Update_Assigned. See Set Up Postman.