# API Test site

Wholesale pricing APIs

## GET /wholesale-pricings

> Get list wholesale pricings

```json
{"openapi":"3.0.3","info":{"title":"Wholesale pricing API","version":"1.0.0"},"tags":[{"name":"API Test site","description":"Wholesale pricing APIs"}],"servers":[{"url":"https://wholesale.samita.io/api/v1"}],"paths":{"/wholesale-pricings":{"get":{"tags":["API Test site"],"description":"Get list wholesale pricings","parameters":[{"name":"query","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["decrease","ascrease"]}}],"responses":{"200":{"description":"A list of wholesale pricings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WholesalePricing"}}}}},"401":{"description":"Unauthorized"},"403":{"description":"This action is unauthorized"},"429":{"description":"Too Many Requests"}}}}},"components":{"schemas":{"WholesalePricing":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"status":{"type":"boolean","enum":[true,false]},"apply_customer":{"$ref":"#/components/schemas/ApplyCustomer"},"exclude_customer":{"$ref":"#/components/schemas/ExcludeCustomer"},"apply_product":{"$ref":"#/components/schemas/ApplyProduct"},"exclude_product":{"$ref":"#/components/schemas/ExcludeProduct"},"discount_for_variants":{"type":"array","items":{"$ref":"#/components/schemas/DiscountForVariant"}},"apply_market":{"$ref":"#/components/schemas/ApplyMarket"},"discount_group":{"$ref":"#/components/schemas/DiscountGroup"},"active_date":{"$ref":"#/components/schemas/ActiveDate"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}},"ApplyCustomer":{"type":"object","properties":{"type":{"type":"string","enum":["all","logged","non-logged","customer-tags"]},"tags":{"type":"array","items":{"type":"string"}}}},"ExcludeCustomer":{"type":"object","properties":{"type":{"type":"string","enum":["none","customer-tags"]},"tags":{"type":"array","items":{"type":"string"}}}},"ApplyProduct":{"type":"object","properties":{"type":{"type":"string","enum":["all","products","collections","product-tags"]},"product_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"product_tags":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"apply_for_variants":{"type":"boolean","enum":[true,false]}}},"ExcludeProduct":{"type":"object","properties":{"type":{"type":"string","enum":["none","products","collections"]},"product_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"collection_ids":{"type":"array","items":{"type":"integer","format":"int64"}}}},"DiscountForVariant":{"type":"object","required":["id","variant_pricing","variants"],"properties":{"id":{"type":"integer","format":"int64"},"variant_pricing":{"type":"boolean","enum":[true,false]},"variants":{"type":"array","items":{"$ref":"#/components/schemas/VariantDiscount"}}}},"VariantDiscount":{"type":"object","required":["id","discount_groups"],"properties":{"id":{"type":"integer","format":"int64"},"discount_groups":{"type":"array","items":{"$ref":"#/components/schemas/VariantDiscountGroup"}}}},"VariantDiscountGroup":{"type":"object","required":["name","type","value"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["percent","amount","fixed-amount"]},"value":{"type":"string"}}},"ApplyMarket":{"type":"object","properties":{"type":{"type":"string","enum":["all","specific-market"]},"handle":{"type":"array","items":{"type":"string"}}}},"DiscountGroup":{"type":"object","properties":{"type":{"type":"string","enum":["percent","amount","fixed-amount"]},"value":{"type":"string"}}},"ActiveDate":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"},"enum":["start_date","end_date"]},"start_at":{"type":"string"},"end_at":{"type":"string"}}}}}}
```

## POST /wholesale-pricings

> Create wholesale pricing

