cURL
curl -sS -X PUT 'https://apipub.firstbasehq.com/api/v1/bundles/{productGroupId}' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Laptop Bundle",
"regionId": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"primaryCategoryCode": "COMPUTER",
"components": [
{
"skuId": "7b21c8e0-1a2b-4c3d-9e5f-0123456789ab",
"quantity": 1,
"required": true,
"fulfillmentMode": "WAREHOUSE_FIRST_THEN_PROCURE",
"warehouseCondition": "NEW_FIRST",
"sortOrder": 0
}
]
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/bundles/{productGroupId}"
payload = {
"name": "Laptop Bundle",
"regionId": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"components": [
{
"skuId": "7b21c8e0-1a2b-4c3d-9e5f-0123456789ab",
"quantity": 1,
"required": True,
"fulfillmentMode": "WAREHOUSE_FIRST_THEN_PROCURE",
"warehouseCondition": "NEW_FIRST",
"sortOrder": 0
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Laptop Bundle',
regionId: '3a68a467-8733-4c8d-a942-16ed7ec33018',
components: [
{
skuId: '7b21c8e0-1a2b-4c3d-9e5f-0123456789ab',
quantity: 1,
required: true,
fulfillmentMode: 'WAREHOUSE_FIRST_THEN_PROCURE',
warehouseCondition: 'NEW_FIRST',
sortOrder: 0
}
]
})
};
fetch('https://apipub.firstbasehq.com/api/v1/bundles/{productGroupId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "BUNDLE",
"friendlyId": "GRP-260914-TEST0001",
"name": "Laptop Bundle",
"region": {
"id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"name": "United States",
"code": "US"
},
"status": "ACTIVE",
"components": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sku": {
"id": "7b21c8e0-1a2b-4c3d-9e5f-0123456789ab",
"vendorSku": "MK183LL/A",
"productTitle": "MacBook Pro 14",
"categoryCode": "COMPUTER"
},
"quantity": 1,
"required": true,
"fulfillmentMode": "WAREHOUSE_ONLY",
"warehouseCondition": "NEW_ONLY",
"sortOrder": 0
}
],
"referencedPackageCount": 0,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"coverSkuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primaryCategoryCode": "<string>",
"createdBy": {
"id": "d7d0d906-425f-402f-bde1-39031c67c40b",
"forename": "Ada",
"surname": "Lovelace"
},
"updatedBy": {
"id": "d7d0d906-425f-402f-bde1-39031c67c40b",
"forename": "Ada",
"surname": "Lovelace"
}
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Bundles
Update bundle
Fully replaces bundle fields and members. Same validation rules as the admin UI. Returns 403 when bundles are not enabled for your organization.
PUT
https://apipub.firstbasehq.com
/
api
/
v1
/
bundles
/
{productGroupId}
cURL
curl -sS -X PUT 'https://apipub.firstbasehq.com/api/v1/bundles/{productGroupId}' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Laptop Bundle",
"regionId": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"primaryCategoryCode": "COMPUTER",
"components": [
{
"skuId": "7b21c8e0-1a2b-4c3d-9e5f-0123456789ab",
"quantity": 1,
"required": true,
"fulfillmentMode": "WAREHOUSE_FIRST_THEN_PROCURE",
"warehouseCondition": "NEW_FIRST",
"sortOrder": 0
}
]
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/bundles/{productGroupId}"
payload = {
"name": "Laptop Bundle",
"regionId": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"components": [
{
"skuId": "7b21c8e0-1a2b-4c3d-9e5f-0123456789ab",
"quantity": 1,
"required": True,
"fulfillmentMode": "WAREHOUSE_FIRST_THEN_PROCURE",
"warehouseCondition": "NEW_FIRST",
"sortOrder": 0
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Laptop Bundle',
regionId: '3a68a467-8733-4c8d-a942-16ed7ec33018',
components: [
{
skuId: '7b21c8e0-1a2b-4c3d-9e5f-0123456789ab',
quantity: 1,
required: true,
fulfillmentMode: 'WAREHOUSE_FIRST_THEN_PROCURE',
warehouseCondition: 'NEW_FIRST',
sortOrder: 0
}
]
})
};
fetch('https://apipub.firstbasehq.com/api/v1/bundles/{productGroupId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "BUNDLE",
"friendlyId": "GRP-260914-TEST0001",
"name": "Laptop Bundle",
"region": {
"id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"name": "United States",
"code": "US"
},
"status": "ACTIVE",
"components": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sku": {
"id": "7b21c8e0-1a2b-4c3d-9e5f-0123456789ab",
"vendorSku": "MK183LL/A",
"productTitle": "MacBook Pro 14",
"categoryCode": "COMPUTER"
},
"quantity": 1,
"required": true,
"fulfillmentMode": "WAREHOUSE_ONLY",
"warehouseCondition": "NEW_ONLY",
"sortOrder": 0
}
],
"referencedPackageCount": 0,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"coverSkuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"primaryCategoryCode": "<string>",
"createdBy": {
"id": "d7d0d906-425f-402f-bde1-39031c67c40b",
"forename": "Ada",
"surname": "Lovelace"
},
"updatedBy": {
"id": "d7d0d906-425f-402f-bde1-39031c67c40b",
"forename": "Ada",
"surname": "Lovelace"
}
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Authorizations
Body
application/json
Create or fully replace a bundle and its members
Response
Bundle updated
Product group bundle and its members