### Example Price
Source: https://open-api.docs.shoplineapp.com/docs/update-a-variation-product
This is an example of the product price for a variation.
```string
"price":460
```
--------------------------------
### Full Token Info Response Example
Source: https://open-api.docs.shoplineapp.com/docs/get-token-info
Complete response example for the Get Token Info API, encompassing staff, merchant, and user details.
```json
{
"staff": {
"_id": "5ec5e201d8aedd002d744537",
"email": "archer@gmail.com",
"locale_code": "en",
"merchant_ids": [
"58e4736a9a76f0174c000278",
"5e840cae77cb07003243f7c7"
],
"name": "archer1"
},
"merchant": {
"_id": "5e840cae77cb07003243f7c7",
"email": "archer@shoplineapp.com",
"handle": "archertesttest",
"name": "Archer Tester"
},
"user": {
"_id": "5e840cae77cb07003243f7c7",
"email": "archer@shoplineapp.com",
"name": "Archer Tester"
}
}
```
--------------------------------
### Example Weight
Source: https://open-api.docs.shoplineapp.com/docs/update-a-variation-product
This is an example of the weight (in kg) for a product variation.
```string
`"weight": 1.2`
```
--------------------------------
### Get Webhooks Example
Source: https://open-api.docs.shoplineapp.com/docs/get-webhooks
This is an example of the JSON response when retrieving subscribed webhooks. It includes webhook details and pagination information.
```json
{
"items": [
{
"id": "5f8e5dc08a8bb70a5c9cd93c",
"format": "json",
"address": "http://simulator.shoplinestg.com/webhooks",
"status": "active",
"merchant_id": "5e840cae77cb07003243f7c7",
"created_at": "2020-10-20T03:50:00.323+00:00",
"updated_at": "2020-10-23T08:43:00.369+00:00",
"topics": [
"order/create"
]
}
],
"pagination": {
"current_page": 1,
"per_page": 24,
"total_count": 1,
"total_pages": 1
}
}
```
--------------------------------
### Example Product ID
Source: https://open-api.docs.shoplineapp.com/docs/update-a-variation-product
This is an example of a Product ID used in the API request.
```string
5df2fd9dc7ccf70012c2111b
```
--------------------------------
### Example Sale Price
Source: https://open-api.docs.shoplineapp.com/docs/update-a-variation-product
This is an example of the sale price for a product variation.
```string
"price_sale": 300
```
--------------------------------
### Product ID Example
Source: https://open-api.docs.shoplineapp.com/docs/delete-product-images
Example of a Product ID used in the API request.
```ruby
5d355b2ce3880911bca30959
```
--------------------------------
### Example Image URL
Source: https://open-api.docs.shoplineapp.com/docs/update-a-variation-product
This is an example of an image URL for a product variation. Only HTTPS links are allowed.
```ruby
ruby
"image": "https://the-allstars.com/blog/images/articl/articl7.jpg"
```
--------------------------------
### Example Cost Price
Source: https://open-api.docs.shoplineapp.com/docs/update-a-variation-product
This is an example of the cost price for a product variation.
```string
"cost": 50
```
--------------------------------
### Quantity Parameter Example
Source: https://open-api.docs.shoplineapp.com/docs/update-addonproduct-quantity
Example of how to specify the quantity for updating an add-on product. This value represents the desired quantity.
```ruby
"quantity"=12
```
--------------------------------
### Example Customer ID
Source: https://open-api.docs.shoplineapp.com/docs/update-customer-store-credits
This is an example of a customer ID string.
```ruby
id=58d3440869702d39b7060000
```
--------------------------------
### Example Member Price
Source: https://open-api.docs.shoplineapp.com/docs/update-a-variation-product
This is an example of the member price for a product variation.
```string
"member_price": 420
```
--------------------------------
### Example SKU
Source: https://open-api.docs.shoplineapp.com/docs/update-a-variation-product
This is an example of an SKU (Stock Keeping Unit) for a product variation.
```string
"sku": "24235"
```
--------------------------------
### Media IDs Example
Source: https://open-api.docs.shoplineapp.com/docs/delete-product-images
Example of an array of Image IDs for product images to be deleted.
```ruby
"media_ids": ["5d318cc2e388097897d07be4",
"5d318cc5e388097897d07be8",
"5d31921ce3880966a80ed0f2",
"5d31921fe3880966a80ed0f5"]
```
--------------------------------
### Promotion ID Example
Source: https://open-api.docs.shoplineapp.com/docs/send-coupon
Example of a promotion ID format required for the user_coupon.promotion_id parameter.
```ruby
"promotion_id":"58d3379401cda31bfb000000"
```
--------------------------------
### Example Preorder Limit
Source: https://open-api.docs.shoplineapp.com/docs/update-a-variation-product
This is an example of the preorder limit for a product variation. Set to -1 for unlimited.
```string
"preorder_limit": 50
```
--------------------------------
### Product Creation with Advanced Details
Source: https://open-api.docs.shoplineapp.com/docs/create-product
This example demonstrates creating a product with more comprehensive details, including cost, sale price, SEO information, and variant options. It's suitable for products with multiple attributes or specific marketing requirements.
```json
{
"product": {
"category_ids": [],
"cost": 609,
"description_translations": {
"en": "No transaction fees. No design or technical skills required. Integrated with multiple payment and logistic options. With over 120,000 merchants online. Everything you need for your e-commerce store.",
"zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。 公司聚集了一批來自哈佛大學設計學院 以及麻省理工商學院的優秀設計團隊。 我們致力於設計獨特新穎的創新產品, 適合不同年齡,性別人士使用。 在執著追求產品優化同時,注重履行企業社會責任。"
},
"detail_images": [
"https://shopline.tw/blog/wp-content/uploads/2015/11/logo-shopline-white.png"
],
"hide_price": false,
"images": [
"https://shopline.tw/blog/wp-content/uploads/2015/11/logo-shopline-white.png"
],
"link": "shopline",
"price": 1000,
"price_sale": 689,
"same_price": true,
"seo_description_translations": {
"en": "No transaction fees. No design or technical skills required. Integrated with multiple payment and logistic options. With over 120,000 merchants online. Everything you need for your e-commerce store.",
"zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。 公司聚集了一批來自哈佛大學設計學院 以及麻省理工商學院的優秀設計團隊。 我們致力於設計獨特新穎的創新產品, 適合不同年齡,性別人士使用。 在執著追求產品優化同時,注重履行企業社會責任。"
},
"seo_keywords": "電商, 開店, 創業",
"seo_title_translations": {
"en": "SHOPLINE",
"zh-hant": "商線科技"
},
"status": true,
"title_translations": {
"en": "Shopline.co",
"zh-hant": "商線科技"
},
"unlimited_quantity": true,
"variant_custom_type_translations": [
{
"name_translations": {
"en": "Custom1",
"zh-hant": "自訂1"
},
"type": "custom_1"
}
],
"variant_options": [
{
"name_translations": {
"en": "green",
"zh-hant": "綠"
},
"type": "color"
},
{
"name_translations": {
"en": "Red",
"zh-hant": "紅"
},
"type": "color"
},
{
"name_translations": {
"en": "L1",
"zh-hant": "大1"
},
"type": "custom_1"
},
{
"name_translations": {
"en": "S1",
"zh-hant": "小1"
},
"type": "custom_1"
}
]
}
}
```
--------------------------------
### SHOPLINE Open API
Source: https://open-api.docs.shoplineapp.com/reference/put_products-id-stocks-1
Welcome to the shopline open-api developer hub. You'll find comprehensive guides and documentation to help you start working with shopline open-api as quickly as possible, as well as support if you get stuck. Let's jump right in!
```APIDOC
## SHOPLINE Open API
### Description
Welcome to the shopline open-api developer hub. You'll find comprehensive guides and documentation to help you start working with shopline open-api as quickly as possible, as well as support if you get stuck. Let's jump right in!
### Base URL
`https://open.shopline.io/v1`
### Authentication
This API uses Bearer Token authentication (JWT).
### Components
#### Schemas
##### Translatable
An object representing translatable text fields for various languages.
- **en** (string) - Merchant defined English name
- **zh-hant** (string) - Merchant defined Traditional Chinese name
- **zh-cn** (string) - Merchant defined Simplified Chinese name
- **vi** (string) - Merchant defined Vietnamese name
- **ms** (string) - Merchant defined Malaysian name
- **ja** (string) - Merchant defined Japanese name
- **th** (string) - Merchant defined Thai name
- **id** (string) - Merchant defined Indian name
- **de** (string) - Merchant defined Deutsch name
- **fr** (string) - Merchant defined France name
##### TranslatableArray
An object representing translatable array fields for various languages.
- **en** (array of strings) - Merchant defined English name
- **zh-hant** (array of strings) - Merchant defined Traditional Chinese name
- **zh-cn** (array of strings) - Merchant defined Simplified Chinese name
- **vi** (array of strings) - Merchant defined Vietnamese name
- **ms** (array of strings) - Merchant defined Malaysian name
- **ja** (array of strings) - Merchant defined Japanese name
- **th** (array of strings) - Merchant defined Thai name
- **id** (array of strings) - Merchant defined Indian name
- **de** (array of strings) - Merchant defined Deutsch name
- **fr** (array of strings) - Merchant defined France name
Example:
```json
{
"en": ["green", "L1"],
"zh-hant": ["綠", "大1"]
}
```
##### ProductStock
Represents the stock information for a product.
- **id** (string) - Product's ID
- **title_translations** (object) - Title translations (uses Translatable schema)
- **en** (string) - Merchant defined English name
- **zh-hant** (string) - Merchant defined Traditional Chinese name
Example:
```json
{
"id": "5d3594c276e7ec003b7021c0",
"title_translations": {
"en": "testing SL-8049",
"zh-hant": "測試 SL-8049 round 2"
}
}
```
```
--------------------------------
### List Products with Query Parameters
Source: https://open-api.docs.shoplineapp.com/docs/get-products
Use this example to list products, specifying sorting order, items per page, and the desired page number. Ensure to check for breaking changes announced for July 30, 2025.
```curl
curl --request GET \
--url 'https://open.shopline.io/v1/products?sort_by=desc&per_page=24&page=1' \
--header 'Accept: application/json'
```
--------------------------------
### Product Request with Variations and Variants
Source: https://open-api.docs.shoplineapp.com/docs/create-product
This example shows how to define product variations and options, such as colors and custom types, for a product. This is useful for products that come in different styles or configurations.
```json
{
"product": {
"category_ids": [],
"cost": 609,
"description_translations": {
"en": "No transaction fees. No design or technical skills required. Integrated with multiple payment and logistic options. With over 120,000 merchants online. Everything you need for your e-commerce store.",
"zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。 公司聚集了一批來自哈佛大學設計學院 以及麻省理工商學院的優秀設計團隊。 我們致力於設計獨特新穎的創新產品, 適合不同年齡,性別人士使用。 在執著追求產品優化同時,注重履行企業社會責任。"
},
"detail_images": [
"https://shopline.tw/blog/wp-content/uploads/2015/11/logo-shopline-white.png"
],
"hide_price": false,
"images": [
"https://shopline.tw/blog/wp-content/uploads/2015/11/logo-shopline-white.png"
],
"link": "shopline",
"price": 1000,
"price_sale": 689,
"same_price": true,
"seo_description_translations": {
"en": "No transaction fees. No design or technical skills required. Integrated with multiple payment and logistic options. With over 120,000 merchants online. Everything you need for your e-commerce store.",
"zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。 公司聚集了一批來自哈佛大學設計學院 以及麻省理工商學院的優秀設計團隊。 我們致力於設計獨特新穎的創新產品, 適合不同年齡,性別人士使用。 在執著追求產品優化同時,注重履行企業社會責任。"
},
"seo_keywords": "電商, 開店, 創業",
"seo_title_translations": {
"en": "SHOPLINE",
"zh-hant": "商線科技"
},
"status": true,
"title_translations": {
"en": "Shopline.co",
"zh-hant": "商線科技"
},
"unlimited_quantity": true,
"variant_custom_type_translations": [
{
"name_translations": {
"en": "Custom1",
"zh-hant": "自訂1"
},
"type": "custom_1"
}
],
"variant_options": [
{
"name_translations": {
"en": "green",
"zh-hant": "綠"
},
"type": "color",
"key": "green"
},
{
"name_translations": {
"en": "Red",
"zh-hant": "紅"
},
"type": "color",
"key": "red"
},
{
"name_translations": {
"en": "L1",
"zh-hant": "大1"
},
"type": "custom_1",
"key": "l1"
}
]
}
}
```
--------------------------------
### GET /websites/open-api_shoplineapp/flash_price_campaigns
Source: https://open-api.docs.shoplineapp.com/reference/get_flash-price-campaigns-1
Retrieves a list of flash price campaigns with optional filtering by start and end times, as well as pagination.
```APIDOC
## GET /websites/open-api_shoplineapp/flash_price_campaigns
### Description
Retrieves a list of flash price campaigns. Supports filtering by start and end times, and pagination.
### Method
GET
### Endpoint
/websites/open-api_shoplineapp/flash_price_campaigns
### Query Parameters
- **start_at** (string) - Optional - Filter those flash price campaigns after specified start_at time. Should use UTC time.
- **end_at** (string) - Optional - Filter those flash price campaigns before specified end_at time. Should use UTC time.
- **page** (integer) - Optional - Page Number.
- **per_page** (integer) - Optional - Numbers of Orders per Page.
### Response
#### Success Response (200)
- **FlashPriceCampaigns** (object) - Schema defining the structure of flash price campaign data.
#### Response Example
{
"example": "{\"campaigns\": [{\"id\": 1, \"name\": \"Summer Sale\", \"start_time\": \"2022-01-01T00:00:00Z\", \"end_time\": \"2022-01-31T23:59:59Z\"}], \"total\": 10, \"page\": 1, \"per_page\": 20}"
}
```
--------------------------------
### GET /conversations/{conversationId}/messages
Source: https://open-api.docs.shoplineapp.com/reference/get_conversations-conversationid-messages-1
Retrieves a list of messages for a specific conversation. Supports filtering by platform, limit, start, and end times.
```APIDOC
## GET /conversations/{conversationId}/messages
### Description
Get Conversations
獲取對話訊息列表
### Method
GET
### Endpoint
/conversations/{conversationId}/messages
### Parameters
#### Path Parameters
- **conversationId** (string) - Required - Conversation's ID
對話ID
Can only input 1 id at once
一次只能輸入一筆
#### Query Parameters
- **platform** (string) - Required - Conversation from shop or order
網店訊息或是訂單訊息
return_order_messages 尚未開放
- Allowed values: `shop_messages`, `order_messages`, `return_order_messages`
- **limit** (integer) - Optional - Numbers of Messages of Conversations
顯示 n 筆資料
- **start** (string) - Optional - Messages Start From
訊息開始時間
- **end** (string) - Optional - Messages End Before
訊息結束時間
### Response
#### Success Response (200)
- **items** (array) - List of conversation messages.
- **total** (integer) - Total number of messages.
- **limit** (integer) - Number of messages displayed.
#### Response Example
```json
{
"total": 24,
"limit": 24,
"items": [
{
"message_id": "622090c66775a37b9fa60799",
"conversation_id": "622090c66775a37b9fa60799",
"content": "Hello!",
"sender": {
"type": "customer",
"id": "622090c66775a37b9fa60799"
},
"created_at": "2023-01-01T10:00:00Z"
}
]
}
```
#### Error Response (500)
- **message** (string) - A detailed message of the reason of failure
- **code** (string) - An error code
#### Error Response Example
```json
{
"message": "Unable to get messages",
"code": "UNKNOWN"
}
```
```
--------------------------------
### Create a product with variant options
Source: https://open-api.docs.shoplineapp.com/reference/post_products-1
This example demonstrates creating a product that includes variations. Fields like `cost`, `price_sale`, and `variant_options` are used to define product variants. Ensure `variant_options` are correctly structured if the product has specifications like color or size.
```json
{
"product": {
"category_ids": [],
"cost": 609,
"description_translations": {
"en": "No transaction fees. No design or technical skills required.",
"zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。"
},
"detail_images": [
"https://shopline.tw/blog/wp-content/uploads/2015/11/logo-shopline-white.png"
],
"hide_price": false,
"images": [
"https://shopline.tw/blog/wp-content/uploads/2015/11/logo-shopline-white.png"
],
"link": "shopline",
"price": 1000,
"price_sale": 689,
"same_price": true,
"seo_description_translations": {
"en": "No transaction fees. No design or technical skills required.",
"zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。"
},
"seo_keywords": "電商, 開店, 創業",
"seo_title_translations": {
"en": "SHOPLINE",
"zh-hant": "商線科技"
},
"status": true,
"title_translations": {
"en": "Shopline.co"
}
}
}
```
--------------------------------
### Get Apps Setting Response Example
Source: https://open-api.docs.shoplineapp.com/docs/get-setting
This JSON structure represents the response when retrieving app settings. It includes nested objects for app configurations.
```json
{
"appName": {
"test": "testtest",
"code": "123123123"
}
}
```
--------------------------------
### JSON Sample for Amount Discount Promotion
Source: https://open-api.docs.shoplineapp.com/docs/create-promotions
Use this sample to create a promotion that offers a fixed amount discount on an order. Specify conditions like minimum price and applicable payment/delivery methods.
```json
{
"promotion": {
"title_translations": {
"en": "Promotions & Campaigns",
"zh-hant": "優惠活動1"
},
"conditions": [
{
"min_price": 100,
"min_item_count": null,
"blacklisted_product_ids": []
}
],
"start_at": "2021/09/06 06:00 PM",
"end_at": "2021/09/07 12:00 AM",
"max_use_count": null,
"requires_membership": false,
"user_max_use_count": 0,
"first_purchase_only": false,
"discountable_quantity": null,
"discount_type": "amount",
"discount_on": "order",
"whitelisted_payment_ids": [
"60c1e434a47d91004377f169"
],
"whitelisted_delivery_option_ids": [
"60d0033f6691e1004483c083"
],
"whitelisted_membership_tier_ids": [],
"codes": [],
"discount_amount": 100
}
}
```
--------------------------------
### Create a new product without variation
Source: https://open-api.docs.shoplineapp.com/reference/post_products-1
Use this example to create a new product without any variations. Ensure all required fields like price, title, and images are provided.
```json
{
"product": {
"category_ids": [],
"description_translations": {
"en": "We are a product design-led company that aims to create products",
"zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。 "
},
"images": [
"https://shopline.tw/blog/wp-content/uploads/2015/11/logo-shopline-white.png"
],
"price": 9999,
"status": false,
"title_translations": {
"en": "Shopline",
"zh-hant": "商線科技"
},
"allow_gift": true
}
}
```
--------------------------------
### Customer Custom Fields Example
Source: https://open-api.docs.shoplineapp.com/docs/update-customer
A hash object containing custom fields for the customer. Custom field IDs can be retrieved using the Get CustomFields API.
```json
"custom_fields":
{"5a72fdb0e388097fac000008": "test_value" }
```
--------------------------------
### GET /v1/promotions/
Source: https://open-api.docs.shoplineapp.com/docs/get-promotions
Retrieves a list of promotions, sortable by time. Supports filtering by update, creation, start, and end dates, as well as specific promotion IDs. Pagination controls are also available.
```APIDOC
## GET /v1/promotions/
### Description
To get detailed information of couple promotions sorted by time. Utilizes a time range selection and sorting to retrieve multiple promotion activities.
### Method
GET
### Endpoint
`https://open.shopline.io/v1/promotions/`
### Parameters
#### Query Parameters
- **updated_after** (DateTime) - Optional - Filter data by updated_at after. Should use UTC time.
- **updated_before** (DateTime) - Optional - Filter data by updated_at before. Should use UTC time.
- **created_after** (DateTime) - Optional - Filter data by created_at after. Should use UTC time.
- **created_before** (DateTime) - Optional - Filter data by created_at before. Should use UTC time.
- **start_after** (DateTime) - Optional - Filter data by start_at after. Should use UTC time.
- **start_before** (DateTime) - Optional - Filter data by start_at before. Should use UTC time.
- **end_after** (DateTime) - Optional - Filter data by end_at after. Should use UTC time.
- **end_before** (DateTime) - Optional - Filter data by end_at before. Should use UTC time.
- **promotion_ids** (Array) - Optional - Filter data by IDs. The promotion_ids parameter must be used standalone.
- **per_page** (Integer) - Optional - Numbers of Customers per Page. Default: 24, max = 100.
- **page** (Integer) - Optional - Page Number. Default: 1.
### Response
#### Success Response (200)
- **items** (Array) - Promotion Data.
- **pagination** (Object) - Pagination Data.
#### Response Example
```json
{
"items": [
{
"id": "60b8d295f1d2a10019e3b0e1",
"name": "Summer Sale",
"description": "Get 20% off on all summer items.",
"start_at": "2023-06-01T00:00:00Z",
"end_at": "2023-08-31T23:59:59Z",
"created_at": "2023-05-15T10:00:00Z",
"updated_at": "2023-05-15T10:00:00Z"
}
],
"pagination": {
"total": 10,
"per_page": 24,
"current_page": 1,
"total_pages": 1
}
}
```
```
--------------------------------
### CURL Example for Creating a Gift
Source: https://open-api.docs.shoplineapp.com/docs/create-gifts
Provides a practical example using CURL to send a POST request to create a gift. Ensure to replace `${token}` with your actual authorization token.
```bash
curl --location --request POST 'https://open.shopline.io/v1/gifts' \
--header 'Authorization: Bearer ${token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"title_translations": { "en": "Sample Gift 0001"},
"media_ids": ["603f06f7f6ba0c00451d0f12"],
"unlimited_quantity": true,
"sku": "GIFT-SKU-0001",
"cost": { "dollars": 12},
"weight": 12.1
}'
```
--------------------------------
### Get Order Transactions Request Example
Source: https://open-api.docs.shoplineapp.com/docs/get-order-transactions
Use this cURL command to retrieve order transactions. Ensure to replace 'access_token' with your actual token and provide valid order IDs. A maximum of 100 unique order IDs can be requested per call.
```curl
curl --request GET \
--url https://open.shopline.io/v1/orders/transactions?orderIds[]=6214b5979fdc3f483815c361&orderIds[]=6214b5979fdc3f483815c362 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer access_token' \
```
--------------------------------
### Get Delivery Time Slots Example
Source: https://open-api.docs.shoplineapp.com/docs/get-delivery-time-slots
This JSON response shows the structure of delivery time slots. It includes details like ID, group key, limit, translations, weekday, status, and timestamps. Use this endpoint to retrieve available delivery slots for a specific delivery option.
```json
{
"items": [
{
"id": "62fb881a61f2d7003564cdc8",
"group_key": "572126",
"limit": 10,
"translations": {
"zh-hant": "AM9:00-AM10:00"
},
"weekday": 1,
"status": "active",
"created_at": "2022-08-16T12:05:46.216+00:00",
"updated_at": "2022-08-16T12:05:46.216+00:00",
"is_available": true
},
{
"id": "62fb881a61f2d7003564cdc9",
"group_key": "572126",
"limit": 10,
"translations": {
"zh-hant": "AM9:00-AM10:00"
},
"weekday": 2,
"status": "active",
"created_at": "2022-08-16T12:05:46.216+00:00",
"updated_at": "2022-08-16T12:05:46.216+00:00",
"is_available": true
}
]
}
```
--------------------------------
### Order ID Example
Source: https://open-api.docs.shoplineapp.com/docs/update-order-payment-status
Example of an Order ID.
```ruby
59e97965e388095314000010
```
--------------------------------
### Product With Variations Example
Source: https://open-api.docs.shoplineapp.com/reference/get_products-id-stocks-1
This example illustrates the JSON structure for a product that has multiple variations. Each variation can have its own stock levels across different warehouses.
```json
{
"id": "5ef1e5cbf1159c004ed9e789",
"title_translations": {
"zh-hant": "測試商品*"
},
"variations": [
{
"id": "5ef1e5cb214bbc0013813cfd",
"fields_translations": {
"en": [
"s"
],
"zh-hant": [
"s"
]
},
"stocks": [
{
"warehouse_id": "5e83216e2e4f81001e756014",
"quantity": 0
},
{
"warehouse_id": "5e831cb68fa5fc000f9925ab",
"quantity": 0
}
]
},
{
"id": "5ef1e5cb214bbc0013813cfe",
"fields_translations": {
"en": [
"m"
],
"zh-hant": [
"m"
]
},
"stocks": [
{
"warehouse_id": "5e83216e2e4f81001e756014",
"quantity": 0
},
{
"warehouse_id": "5e831cb68fa5fc000f9925ab",
"quantity": 0
}
]
}
]
}
```
--------------------------------
### Customer ID Example
Source: https://open-api.docs.shoplineapp.com/docs/get-customer
Example of a customer unique ID.
```ruby
5a55b3c973746f507e120000
```
--------------------------------
### POST /v1/addon_products
Source: https://open-api.docs.shoplineapp.com/docs/create-addonproducts
Creates a new addon product. You can define its properties, pricing, and link it to main products.
```APIDOC
## POST /v1/addon_products
### Description
Creates a new addon product with specified details.
### Method
POST
### Endpoint
https://open.shopline.io/v1/addon_products
### Parameters
#### Request Body
- **title_translations** (Hash) - Required - Addon Product Title
- **media_ids** (Array) - Optional - Array of Media ID
- **unlimited_quantity** (Boolean) - Optional - Addon Product unlimited quantity or not
- **start_at** (String) - Optional - Addon Product start at (ISO 8601 format)
- **end_at** (String) - Optional - Addon Product end at (ISO 8601 format)
- **main_products** (Array) - Required - Main Products Information. Example: `[{ "addon_price": {"dollars": 12}, "_id": "5fa61682e388093728f76a6c" }]`
- **location_id** (String) - Optional - Custom location ID
- **sku** (String) - Optional - Addon product SKU
- **cost** (Hash) - Optional - Cost. Example: `{ "dollars": 12}`
- **weight** (Float) - Optional - Weight
- **product_id** (String) - Optional - Shared Product ID. Use this to assign an existing product as an addon item (inventory will be shared).
- **tax_type** (String) - Optional - Tax type. "1": Taxable, "3": Tax-exempt. Default: null
- **oversea_tax_type** (String) - Optional - Oversea tax type. "1": Taxable, "2": Zero-rated (not via customs), "5": Zero-rated (via customs). Default: null
### Request Example
```json
{
"title_translations": { "en": "create by open api"},
"media_ids": ["603f06f7f6ba0c00451d0f12"],
"unlimited_quantity": true,
"start_at": "2021-03-03T09:57:09.193Z",
"end_at": "2022-03-03T09:57:09.193Z",
"main_products": [
{
"addon_price": {"dollars": 12},
"_id": "5fa61682e388093728f76a6c"
}
],
"location_id": "AB-001",
"sku": "SKU-456344881",
"cost": { "dollars": 12},
"weight": 12.1,
"product_id": "603f06f7f6ba0c00451d0f12",
"tax_type": "1",
"oversea_tax_type": "5"
}
```
### Response
#### Success Response (200)
- **id** (String) - The unique identifier for the created addon product.
- **title** (String) - The title of the addon product.
- **created_at** (String) - Timestamp of creation.
- **updated_at** (String) - Timestamp of last update.
#### Response Example
```json
{
"id": "603f06f7f6ba0c00451d0f12",
"title": "create by open api",
"created_at": "2023-10-27T10:00:00.000Z",
"updated_at": "2023-10-27T10:00:00.000Z"
}
```
```
--------------------------------
### Example Update Order Status
Source: https://open-api.docs.shoplineapp.com/docs/update-order-status
This example shows how to set the order status to 'completed'. Refer to the documentation for allowed status values and restrictions.
```ruby
"status": "completed"
```
--------------------------------
### Example Location ID
Source: https://open-api.docs.shoplineapp.com/docs/update-a-variation-product
This is an example of a Location ID for a product variation.
```string
"location_id": "87722"
```
--------------------------------
### Addon Product SKU Parameter Example
Source: https://open-api.docs.shoplineapp.com/docs/update-addonproduct-quantity-by-sku
Example of the 'sku' parameter required for updating an Addon Product's quantity. This uniquely identifies the Addon Product.
```ruby
"sku": "sku-123"
```