API로 도매 가격 만들기
전체 요청 본문 레퍼런스를 포함해, Public API로 새 도매 가격 규칙을 만드는 방법을 안내합니다.
이 문서는 Public API를 사용해 새 도매 가격 규칙을 만드는 방법을 설명합니다.
1. 엔드포인트
섹션 제목: “1. 엔드포인트”새 도매 가격 레코드를 만들려면 다음 엔드포인트를 사용하세요.
POST - https://wholesale.samita.io/api/v1/wholesale-pricings2. 요청 헤더
섹션 제목: “2. 요청 헤더”모든 API 요청에는 다음 필수 헤더가 포함되어야 합니다.
| 헤더 | 설명 | 필수 |
|---|---|---|
X-SAMITA-API-KEY |
Wholesale 앱에서 제공하는 API 키 | 예 |
X-SAMITA-SHOP-URL |
xxx.myshopify.com 형식의 Shopify 스토어 도메인 | 예 |
CONTENT-TYPE |
application/json이어야 합니다 |
예 |
필수 헤더가 하나라도 없으면 요청이 거부됩니다.
3. 요청 본문
섹션 제목: “3. 요청 본문”a. 일반 형식
섹션 제목: “a. 일반 형식”도매 가격을 만드는 데 사용하는 데이터는 JSON 형식으로 전송해야 합니다.
샘플 JSON 구조는 이 문서 끝부분에 있습니다.
샘플 요청 JSON:
{ "title": "New Wholesale Pricing", "status": true, "apply_customer": { "type": "all", "tags": [] }, "exclude_customer": { "type": "none", "tags": [] }, "apply_product": { "type": "all", "product_ids": [], "product_tags": [], "collection_ids": [], "apply_for_variants": false }, "exclude_product": { "type": "none", "product_ids": [], "collection_ids": [] }, "discount_for_variants": [ { "id": 8516448190631, "variant_pricing": true, "variants": [ { "id": 46747346763943, "discount_groups": [ { "name": "all", "type": "percent", "value": "10" } ] } ] } ], "apply_market": { "type": "all", "handle": [] }, "discount_group": { "type": "percent", "value": "10" }, "active_date": { "types": ["start_date", "end_date"], "start_at": "2026-01-15 10:00:00", "end_at": "2026-01-15 10:00:00" }}b. title (필수)
섹션 제목: “b. title (필수)”- 도매 가격 레코드를 식별하는 이름입니다.
- 문자열이어야 합니다.
- 최대 길이: 255자
c. status (필수)
섹션 제목: “c. status (필수)”- 레코드의 활성화 여부를 정의합니다.
- 다음 값만 사용할 수 있습니다.
| 값 | 설명 |
|---|---|
true |
가격 규칙이 활성 상태 |
false |
가격 규칙이 비활성 상태 |
d. apply_customer (필수)
섹션 제목: “d. apply_customer (필수)”이 가격 규칙을 적용할 고객을 정의합니다.
구조:
"apply_customer": { "type": "all", "tags": []}type
다음 중 하나만 사용할 수 있습니다.
all– 모든 고객에게 적용logged– 로그인한 고객에게만 적용non-logged– 비회원(게스트) 고객에게만 적용customer-tags– 특정 태그가 있는 고객에게만 적용
tags
type == customer-tags일 때만 필수입니다.- 쉼표로 구분한 배열이어야 합니다.
- 예:
["wholesale","b2b"]
type이 customer-tags가 아니면 이 필드는 무시해도 됩니다.
e. exclude_customer
섹션 제목: “e. exclude_customer”특정 고객을 가격 규칙에서 제외할 때 사용합니다.
구조:
"exclude_customer": { "type": "none", "tags": []}type
- 기본값:
none - 사용 가능한 값:
| 값 | 설명 |
|---|---|
none |
제외할 고객 없음 |
customer-tags |
태그로 고객 제외 |
tags
type == customer-tags일 때만 필수입니다.- 쉼표로 구분한 배열
- 예:
["vip","wholesale"]
f. apply_product (필수)
섹션 제목: “f. apply_product (필수)”가격 규칙을 적용할 제품을 정의합니다.
구조:
"apply_product": { "type": "all", "product_ids": [], "product_tags": [], "collection_ids": [], "apply_for_variants": false}type
사용 가능한 값:
allproductscollectionsproduct-tags
product_ids
type == products일 때만 필수입니다.- 쉼표로 구분한 제품 ID 목록
- 예:
[1,2,3]
product_tags
type == product-tags일 때만 필수입니다.- 예:
["tag1","tag2"]
collection_ids
type == collections일 때만 필수입니다.- 예:
[1,2,3]
apply_for_variants
- 옵션별로 할인을 설정할 수 있는지 결정합니다.
- 사용 가능한 값:
true또는false - 기본값:
false
g. exclude_product
섹션 제목: “g. exclude_product”규칙에서 제외할 제품을 정의합니다.
구조:
"exclude_product": { "type": "none", "product_ids": [], "collection_ids": []}type
- 기본값:
none - 사용 가능한 값:
| 값 | 설명 |
|---|---|
none |
제외할 제품 없음 |
products |
특정 제품 제외 |
collections |
특정 컬렉션 제외 |
나머지 필드는 선택한 type에 따라서만 필수입니다.
h. discount_for_variants
섹션 제목: “h. discount_for_variants”옵션별로 할인을 적용할 때 사용합니다.
apply_product.apply_for_variants == false이면 비어 있어야 합니다.apply_product.apply_for_variants == true이면 필수입니다.
구조 예시:
"discount_for_variants": [ { "id": 8516448190631, "variant_pricing": true, "variants": [ { "id": 46747346763943, "discount_groups": [ { "name": "all", "type": "percent", "value": "10" } ] } ] }]구조:
- 제품의 배열
- 각 제품에는 다음이 포함됩니다.
id– 제품 IDvariant_pricing– 반드시true여야 합니다variants– 옵션의 배열
각 옵션에는 다음이 포함됩니다.
id– 옵션 IDdiscount_groups– 할인 설정의 배열
discount_groups 규칙
apply_customer.type이all,logged또는non-logged인 경우:
→ 배열에 항목을 하나만 넣을 수 있습니다apply_customer.type == customer-tags인 경우:
→ 할인 그룹을 여러 개 제공할 수 있습니다
discount_groups 안의 필드:
| 필드 | 설명 |
|---|---|
name |
고객 유형 또는 고객 태그와 일치해야 함 |
type |
할인 유형 |
value |
할인 값 |
사용 가능한 할인 유형:
percentamountfixed-amount
값 규칙:
- 0보다 큰 숫자여야 합니다.
- type이
percent이면 값은 100 미만이어야 합니다.
i. apply_market (필수)
섹션 제목: “i. apply_market (필수)”규칙을 적용할 Shopify 시장을 정의합니다.
구조:
"apply_market": { "type": "all", "handle": []}type
사용 가능한 값:
allspecific-market
handle
type == specific-market일 때만 필수입니다.- 쉼표로 구분한 시장 핸들 목록
- 예:
["japan","us"]
시장 핸들을 확인하려면 다음과 같이 하세요.
- Shopify 관리자 페이지에서 시장 섹션으로 이동 > 더 많은 작업을 클릭 > 시장 핸들 편집을 선택 > 표시된 핸들을 복사합니다.