```json
{"openapi":"3.0.3","info":{"title":"Wholesale pricing API","version":"1.0.0"},"tags":[{"name":"API Test site","description":"Wholesale pricing APIs"}],"servers":[{"url":"https://wholesale.samita.io/api/v1"}],"paths":{"/wholesale-pricings":{"post":{"tags":["API Test site"],"description":"Create wholesale pricing","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WholesalePricingCreate"}}}},"responses":{"200":{"description":"A wholesale pricing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WholesalePricing"}}}},"401":{"description":"Unauthorized"},"403":{"description":"This action is unauthorized"},"429":{"description":"Too Many Requests"}}}}},"components":{"schemas":{"WholesalePricingCreate":{"type":"object","properties":{"title":{"type":"string"},"status":{"type":"boolean","enum":[true,false]},"apply_customer":{"$ref":"#/components/schemas/ApplyCustomer"},"exclude_customer":{"$ref":"#/components/schemas/ExcludeCustomer"},"apply_product":{"$ref":"#/components/schemas/ApplyProduct"},"exclude_product":{"$ref":"#/components/schemas/ExcludeProduct"},"discount_for_variants":{"type":"array","items":{"$ref":"#/components/schemas/DiscountForVariant"}},"apply_market":{"$ref":"#/components/schemas/ApplyMarket"},"discount_group":{"$ref":"#/components/schemas/DiscountGroup"},"active_date":{"$ref":"#/components/schemas/ActiveDate"}}},"ApplyCustomer":{"type":"object","properties":{"type":{"type":"string","enum":["all","logged","non-logged","customer-tags"]},"tags":{"type":"array","items":{"type":"string"}}}},"ExcludeCustomer":{"type":"object","properties":{"type":{"type":"string","enum":["none","customer-tags"]},"tags":{"type":"array","items":{"type":"string"}}}},"ApplyProduct":{"type":"object","properties":{"type":{"type":"string","enum":["all","products","collections","product-tags"]},"product_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"product_tags":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"apply_for_variants":{"type":"boolean","enum":[true,false]}}},"ExcludeProduct":{"type":"object","properties":{"type":{"type":"string","enum":["none","products","collections"]},"product_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"collection_ids":{"type":"array","items":{"type":"integer","format":"int64"}}}},"DiscountForVariant":{"type":"object","required":["id","variant_pricing","variants"],"properties":{"id":{"type":"integer","format":"int64"},"variant_pricing":{"type":"boolean","enum":[true,false]},"variants":{"type":"array","items":{"$ref":"#/components/schemas/VariantDiscount"}}}},"VariantDiscount":{"type":"object","required":["id","discount_groups"],"properties":{"id":{"type":"integer","format":"int64"},"discount_groups":{"type":"array","items":{"$ref":"#/components/schemas/VariantDiscountGroup"}}}},"VariantDiscountGroup":{"type":"object","required":["name","type","value"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["percent","amount","fixed-amount"]},"value":{"type":"string"}}},"ApplyMarket":{"type":"object","properties":{"type":{"type":"string","enum":["all","specific-market"]},"handle":{"type":"array","items":{"type":"string"}}}},"DiscountGroup":{"type":"object","properties":{"type":{"type":"string","enum":["percent","amount","fixed-amount"]},"value":{"type":"string"}}},"ActiveDate":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"},"enum":["start_date","end_date"]},"start_at":{"type":"string"},"end_at":{"type":"string"}}},"WholesalePricing":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"status":{"type":"boolean","enum":[true,false]},"apply_customer":{"$ref":"#/components/schemas/ApplyCustomer"},"exclude_customer":{"$ref":"#/components/schemas/ExcludeCustomer"},"apply_product":{"$ref":"#/components/schemas/ApplyProduct"},"exclude_product":{"$ref":"#/components/schemas/ExcludeProduct"},"discount_for_variants":{"type":"array","items":{"$ref":"#/components/schemas/DiscountForVariant"}},"apply_market":{"$ref":"#/components/schemas/ApplyMarket"},"discount_group":{"$ref":"#/components/schemas/DiscountGroup"},"active_date":{"$ref":"#/components/schemas/ActiveDate"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}}
```

## GET /wholesale-pricings/{id}

> Get wholesale pricing with ID

