Create a service
const url = 'https://apisandbox.puurk.com/services';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":"example","oid":"example","name":"example","cogs":1,"unit_price":1,"active":true,"adjustable_price":true,"commission_fixed":1,"commission_rate":1,"commission_basis":"profit","commission_total":1,"down_payment":1,"description":"example","notes":"example","photo_path":"example","providers":["example"],"savings":1,"service_ids":["example"],"services":[{"service_id":"example","service_name":"example","original_quantity":1,"quantity":1,"remaining_quantity":1,"amount":1,"merge_contract_id":"example"}],"is_package":true,"type":"service","brand":"example","category":"example","supplier":"example","charge_tax":true,"sku":"example","barcode":"example","min_qty":1,"stock":1,"term_cap":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://apisandbox.puurk.com/services \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": "example", "oid": "example", "name": "example", "cogs": 1, "unit_price": 1, "active": true, "adjustable_price": true, "commission_fixed": 1, "commission_rate": 1, "commission_basis": "profit", "commission_total": 1, "down_payment": 1, "description": "example", "notes": "example", "photo_path": "example", "providers": [ "example" ], "savings": 1, "service_ids": [ "example" ], "services": [ { "service_id": "example", "service_name": "example", "original_quantity": 1, "quantity": 1, "remaining_quantity": 1, "amount": 1, "merge_contract_id": "example" } ], "is_package": true, "type": "service", "brand": "example", "category": "example", "supplier": "example", "charge_tax": true, "sku": "example", "barcode": "example", "min_qty": 1, "stock": 1, "term_cap": 1 }'Create a new service
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Request body
object
Unique identifier for the service
Organization ID
Service name
Cost of goods sold
Unit price
Whether the service is active
Whether the price is adjustable
Fixed commission amount
Commission rate
Basis for commission calculation
Total commission
Down payment amount
Service description
Additional notes
Path to service photo
List of provider IDs
Savings amount
List of service IDs
List of package services
object
Service ID
Service name
Original quantity
Current quantity
Remaining quantity
Amount
Merge contract ID
Whether this is a package service
Type of service
Service brand
Service category
Service supplier
Whether to charge tax
Stock keeping unit
Barcode
Minimum quantity
Stock quantity
Term cap
Responses
Section titled “Responses”Service created
object
Unique identifier for the service
Organization ID
Service name
Cost of goods sold
Unit price
Whether the service is active
Whether the price is adjustable
Fixed commission amount
Commission rate
Basis for commission calculation
Total commission
Down payment amount
Service description
Additional notes
Path to service photo
List of provider IDs
Savings amount
List of service IDs
List of package services
object
Service ID
Service name
Original quantity
Current quantity
Remaining quantity
Amount
Merge contract ID
Whether this is a package service
Type of service
Service brand
Service category
Service supplier
Whether to charge tax
Stock keeping unit
Barcode
Minimum quantity
Stock quantity
Term cap
Example
{ "commission_basis": "profit", "type": "service"}Invalid input
Unauthorized