Update/Edit Volume Pricing using APIs
This document explains how to update an existing Volume Pricing rule using the Public API.
1. Endpoint
To update an existing Wholesale Pricing record, use the following endpoint:
PUT https://wholesale.samita.io/api/v1/volume-pricings/{id}{id}is the ID of the Volume Pricing recordThe ID can be obtained from the app interface (without the β#β symbol)
Example reference:

Example:
2. Request Headers
All API requests must include the following required headers:
X-SAMITA-API-KEY
API key provided in the Wholesale app
Yes
X-SAMITA-SHOP-URL
Shopify shop domain in format xxx.myshopify.com
Yes
CONTENT-TYPE
Must be application/json
Yes
If any required header is missing, the request will be rejected.
3. Request Body
_ The data used to update Volume Pricing must be sent in JSON format. A sample JSON structure is provided at the end of this document.
_ Only the fields that need to be updated are required in the request. It is not mandatory to send all fields like in the Create API method.
_ Unspecified fields will remain unchanged
Sample Request JSON:
b. title
The name used to identify the Wholesale Pricing record
Must be a string
Maximum length: 255 characters
c. status
Defines whether the record is active or not
Accepts only the following values:
true
Pricing rule is active
false
Pricing rule is inactive
d. type
Defines whether volume pricing is calculated by quantity or amount.
Accepted values:
quantityamount
e. apply_customer
Defines which customers are eligible for this pricing rule.
Structure:
type
Accepted values (only one of the following):
allβ Apply to all customersloggedβ Apply only to logged-in customersnon-loggedβ Apply only to guest customerscustomer-tagsβ Apply only to customers with specific tags
tags
Required only when
type == customer-tagsMust be a comma-separated array
Example:
["wholesale","b2b"]
If type is not customer-tags, this field can be ignored.
f. exclude_customer
Used to exclude specific customers from the pricing rule.
Structure:
type
Default value:
noneAccepted values:
none
Do not exclude any customer
customer-tags
Exclude customers by tags
tags
Required only when
type == customer-tagsComma-separated array
Example:
["vip","internal"]
g. apply_product
Defines which products the pricing rule will be applied to.
Structure:
type
Accepted values:
allproductscollectionsproduct-tags
product_ids
Required only when
type == productsComma-separated list of product IDs
Example:
[1,2,3]
product_tags
Required only when
type == product-tagsExample:
["tag1","tag2"]
collection_ids
Required only when
type == collectionsExample:
[1,2,3]
apply_for_variants
Determines whether discounts can be configured per variant
Accepted values:
trueorfalseDefault value:
false
h. exclude_product
Defines products to be excluded from the rule.
Structure:
type
Default:
noneAccepted values:
none
Do not exclude any product
products
Exclude specific products
collections
Exclude specific collections
Other fields are required only depending on the selected type.
i. discount_for_variants
Defines discount configuration at the product and/or variant level.
Leave this field empty if
apply_product.apply_for_variants == false.If
apply_product.apply_for_variants == true, this field is required.The structure must be an array of product configurations.
Structure:
i.1. id (required)
Product ID.
Must match an existing product.
i.2. duplicated
Indicates whether the product has multiple quantity/amount ranges.
Accepted values:
truefalse
Rules:
If
true: the product contains multiple quantity/amount ranges.If
false: the product has only one quantity/amount range.
i.3. from_qty / from_amount
Starting quantity or amount of the range.
Rules:
The first item may be empty (defaults to 1).
All subsequent items are required.
i.4. to_qty / to_amount
Ending quantity or amount of the range.
Rules:
Can be empty (will automatically be calculated as the next item's
fromvalue minus 1).If provided, it must be less than the next item's
fromvalue.
Examples:
Item 1: 0β10 β Item 2: 11β20
Item 1: 0βblank β Item 2: 10βblank
Item 1: blankβ10 β Item 2: 11βblank
i.5. discount_groups (Product Level)
Defines discount configuration for each quantity/amount range at the product level.
Required if
variant_pricing == false.Leave empty if
variant_pricing == true.Must be an array of discount objects corresponding to the configured
apply_customer.type.
Structure:
+ name
Accepted values:
all(ifapply_customer.type == all)logged(ifapply_customer.type == logged)non-logged(ifapply_customer.type == non-logged)
If another value is provided, it will be treated as a customer tag, and it must match one of the tags defined in apply_customer.tags.
+ type
Defines the discount type.
Accepted values:
percentβ Percentage discountamountβ Fixed amount deducted from the pricefixed-amountβ Final fixed price
+ value
Must be a number
Must be greater than 0
If
type == percent, value must be less than 100
i.6. variant_pricing
Indicates whether discount is applied at the variant level.
Accepted values:
truefalse
i.7. variants
Defines variant-level discount configuration.
Required if
variant_pricing == trueLeave empty if
variant_pricing == falseMust be an array of variant configurations
Structure:
+ id (required)
Variant ID.
+ duplicate
Indicates whether the variant has multiple quantity/amount ranges.
Accepted values:
truefalse
Rules:
If
true: the variant contains multiple ranges.If
false: the variant has only one range.
+ from_qty / from_amount
Starting quantity or amount.
Rules:
First item may be empty (defaults to 1).
All subsequent items are required.
+ to_qty / to_amount
Ending quantity or amount.
Rules:
Can be empty (auto-calculated as next item's
fromminus 1).If provided, must be less than the next item's
fromvalue.
Examples:
Item 1: 0β10 β Item 2: 11β20
Item 1: 0βblank β Item 2: 10βblank
Item 1: blankβ10 β Item 2: 11βblank
+ discount_groups (Variant Level)
Defines discount configuration per quantity/amount range at the variant level.
Rules:
If
apply_customer.typeis:allloggednon-loggedβ The array must contain only one item.
If
apply_customer.type == customer-tagsβ The array must contain multiple items (one per customer tag).
name
Accepted values:
allloggednon-logged
If another value is provided, it will be treated as a customer tag and must match a tag defined in apply_customer.tags.
type
Accepted values:
percentamountfixed-amount
value
Must be a number
Must be greater than 0
If
type == percent, value must be less than 100
j. apply_market
Defines which Shopify markets the rule applies to.
Structure:
type
Accepted values:
allspecific-market
handle
Required only when
type == specific-marketComma-separated list of market handles
Example:
["japan","us"]
k. discount_methods
Accepted values:
variantβ Same Variantacross_groupβ Mix Variantswithin_each_groupβ Mix Products
These correspond to the options available in the app.
Example:
l. discount_group
Defines quantity/amount ranges and discount values.
from_qty / from_amount
to_qty / to_amount
Same validation rules as described above.
Accepted "type" values:
percentamountfixed-amount
value:
Must be > 0
If percent β must be < 100
Structure:
Rules are the same as described above for discount types and values.
k. active_date
Used to configure start and end time for the pricing rule.
Structure:
types
Optional
Accepted values:
start_date,end_dateCan include one or both, separated by comma
Example:
["start_date","end_date"]
start_at
Required if
typesincludesstart_dateFormat:
YYYY-MM-DD HH:MM:SS
end_at
Required if
typesincludesend_dateFormat:
YYYY-MM-DD HH:MM:SS
4. API Response
a. Error Responses
401 β Unauthorized
Possible reasons:
Missing shop URL
Missing API key
Invalid shop URL
Invalid API key
API key does not match the shop
403 β This action is unauthorized
API key does not have Update permission
Each API key can have: View, Create, Update, Delete permissions
This API requires Update permission
Also returned when the provided ID does not exist
429 β Too Many Requests
Rate limit exceeded:
Maximum 1 request per 5 minutes
Maximum 50 requests per day
b. Success Response
200 β API Success
Wholesale Pricing record updated successfully
Response returned in JSON format
Sample Response JSON:
Last updated
Was this helpful?