Update/Edit Wholesale Pricing using APIs
This document explains how to update an existing Wholesale 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/wholesale-pricings/{id}{id}is the ID of the Wholesale 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 Wholesale 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:
c. title
The name used to identify the Wholesale Pricing record
Optional in Update API
Must be a string
Maximum length: 255 characters
d. status
Defines whether the record is active or not
Optional in Update API
Accepts only the following values:
true
Pricing rule is active
false
Pricing rule is inactive
e. apply_customer
Defines which customers are eligible for this pricing rule.
Structure:
type
Accepted values:
allloggednon-loggedcustomer-tags
tags
Required only when
type == customer-tagsMust be a comma-separated array
Example:
["wholesale","b2b"]
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-tagsExample:
["vip","wholesale"]
g. apply_product (Required)
Defines which products the pricing rule will be applied to.
Structure:
type
Accepted values:
allproductscollectionsproduct-tags
Other fields are required depending on the selected type:
product_idsβ required iftype == productsproduct_tagsβ required iftype == product-tagscollection_idsβ required iftype == collections
apply_for_variants
Accepted values:
trueorfalseDefault value:
false
h. exclude_product
Defines products to be excluded from the rule.
Structure:
Accepted types:
noneproductscollections
i. discount_for_variants
Used when discounts are configured per variant.
Must be empty if
apply_product.apply_for_variants == falseRequired when
apply_product.apply_for_variants == true
Example structure:
Structure:
Array of products
Each product contains:
idβ Product IDvariant_pricingβ Must betruevariantsβ Array of variants
Each variant contains:
idβ Variant IDdiscount_groupsβ Array of discount configurations
discount_groups rules
If
apply_customer.typeisall,logged, ornon-loggedβ Only one item is allowedIf
apply_customer.type == customer-tagsβ Multiple discount groups can be provided
Fields inside discount_groups:
name
Must match customer type or customer tag
type
Discount type
value
Discount value
Accepted discount types:
percentamountfixed-amount
Value rules:
Must be a number greater than 0
If type is
percent, value must be less than 100
j. apply_market (Required)
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_group
Used when discount is not configured per variant.
Required when:
apply_product.typeis notproducts, ORapply_product.type == productsAND variants are not applied
Structure:
Rules:
typemust be one of:percentamountfixed-amount
valueMust be greater than 0
If type is
percent, value must be less than 100
l. active_date
Used to configure start and end time for the pricing rule.
Structure:
types
Optional
Accepted values:
start_date,end_dateExample:
["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?