curl --request POST \
--url https://api.komerza.com/stores/{storeId}/products/{productId}/variants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"cost": 50000,
"minimumQuantity": 1073741824,
"maximumQuantity": 1073741823,
"order": 1073741824,
"type": 0,
"stock": 1073741823,
"deliveryTypes": [
"<string>"
],
"stockMode": 0,
"dynamicUrl": "<string>",
"deliveryMessage": "<string>",
"subscriptionPeriod": "<string>"
}
'{
"success": true,
"message": "<string>",
"code": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"name": "<string>",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost": 50000,
"deliveryTypes": [
"<string>"
],
"files": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"friendlyName": "<string>",
"ipAddress": "<string>",
"userId": "<string>"
}
],
"minimumQuantity": 123,
"maximumQuantity": 123,
"order": 123,
"imageNames": [
"<string>"
],
"stock": 123,
"stockMode": 0,
"customFields": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"identifier": "<string>",
"type": "<string>",
"isRequired": true,
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"customFieldId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"value": "<string>",
"order": 1073741823
}
],
"placeholder": "<string>",
"hint": "<string>"
}
],
"dynamicUrl": "<string>",
"deliveryMessage": "<string>",
"metadata": "<string>"
}
}Adds a new variant to the specified product.
Requires the stores.products.update permission.
curl --request POST \
--url https://api.komerza.com/stores/{storeId}/products/{productId}/variants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"cost": 50000,
"minimumQuantity": 1073741824,
"maximumQuantity": 1073741823,
"order": 1073741824,
"type": 0,
"stock": 1073741823,
"deliveryTypes": [
"<string>"
],
"stockMode": 0,
"dynamicUrl": "<string>",
"deliveryMessage": "<string>",
"subscriptionPeriod": "<string>"
}
'{
"success": true,
"message": "<string>",
"code": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"name": "<string>",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"storeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost": 50000,
"deliveryTypes": [
"<string>"
],
"files": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"friendlyName": "<string>",
"ipAddress": "<string>",
"userId": "<string>"
}
],
"minimumQuantity": 123,
"maximumQuantity": 123,
"order": 123,
"imageNames": [
"<string>"
],
"stock": 123,
"stockMode": 0,
"customFields": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"identifier": "<string>",
"type": "<string>",
"isRequired": true,
"options": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dateCreated": "2023-11-07T05:31:56Z",
"customFieldId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"value": "<string>",
"order": 1073741823
}
],
"placeholder": "<string>",
"hint": "<string>"
}
],
"dynamicUrl": "<string>",
"deliveryMessage": "<string>",
"metadata": "<string>"
}
}Your API key goes here
The store’s unique identifier.
The product’s unique identifier.
The form containing the variant’s initial data.
The form used to create a product variant.
The display name of the variant.
3 - 128The cost of the variant (non-negative).
0 <= x <= 100000Minimum quantity allowed per order (at least 1).
1 <= x <= 2147483647Maximum quantity allowed per order. Set to -1 for unlimited.
-1 <= x <= 2147483647Sort order for display (at least 1).
1 <= x <= 2147483647The type of product that is being sold
0, 1 Stock quantity available (non-negative).
0 <= x <= 2147483647Enabled delivery types. Valid values: license_keys, dynamic, keyauth, instructions, files.
The stock calculation modes that are used
0, 1, 2 URL for dynamic fulfillment (when using the "dynamic" delivery type).
2048Optional message shown on delivery.
4096Subscription billing period. Null for one-time products.
The object was successfully created.
Represents a default generic response for API endpoints.
Indicates whether the operation or response was successful.
A descriptive message providing additional context or information about the response.
The error code (if there was an error) to use when referencing the error
Represents a configurable variant associated with a product, containing various properties such as pricing, stock, delivery options, and custom fields.
Show child attributes
Was this page helpful?