Create Gifts
Function
To create new gift with Open API
透過Open API 建立新贈品
URL
POST <<api_domain>>/v1/gifts
Request Parameters
Field | Type | Description | Example |
|---|---|---|---|
title_translations |
| Gift Title |
|
media_ids |
| Array of Media ID |
|
unlimited_quantity |
| Gift unlimited quantity or not |
|
sku |
| 贈品SKU |
|
cost |
| Gift Cost |
|
weight |
| Gift Weight |
|
quantity |
| Gift Quantity |
|
product_id |
| Shared Product ID
|
|
JSON Response Sample
{
"_id": "60d5b2b0ca4c5b00176ba405",
"cost": {
"cents": 12,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "NT$12",
"dollars": 12.0
},
"title_translations": {
"en": "create by open api"
},
"description_translations": {},
"media_ids": [
"603f06f7f6ba0c00451d0f12"
],
"owner_id": "5d8aecb7f21e4e00014d5ae7",
"sku": "GIFT-SKU-0001",
"status": "active",
"unlimited_quantity": true,
"weight": 12.1,
"created_at": "2021-06-25T10:40:48.970Z",
"updated_at": "2021-06-25T10:40:48.970Z",
"stock_ids": null,
"root_product_id": null,
"media": [],
"quantity": 0
}Sample CURL Example
curl --location --request POST '<<api_domain>>/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
}'Updated 13 days ago