cURL
curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/packages' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Engineering Starter Kit",
"approval_required": false,
"require_justification": false,
"automatic_order": false,
"default_office_id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"delivery_setting": "PERSON",
"note": "Standard package for new engineering hires",
"sku_ids": [],
"sku_lines": [
{
"vendor_code": "DELL",
"vendor_sku": "LAT-7420",
"region_ids": []
}
],
"rules": [
{
"category_code": "LAPTOP",
"quantity": 1,
"optional": false
}
],
"used_equipment_preferences": [
{
"in_stock_only": false
}
],
"bundle_refs": []
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/packages"
payload = {
"name": "Engineering Starter Kit",
"approval_required": False,
"require_justification": False,
"automatic_order": False,
"delivery_setting": "PERSON"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Engineering Starter Kit',
approval_required: false,
require_justification: false,
automatic_order: false,
delivery_setting: 'PERSON'
})
};
fetch('https://apipub.firstbasehq.com/api/v1/packages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"name": "Engineering Starter Kit",
"slug": "engineering-starter-kit",
"active": true,
"approval_required": false,
"require_justification": false,
"automatic_order": false,
"it_closet": false,
"number_ordered": 0,
"number_deployed": 0,
"delivery_setting": "PERSON",
"note": "Standard package for new engineering hires",
"default_office_id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"sku_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"rules": [
{
"id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"category_code": "LAPTOP",
"quantity": 1,
"optional": false,
"allowed_product_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Packages
Create package
Creates a new equipment package (onboarding bundle) for the caller’s organization. The package defines which SKUs are automatically ordered when a new joiner is onboarded. Gated by a feature flag; returns 403 when the flag is disabled.
POST
https://apipub.firstbasehq.com
/
api
/
v1
/
packages
cURL
curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/packages' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Engineering Starter Kit",
"approval_required": false,
"require_justification": false,
"automatic_order": false,
"default_office_id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"delivery_setting": "PERSON",
"note": "Standard package for new engineering hires",
"sku_ids": [],
"sku_lines": [
{
"vendor_code": "DELL",
"vendor_sku": "LAT-7420",
"region_ids": []
}
],
"rules": [
{
"category_code": "LAPTOP",
"quantity": 1,
"optional": false
}
],
"used_equipment_preferences": [
{
"in_stock_only": false
}
],
"bundle_refs": []
}'import requests
url = "https://apipub.firstbasehq.com/api/v1/packages"
payload = {
"name": "Engineering Starter Kit",
"approval_required": False,
"require_justification": False,
"automatic_order": False,
"delivery_setting": "PERSON"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Engineering Starter Kit',
approval_required: false,
require_justification: false,
automatic_order: false,
delivery_setting: 'PERSON'
})
};
fetch('https://apipub.firstbasehq.com/api/v1/packages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"name": "Engineering Starter Kit",
"slug": "engineering-starter-kit",
"active": true,
"approval_required": false,
"require_justification": false,
"automatic_order": false,
"it_closet": false,
"number_ordered": 0,
"number_deployed": 0,
"delivery_setting": "PERSON",
"note": "Standard package for new engineering hires",
"default_office_id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"sku_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"rules": [
{
"id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"category_code": "LAPTOP",
"quantity": 1,
"optional": false,
"allowed_product_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Authorizations
Body
application/json
Request body for creating a package
Response
Package created successfully
Response body after creating a package