```json
{"openapi":"3.0.3","info":{"title":"Wholesale pricing API","version":"1.0.0"},"tags":[{"name":"API Test site","description":"Wholesale pricing APIs"}],"servers":[{"url":"https://wholesale.samita.io/api/v1"}],"paths":{"/wholesale-pricings/{id}":{"get":{"tags":["API Test site"],"description":"Get wholesale pricing with ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"A wholesale pricing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WholesalePricing"}}}},"401":{"description":"Unauthorized"},"403":{"description":"This action is unauthorized"},"404":{"description":"Wholesale pricing not found"},"429":{"description":"Too Many Requests"}}}}},"components":{"schemas":{"WholesalePricing":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"status":{"type":"boolean","enum":[true,false]},"apply_customer":{"$ref":"#/components/schemas/ApplyCustomer"},"exclude_customer":{"$ref":"#/components/schemas/ExcludeCustomer"},"apply_product":{"$ref":"#/components/schemas/ApplyProduct"},"exclude_product":{"$ref":"#/components/schemas/ExcludeProduct"},"discount_for_variants":{"type":"array","items":{"$ref":"#/components/schemas/DiscountForVariant"}},"apply_market":{"$ref":"#/components/schemas/ApplyMarket"},"discount_group":{"$ref":"#/components/schemas/DiscountGroup"},"active_date":{"$ref":"#/components/schemas/ActiveDate"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}},"ApplyCustomer":{"type":"object","properties":{"type":{"type":"string","enum":["all","logged","non-logged","customer-tags"]},"tags":{"type":"array","items":{"type":"string"}}}},"ExcludeCustomer":{"type":"object","properties":{"type":{"type":"string","enum":["none","customer-tags"]},"tags":{"type":"array","items":{"type":"string"}}}},"ApplyProduct":{"type":"object","properties":{"type":{"type":"string","enum":["all","products","collections","product-tags"]},"product_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"product_tags":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"apply_for_variants":{"type":"boolean","enum":[true,false]}}},"ExcludeProduct":{"type":"object","properties":{"type":{"type":"string","enum":["none","products","collections"]},"product_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"collection_ids":{"type":"array","items":{"type":"integer","format":"int64"}}}},"DiscountForVariant":{"type":"object","required":["id","variant_pricing","variants"],"properties":{"id":{"type":"integer","format":"int64"},"variant_pricing":{"type":"boolean","enum":[true,false]},"variants":{"type":"array","items":{"$ref":"#/components/schemas/VariantDiscount"}}}},"VariantDiscount":{"type":"object","required":["id","discount_groups"],"properties":{"id":{"type":"integer","format":"int64"},"discount_groups":{"type":"array","items":{"$ref":"#/components/schemas/VariantDiscountGroup"}}}},"VariantDiscountGroup":{"type":"object","required":["name","type","value"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["percent","amount","fixed-amount"]},"value":{"type":"string"}}},"ApplyMarket":{"type":"object","properties":{"type":{"type":"string","enum":["all","specific-market"]},"handle":{"type":"array","items":{"type":"string"}}}},"DiscountGroup":{"type":"object","properties":{"type":{"type":"string","enum":["percent","amount","fixed-amount"]},"value":{"type":"string"}}},"ActiveDate":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"},"enum":["start_date","end_date"]},"start_at":{"type":"string"},"end_at":{"type":"string"}}}}}}
```

## PUT /wholesale-pricings/{id}

> Update wholesale pricing