j. discount_group
섹션 제목: “j. discount_group”옵션별로 할인을 설정하지 않을 때 사용합니다.
다음 경우에 필수입니다.
apply_product.type이products가 아닌 경우, 또는apply_product.type == products이면서 옵션을 적용하지 않는 경우
구조:
"discount_group": { "type": "percent", "value": "10"}할인 유형과 값에 대한 규칙은 위에서 설명한 것과 같습니다.
k. active_date
섹션 제목: “k. active_date”가격 규칙의 시작 및 종료 시간을 설정할 때 사용합니다.
구조:
"active_date": { "types": ["start_date", "end_date"], "start_at": "2026-01-15 10:00:00", "end_at": "2026-01-15 10:00:00"}types
- 선택 사항
- 사용 가능한 값:
start_date,end_date - 하나 또는 둘 다 쉼표로 구분해 포함할 수 있습니다.
- 예:
["start_date","end_date"]
start_at
types에start_date가 포함되면 필수입니다.- 형식:
YYYY-MM-DD HH:MM:SS
end_at
types에end_date가 포함되면 필수입니다.- 형식:
YYYY-MM-DD HH:MM:SS
4. API 응답
섹션 제목: “4. API 응답”a. 오류 응답
섹션 제목: “a. 오류 응답”401 – Unauthorized
가능한 원인:
- 스토어 URL 누락
- API 키 누락
- 잘못된 스토어 URL
- 잘못된 API 키
- API 키가 스토어와 일치하지 않음
403 – This action is unauthorized
- API 키에 Create 권한이 없습니다.
- 각 API 키에는 View, Create, Update, Delete 권한을 부여할 수 있습니다.
- 이 API에는 Create 권한이 필요합니다.
- 제공한 ID가 존재하지 않을 때도 반환됩니다.
429 – Too Many Requests
- 요청 한도를 초과했습니다.
- 허용되는 최대치:
| 제한 | 값 |
|---|---|
| 요청 빈도 | 5분당 1회 요청 |
| 일일 한도 | 하루 50회 요청 |
b. 성공 응답
섹션 제목: “b. 성공 응답”200 – API Success
- 도매 가격 레코드가 생성되었습니다.
- 응답은 JSON 형식으로 반환됩니다.
{ "id": 1, "title": "New Wholesale Pricing", "status": true, "apply_customer": { "type": "all", "tags": [] }, "exclude_customer": { "type": "none", "tags": [] }, "apply_product": { "type": "all", "product_ids": [], "product_tags": [], "collection_ids": [], "apply_for_variants": false }, "exclude_product": { "type": "none", "product_ids": [], "collection_ids": [] }, "discount_for_variants": [ { "id": 8516448190631, "variant_pricing": true, "variants": [ { "id": 46747346763943, "discount_groups": [ { "name": "all", "type": "percent", "value": "10" } ] } ] } ], "apply_market": { "type": "all", "handle": [] }, "discount_group": { "type": "percent", "value": "10" }, "active_date": { "types": ["start_date", "end_date"], "start_at": "2026-01-15 10:00:00", "end_at": "2026-01-15 10:00:00" }, "created_at": "2026-01-15T10:00:00", "updated_at": "2026-01-15T10:00:00"}