Understanding and Managing Price Groups

Introduction

Price groups in Ordermentum allow suppliers to offer customized pricing for specific customers or groups of customers. This ensures flexibility in pricing strategies, allowing suppliers to offer discounts or promotional pricing to selected retailers without affecting the base product price.

Endpoints

1. List Price Groups

Endpoint:
GET /v1/price-groups

Description: Retrieves all price groups for the supplier.

Example Request:

curl -X GET "https://app.ordermentum.com/v1/price-groups?pageSize=10&pageNo=1"      -H "Authorization: Bearer YOUR_API_TOKEN"

Example Response:

{
  "data": [
    {
      "id": "abcdef12-3456-7890-abcd-ef1234567890",
      "name": "ACL pricing Group",
      "productsTotal": 0,
      "retailersTotal": "3",
      "supplierId": "abcdef12-3456-7890-abcd-ef1234567891",
      "createdAt": "2021-09-22T06:27:37.745Z"
    }
  ]
}

2. Create a Price Group

Endpoint:
POST /v1/price-groups

Description: Creates a new price group for a retailer.

Request Body:

FieldTypeRequiredDescription
namestringYesName of the price group.
descriptionstringNoOptional description of the group.
statusstringYesStatus of the price group (active/inactive).

Example Request:

curl -X POST "https://app.ordermentum.com/v1/price-groups"      -H "Authorization: Bearer YOUR_API_TOKEN"      -H "Content-Type: application/json"      --data '{
       "name": "Preferred Retailers",
       "description": "Exclusive pricing for top clients",
       "status": "active"
     }'

Example Response:

{
  "id": "abcdef12-3456-7890-abcd-ef1234567890",
  "name": "Preferred Retailers",
  "description": "Exclusive pricing for top clients",
  "status": "active",
  "createdAt": "2023-12-01T12:00:00Z",
  "updatedAt": "2023-12-01T12:00:00Z"
}

3. Add a Product or Variant to a Price Group

When adding pricing for products in a price group, the correct endpoint depends on whether the product has variants.

  • For products without variants: Use the /v1/price-groups/{priceGroupId} endpoint to assign product pricing.
  • For products with variants: Use the /v1/variants/{variantId}/prices endpoint to assign pricing to specific product variants.

Updating Product Prices

Endpoint:
PATCH /v1/price-groups/{priceGroupId}

Example Request:

curl -X PATCH "https://app.ordermentum.com/v1/price-groups/abcdef12-3456-7890-abcd-ef1234567890/products"      -H "Authorization: Bearer YOUR_API_TOKEN"      -H "Content-Type: application/json"      --data '{
    "products": [
        {
            "productID": "f12b050a-a1e0-4a76-b86d-4ec7dc38ebb5",
            "type": "fixed",
            "value": "6"
        }
    ]
}'

Updating Variant Prices

To remove a price from a price group for a variant, use the delete action in the request. This differs from products without variants, where setting the price back to the base value achieves the same outcome.

Endpoint:
PATCH /v1/variants/{variantId}/prices

Example Request:

curl -X PATCH "https://app.ordermentum.com/v1/variants/738bbbde-babb-41a6-9cf0-4568aa670196/prices"      -H "Authorization: Bearer YOUR_API_TOKEN"      -H "Content-Type: application/json"      --data '[
       {
         "priceGroupId": "1b57f416-765c-4ecb-bae6-b3cf38897158",
         "type": "fixed",
         "action": "set",
         "value": "1100.0000"
       }
     ]'

Request Body:

FieldTypeRequiredDescription
priceGroupIdstringYesID of the price group.
typestringYesPricing type (e.g., fixed).
actionstringYesAction to take (set or delete).
valuestringYesPrice value for the variant.

Adding a Purchaser to a Price Group

To assign a purchaser to a specific price group, send a PATCH request to update the purchaser’s price group associations.

Example cURL Request

curl --request PATCH   --url https://app.ordermentum.com/v1/purchasers/a1b2c3d4-e5f6-7g8h-9i0j-k1l2m3n4o5p6   --header 'accept: application/json'   --header 'authorization: Bearer <your_access_token>'   --header 'content-type: application/json'   --data '{
    "priceGroupId": "d9e8f7g6-h5i4-j3k2-l1m0-n9o8p7q6r5s4"
  }'

Notes:

  • priceGroupId: The unique ID of the price group to assign to the purchaser.
  • This will replace any existing price group. A purchaser can only belong to one price group at a time.
  • If priceGroupId is set to null, the purchaser will no longer belong to any price group.

Best Practices

  • Keep Price Groups Up to Date: Ensure that promotions and special prices are accurate and timely.
  • Assign Retailers Correctly: Verify that retailers are assigned to the appropriate price groups to prevent pricing discrepancies.
  • Use Price Groups for Promotions: Manage temporary promotions or customer-specific discounts through price groups instead of modifying the base product prices.