```json
{"openapi":"3.0.3","info":{"title":"Wholesale pricing API","version":"1.0.0"},"tags":[{"name":"API Test site","description":"Wholesale pricing APIs"}],"servers":[{"url":"https://wholesale.samita.io/api/v1"}],"paths":{"/wholesale-pricings/{id}":{"put":{"tags":["API Test site"],"description":"Update wholesale pricing","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WholesalePricingCreate"}}}},"responses":{"200":{"description":"A wholesale pricing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WholesalePricing"}}}},"401":{"description":"Unauthorized"},"403":{"description":"This action is unauthorized"},"429":{"description":"Too Many Requests"}}}}},"components":{"schemas":{"WholesalePricingCreate":{"type":"object","properties":{"title":{"type":"string"},"status":{"type":"boolean","enum":[true,false]},"apply_customer":{"$ref":"#/components/schemas/ApplyCustomer"},"exclude_customer":{"$ref":"#/components/schemas/ExcludeCustomer"},"apply_product":{"$ref":"#/components/schemas/ApplyProduct"},"exclude_product":{"$ref":"#/components/schemas/ExcludeProduct"},"discount_for_variants":{"type":"array","items":{"$ref":"#/components/schemas/DiscountForVariant"}},"apply_market":{"$ref":"#/components/schemas/ApplyMarket"},"discount_group":{"$ref":"#/components/schemas/DiscountGroup"},"active_date":{"$ref":"#/components/schemas/ActiveDate"}}},"ApplyCustomer":{"type":"object","properties":{"type":{"type":"string","enum":["all","logged","non-logged","customer-tags"]},"tags":{"type":"array","items":{"type":"string"}}}},"ExcludeCustomer":{"type":"object","properties":{"type":{"type":"string","enum":["none","customer-tags"]},"tags":{"type":"array","items":{"type":"string"}}}},"ApplyProduct":{"type":"object","properties":{"type":{"type":"string","enum":["all","products","collections","product-tags"]},"product_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"product_tags":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"apply_for_variants":{"type":"boolean","enum":[true,false]}}},"ExcludeProduct":{"type":"object","properties":{"type":{"type":"string","enum":["none","products","collections"]},"product_ids":{"type":"array","items":{"type":"integer","format":"int64"}},"collection_ids":{"type":"array","items":{"type":"integer","format":"int64"}}}},"DiscountForVariant":{"type":"object","required":["id","variant_pricing","variants"],"properties":{"id":{"type":"integer","format":"int64"},"variant_pricing":{"type":"boolean","enum":[true,false]},"variants":{"type":"array","items":{"$ref":"#/components/schemas/VariantDiscount"}}}},"VariantDiscount":{"type":"object","required":["id","discount_groups"],"properties":{"id":{"type":"integer","format":"int64"},"discount_groups":{"type":"array","items":{"$ref":"#/components/schemas/VariantDiscountGroup"}}}},"VariantDiscountGroup":{"type":"object","required":["name","type","value"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["percent","amount","fixed-amount"]},"value":{"type":"string"}}},"ApplyMarket":{"type":"object","properties":{"type":{"type":"string","enum":["all","specific-market"]},"handle":{"type":"array","items":{"type":"string"}}}},"DiscountGroup":{"type":"object","properties":{"type":{"type":"string","enum":["percent","amount","fixed-amount"]},"value":{"type":"string"}}},"ActiveDate":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string"},"enum":["start_date","end_date"]},"start_at":{"type":"string"},"end_at":{"type":"string"}}},"WholesalePricing":{"type":"object","properties":{"id":{"type":"integer"},"title":{"type":"string"},"status":{"type":"boolean","enum":[true,false]},"apply_customer":{"$ref":"#/components/schemas/ApplyCustomer"},"exclude_customer":{"$ref":"#/components/schemas/ExcludeCustomer"},"apply_product":{"$ref":"#/components/schemas/ApplyProduct"},"exclude_product":{"$ref":"#/components/schemas/ExcludeProduct"},"discount_for_variants":{"type":"array","items":{"$ref":"#/components/schemas/DiscountForVariant"}},"apply_market":{"$ref":"#/components/schemas/ApplyMarket"},"discount_group":{"$ref":"#/components/schemas/DiscountGroup"},"active_date":{"$ref":"#/components/schemas/ActiveDate"},"created_at":{"type":"string"},"updated_at":{"type":"string"}}}}}}
```

## DELETE /wholesale-pricings/{ids}

> Delete wholesale pricing by IDs

```json
{"openapi":"3.0.3","info":{"title":"Wholesale pricing API","version":"1.0.0"},"tags":[{"name":"API Test site","description":"Wholesale pricing APIs"}],"servers":[{"url":"https://wholesale.samita.io/api/v1"}],"paths":{"/wholesale-pricings/{ids}":{"delete":{"tags":["API Test site"],"description":"Delete wholesale pricing by IDs","parameters":[{"name":"ids","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Delete wholesale pricings","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"401":{"description":"Unauthorized"},"403":{"description":"This action is unauthorized"},"404":{"description":"Wholesale pricing not found"},"429":{"description":"Too Many Requests"}}}}}}
```
