cURL
curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/packages/{slug}/duplicate' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json'import requests
url = "https://apipub.firstbasehq.com/api/v1/packages/{slug}/duplicate"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://apipub.firstbasehq.com/api/v1/packages/{slug}/duplicate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"automaticOrder": true,
"approvalRequired": true,
"requireJustification": true,
"slug": "<string>",
"active": true,
"notes": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"note": "Remember to include the welcome letter",
"active": true
}
],
"regions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>"
}
],
"skuLines": [
{
"skuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendorSku": "<string>",
"regions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>"
}
],
"vendorCode": "<string>"
}
],
"rules": [
{
"id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"category_code": "LAPTOP",
"quantity": 1,
"optional": false,
"allowed_product_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"bundleLines": [
{
"productGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"friendlyId": "<string>",
"name": "<string>",
"sortOrder": 123
}
],
"usedEquipmentPreferences": [
{
"categoryCode": "<string>",
"preference": "NEW_FIRST",
"inStockOnly": true
}
],
"skuIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"assignedTo": {
"people": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"deliverySetting": "PERSON",
"defaultOfficeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}{
"errors": [
{
"detail": "Invalid request",
"source": "request"
}
]
}Packages
Duplicate an existing package
Creates a full copy of the package identified by its slug. Every configurable element is copied — SKU lines with their per-SKU regions, category rules, bundle references, used-equipment preferences, instructions and delivery settings. The copy starts active with no one assigned, gets a new slug and friendly id, and its name is suffixed with ” (Copy)”. PATCH the result to rename or adjust it. This mirrors the admin UI’s Duplicate action, which pre-populates a new-package editor so integrators do not have to re-pick products.
POST
https://apipub.firstbasehq.com
/
api
/
v1
/
packages
/
{slug}
/
duplicate
cURL
curl -sS -X POST 'https://apipub.firstbasehq.com/api/v1/packages/{slug}/duplicate' \
-H 'Authorization: ApiKey YOUR_API_KEY' \
-H 'Accept: application/json'import requests
url = "https://apipub.firstbasehq.com/api/v1/packages/{slug}/duplicate"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://apipub.firstbasehq.com/api/v1/packages/{slug}/duplicate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"automaticOrder": true,
"approvalRequired": true,
"requireJustification": true,
"slug": "<string>",
"active": true,
"notes": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"note": "Remember to include the welcome letter",
"active": true
}
],
"regions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>"
}
],
"skuLines": [
{
"skuId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vendorSku": "<string>",
"regions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"code": "<string>"
}
],
"vendorCode": "<string>"
}
],
"rules": [
{
"id": "3a68a467-8733-4c8d-a942-16ed7ec33018",
"category_code": "LAPTOP",
"quantity": 1,
"optional": false,
"allowed_product_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"bundleLines": [
{
"productGroupId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"friendlyId": "<string>",
"name": "<string>",
"sortOrder": 123
}
],
"usedEquipmentPreferences": [
{
"categoryCode": "<string>",
"preference": "NEW_FIRST",
"inStockOnly": true
}
],
"skuIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"assignedTo": {
"people": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"deliverySetting": "PERSON",
"defaultOfficeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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
Response
Package duplicated
Package details returned by get/list package endpoints