Costing Management
Update Cost Sheet
Update an existing cost sheet (partial update) with action-based state transitions.
Path Parameters:
- costing_id: The document ID of the cost sheet to update
Request Body (camelCase, all fields optional):
- action: State transition: “draft”, “submit_for_review”, “withdraw”, “approve” (manager), “reject” (manager)
- costSheetName: Updated name
- clientId: Updated client reference
- styleId: Updated style reference
- mainCurrency: Updated currency
- bomItems: Replace all BOM items (see POST for field details)
- processingItems: Replace all processing items
- overheadTier3Items: Replace all overhead items
- profitScenarios: Replace all profit scenarios
Headers:
- X-User-Id: The ID of the user making the update
- X-Org-Id: Organization override if not in user context
Example Request:
{
"action": "draft",
"costSheetName": "Updated Name",
"bomItems": [
{
"materialName": "Silk Fabric",
"materialType": "Fabric",
"consumption": 2.0,
"unit": "meter",
"unitCost": 25.00
}
]
}
PATCH
/
api
/
v1
/
costings
/
{costing_id}
Update Cost Sheet
curl --request PATCH \
--url https://vinmake-erp.onrender.com/api/v1/costings/{costing_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "<string>",
"comments": "<string>",
"versionNumber": 123,
"status": "<string>",
"costSheetName": "<string>",
"clientId": "<string>",
"styleId": "<string>",
"skuId": "<string>",
"mainCurrency": "<string>",
"orderQuantity": 123,
"bomItems": [
{
"materialName": "<string>",
"materialType": "<string>",
"consumption": 123,
"unit": "<string>",
"unitCost": 123,
"id": "<string>",
"materialId": "<string>",
"materialSkuId": "<string>",
"tolerancePercent": 0,
"currency": "USD",
"exchangeRate": 1
}
],
"processingItems": [
{
"processingType": "<string>",
"costAmount": 123,
"id": "<string>",
"vendorName": "<string>",
"supplierId": "<string>",
"description": "<string>",
"quantity": 1,
"unit": "piece",
"unitCost": 123,
"currency": "USD",
"exchangeRate": 1
}
],
"logisticsItems": [
{
"costAmount": 1,
"id": "<string>",
"calculationMode": "estimate",
"transportMode": "air",
"basis": "<string>",
"quantity": 0,
"rate": 0,
"handlingFee": 0,
"baseCost": 0,
"contingencyPercent": 0,
"contingencyAmount": 0,
"shipmentTotal": 123,
"orderQuantity": 123,
"unitCost": 123,
"currency": "USD",
"exchangeRate": 1,
"description": "<string>",
"notes": "<string>"
}
],
"overheadTier3Items": [
{
"overheadType": "<string>",
"costAmount": 123,
"id": "<string>",
"description": "<string>",
"currency": "USD",
"exchangeRate": 1
}
],
"profitScenarios": [
{
"quotedPrice": 123,
"id": "<string>",
"quotedCurrency": "USD",
"expectedGrossMargin": 0,
"expectedGrossProfit": 0,
"expectedNetMargin": 0,
"expectedNetProfit": 0,
"description": "<string>"
}
]
}
'import requests
url = "https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}"
payload = {
"reason": "<string>",
"comments": "<string>",
"versionNumber": 123,
"status": "<string>",
"costSheetName": "<string>",
"clientId": "<string>",
"styleId": "<string>",
"skuId": "<string>",
"mainCurrency": "<string>",
"orderQuantity": 123,
"bomItems": [
{
"materialName": "<string>",
"materialType": "<string>",
"consumption": 123,
"unit": "<string>",
"unitCost": 123,
"id": "<string>",
"materialId": "<string>",
"materialSkuId": "<string>",
"tolerancePercent": 0,
"currency": "USD",
"exchangeRate": 1
}
],
"processingItems": [
{
"processingType": "<string>",
"costAmount": 123,
"id": "<string>",
"vendorName": "<string>",
"supplierId": "<string>",
"description": "<string>",
"quantity": 1,
"unit": "piece",
"unitCost": 123,
"currency": "USD",
"exchangeRate": 1
}
],
"logisticsItems": [
{
"costAmount": 1,
"id": "<string>",
"calculationMode": "estimate",
"transportMode": "air",
"basis": "<string>",
"quantity": 0,
"rate": 0,
"handlingFee": 0,
"baseCost": 0,
"contingencyPercent": 0,
"contingencyAmount": 0,
"shipmentTotal": 123,
"orderQuantity": 123,
"unitCost": 123,
"currency": "USD",
"exchangeRate": 1,
"description": "<string>",
"notes": "<string>"
}
],
"overheadTier3Items": [
{
"overheadType": "<string>",
"costAmount": 123,
"id": "<string>",
"description": "<string>",
"currency": "USD",
"exchangeRate": 1
}
],
"profitScenarios": [
{
"quotedPrice": 123,
"id": "<string>",
"quotedCurrency": "USD",
"expectedGrossMargin": 0,
"expectedGrossProfit": 0,
"expectedNetMargin": 0,
"expectedNetProfit": 0,
"description": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reason: '<string>',
comments: '<string>',
versionNumber: 123,
status: '<string>',
costSheetName: '<string>',
clientId: '<string>',
styleId: '<string>',
skuId: '<string>',
mainCurrency: '<string>',
orderQuantity: 123,
bomItems: [
{
materialName: '<string>',
materialType: '<string>',
consumption: 123,
unit: '<string>',
unitCost: 123,
id: '<string>',
materialId: '<string>',
materialSkuId: '<string>',
tolerancePercent: 0,
currency: 'USD',
exchangeRate: 1
}
],
processingItems: [
{
processingType: '<string>',
costAmount: 123,
id: '<string>',
vendorName: '<string>',
supplierId: '<string>',
description: '<string>',
quantity: 1,
unit: 'piece',
unitCost: 123,
currency: 'USD',
exchangeRate: 1
}
],
logisticsItems: [
{
costAmount: 1,
id: '<string>',
calculationMode: 'estimate',
transportMode: 'air',
basis: '<string>',
quantity: 0,
rate: 0,
handlingFee: 0,
baseCost: 0,
contingencyPercent: 0,
contingencyAmount: 0,
shipmentTotal: 123,
orderQuantity: 123,
unitCost: 123,
currency: 'USD',
exchangeRate: 1,
description: '<string>',
notes: '<string>'
}
],
overheadTier3Items: [
{
overheadType: '<string>',
costAmount: 123,
id: '<string>',
description: '<string>',
currency: 'USD',
exchangeRate: 1
}
],
profitScenarios: [
{
quotedPrice: 123,
id: '<string>',
quotedCurrency: 'USD',
expectedGrossMargin: 0,
expectedGrossProfit: 0,
expectedNetMargin: 0,
expectedNetProfit: 0,
description: '<string>'
}
]
})
};
fetch('https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'reason' => '<string>',
'comments' => '<string>',
'versionNumber' => 123,
'status' => '<string>',
'costSheetName' => '<string>',
'clientId' => '<string>',
'styleId' => '<string>',
'skuId' => '<string>',
'mainCurrency' => '<string>',
'orderQuantity' => 123,
'bomItems' => [
[
'materialName' => '<string>',
'materialType' => '<string>',
'consumption' => 123,
'unit' => '<string>',
'unitCost' => 123,
'id' => '<string>',
'materialId' => '<string>',
'materialSkuId' => '<string>',
'tolerancePercent' => 0,
'currency' => 'USD',
'exchangeRate' => 1
]
],
'processingItems' => [
[
'processingType' => '<string>',
'costAmount' => 123,
'id' => '<string>',
'vendorName' => '<string>',
'supplierId' => '<string>',
'description' => '<string>',
'quantity' => 1,
'unit' => 'piece',
'unitCost' => 123,
'currency' => 'USD',
'exchangeRate' => 1
]
],
'logisticsItems' => [
[
'costAmount' => 1,
'id' => '<string>',
'calculationMode' => 'estimate',
'transportMode' => 'air',
'basis' => '<string>',
'quantity' => 0,
'rate' => 0,
'handlingFee' => 0,
'baseCost' => 0,
'contingencyPercent' => 0,
'contingencyAmount' => 0,
'shipmentTotal' => 123,
'orderQuantity' => 123,
'unitCost' => 123,
'currency' => 'USD',
'exchangeRate' => 1,
'description' => '<string>',
'notes' => '<string>'
]
],
'overheadTier3Items' => [
[
'overheadType' => '<string>',
'costAmount' => 123,
'id' => '<string>',
'description' => '<string>',
'currency' => 'USD',
'exchangeRate' => 1
]
],
'profitScenarios' => [
[
'quotedPrice' => 123,
'id' => '<string>',
'quotedCurrency' => 'USD',
'expectedGrossMargin' => 0,
'expectedGrossProfit' => 0,
'expectedNetMargin' => 0,
'expectedNetProfit' => 0,
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}"
payload := strings.NewReader("{\n \"reason\": \"<string>\",\n \"comments\": \"<string>\",\n \"versionNumber\": 123,\n \"status\": \"<string>\",\n \"costSheetName\": \"<string>\",\n \"clientId\": \"<string>\",\n \"styleId\": \"<string>\",\n \"skuId\": \"<string>\",\n \"mainCurrency\": \"<string>\",\n \"orderQuantity\": 123,\n \"bomItems\": [\n {\n \"materialName\": \"<string>\",\n \"materialType\": \"<string>\",\n \"consumption\": 123,\n \"unit\": \"<string>\",\n \"unitCost\": 123,\n \"id\": \"<string>\",\n \"materialId\": \"<string>\",\n \"materialSkuId\": \"<string>\",\n \"tolerancePercent\": 0,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"processingItems\": [\n {\n \"processingType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"vendorName\": \"<string>\",\n \"supplierId\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit\": \"piece\",\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"logisticsItems\": [\n {\n \"costAmount\": 1,\n \"id\": \"<string>\",\n \"calculationMode\": \"estimate\",\n \"transportMode\": \"air\",\n \"basis\": \"<string>\",\n \"quantity\": 0,\n \"rate\": 0,\n \"handlingFee\": 0,\n \"baseCost\": 0,\n \"contingencyPercent\": 0,\n \"contingencyAmount\": 0,\n \"shipmentTotal\": 123,\n \"orderQuantity\": 123,\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1,\n \"description\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"overheadTier3Items\": [\n {\n \"overheadType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"profitScenarios\": [\n {\n \"quotedPrice\": 123,\n \"id\": \"<string>\",\n \"quotedCurrency\": \"USD\",\n \"expectedGrossMargin\": 0,\n \"expectedGrossProfit\": 0,\n \"expectedNetMargin\": 0,\n \"expectedNetProfit\": 0,\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\",\n \"comments\": \"<string>\",\n \"versionNumber\": 123,\n \"status\": \"<string>\",\n \"costSheetName\": \"<string>\",\n \"clientId\": \"<string>\",\n \"styleId\": \"<string>\",\n \"skuId\": \"<string>\",\n \"mainCurrency\": \"<string>\",\n \"orderQuantity\": 123,\n \"bomItems\": [\n {\n \"materialName\": \"<string>\",\n \"materialType\": \"<string>\",\n \"consumption\": 123,\n \"unit\": \"<string>\",\n \"unitCost\": 123,\n \"id\": \"<string>\",\n \"materialId\": \"<string>\",\n \"materialSkuId\": \"<string>\",\n \"tolerancePercent\": 0,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"processingItems\": [\n {\n \"processingType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"vendorName\": \"<string>\",\n \"supplierId\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit\": \"piece\",\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"logisticsItems\": [\n {\n \"costAmount\": 1,\n \"id\": \"<string>\",\n \"calculationMode\": \"estimate\",\n \"transportMode\": \"air\",\n \"basis\": \"<string>\",\n \"quantity\": 0,\n \"rate\": 0,\n \"handlingFee\": 0,\n \"baseCost\": 0,\n \"contingencyPercent\": 0,\n \"contingencyAmount\": 0,\n \"shipmentTotal\": 123,\n \"orderQuantity\": 123,\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1,\n \"description\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"overheadTier3Items\": [\n {\n \"overheadType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"profitScenarios\": [\n {\n \"quotedPrice\": 123,\n \"id\": \"<string>\",\n \"quotedCurrency\": \"USD\",\n \"expectedGrossMargin\": 0,\n \"expectedGrossProfit\": 0,\n \"expectedNetMargin\": 0,\n \"expectedNetProfit\": 0,\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\",\n \"comments\": \"<string>\",\n \"versionNumber\": 123,\n \"status\": \"<string>\",\n \"costSheetName\": \"<string>\",\n \"clientId\": \"<string>\",\n \"styleId\": \"<string>\",\n \"skuId\": \"<string>\",\n \"mainCurrency\": \"<string>\",\n \"orderQuantity\": 123,\n \"bomItems\": [\n {\n \"materialName\": \"<string>\",\n \"materialType\": \"<string>\",\n \"consumption\": 123,\n \"unit\": \"<string>\",\n \"unitCost\": 123,\n \"id\": \"<string>\",\n \"materialId\": \"<string>\",\n \"materialSkuId\": \"<string>\",\n \"tolerancePercent\": 0,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"processingItems\": [\n {\n \"processingType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"vendorName\": \"<string>\",\n \"supplierId\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit\": \"piece\",\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"logisticsItems\": [\n {\n \"costAmount\": 1,\n \"id\": \"<string>\",\n \"calculationMode\": \"estimate\",\n \"transportMode\": \"air\",\n \"basis\": \"<string>\",\n \"quantity\": 0,\n \"rate\": 0,\n \"handlingFee\": 0,\n \"baseCost\": 0,\n \"contingencyPercent\": 0,\n \"contingencyAmount\": 0,\n \"shipmentTotal\": 123,\n \"orderQuantity\": 123,\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1,\n \"description\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"overheadTier3Items\": [\n {\n \"overheadType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"profitScenarios\": [\n {\n \"quotedPrice\": 123,\n \"id\": \"<string>\",\n \"quotedCurrency\": \"USD\",\n \"expectedGrossMargin\": 0,\n \"expectedGrossProfit\": 0,\n \"expectedNetMargin\": 0,\n \"expectedNetProfit\": 0,\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"cost_sheet_id": "<string>",
"document_id": "<string>",
"version_number": 123,
"status": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
The costing document ID (e.g., CS-2024-001)
Body
application/json
Input schema for updating a cost sheet (PATCH /costings/{id}). All fields are optional - only provided fields will be updated.
Use 'action' to trigger state transitions:
- draft: Save changes without validation
- submit_for_review: Validate and change status to Under Review (from Draft)
- resubmit: Send a rejected cost sheet back Under Review
- withdraw: Revert from Under Review/Approved/Rejected back to Draft
- approve: Manager only - change status to Approved
- reject: Manager only - change status to Rejected
Actions for cost sheet state transitions
Permissions:
- draft, submit_for_review, withdraw: Any authenticated user
- approve, reject: Manager or Admin only
Available options:
draft, submit_for_review, withdraw, approve, reject, resubmit Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I
Update Cost Sheet
curl --request PATCH \
--url https://vinmake-erp.onrender.com/api/v1/costings/{costing_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "<string>",
"comments": "<string>",
"versionNumber": 123,
"status": "<string>",
"costSheetName": "<string>",
"clientId": "<string>",
"styleId": "<string>",
"skuId": "<string>",
"mainCurrency": "<string>",
"orderQuantity": 123,
"bomItems": [
{
"materialName": "<string>",
"materialType": "<string>",
"consumption": 123,
"unit": "<string>",
"unitCost": 123,
"id": "<string>",
"materialId": "<string>",
"materialSkuId": "<string>",
"tolerancePercent": 0,
"currency": "USD",
"exchangeRate": 1
}
],
"processingItems": [
{
"processingType": "<string>",
"costAmount": 123,
"id": "<string>",
"vendorName": "<string>",
"supplierId": "<string>",
"description": "<string>",
"quantity": 1,
"unit": "piece",
"unitCost": 123,
"currency": "USD",
"exchangeRate": 1
}
],
"logisticsItems": [
{
"costAmount": 1,
"id": "<string>",
"calculationMode": "estimate",
"transportMode": "air",
"basis": "<string>",
"quantity": 0,
"rate": 0,
"handlingFee": 0,
"baseCost": 0,
"contingencyPercent": 0,
"contingencyAmount": 0,
"shipmentTotal": 123,
"orderQuantity": 123,
"unitCost": 123,
"currency": "USD",
"exchangeRate": 1,
"description": "<string>",
"notes": "<string>"
}
],
"overheadTier3Items": [
{
"overheadType": "<string>",
"costAmount": 123,
"id": "<string>",
"description": "<string>",
"currency": "USD",
"exchangeRate": 1
}
],
"profitScenarios": [
{
"quotedPrice": 123,
"id": "<string>",
"quotedCurrency": "USD",
"expectedGrossMargin": 0,
"expectedGrossProfit": 0,
"expectedNetMargin": 0,
"expectedNetProfit": 0,
"description": "<string>"
}
]
}
'import requests
url = "https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}"
payload = {
"reason": "<string>",
"comments": "<string>",
"versionNumber": 123,
"status": "<string>",
"costSheetName": "<string>",
"clientId": "<string>",
"styleId": "<string>",
"skuId": "<string>",
"mainCurrency": "<string>",
"orderQuantity": 123,
"bomItems": [
{
"materialName": "<string>",
"materialType": "<string>",
"consumption": 123,
"unit": "<string>",
"unitCost": 123,
"id": "<string>",
"materialId": "<string>",
"materialSkuId": "<string>",
"tolerancePercent": 0,
"currency": "USD",
"exchangeRate": 1
}
],
"processingItems": [
{
"processingType": "<string>",
"costAmount": 123,
"id": "<string>",
"vendorName": "<string>",
"supplierId": "<string>",
"description": "<string>",
"quantity": 1,
"unit": "piece",
"unitCost": 123,
"currency": "USD",
"exchangeRate": 1
}
],
"logisticsItems": [
{
"costAmount": 1,
"id": "<string>",
"calculationMode": "estimate",
"transportMode": "air",
"basis": "<string>",
"quantity": 0,
"rate": 0,
"handlingFee": 0,
"baseCost": 0,
"contingencyPercent": 0,
"contingencyAmount": 0,
"shipmentTotal": 123,
"orderQuantity": 123,
"unitCost": 123,
"currency": "USD",
"exchangeRate": 1,
"description": "<string>",
"notes": "<string>"
}
],
"overheadTier3Items": [
{
"overheadType": "<string>",
"costAmount": 123,
"id": "<string>",
"description": "<string>",
"currency": "USD",
"exchangeRate": 1
}
],
"profitScenarios": [
{
"quotedPrice": 123,
"id": "<string>",
"quotedCurrency": "USD",
"expectedGrossMargin": 0,
"expectedGrossProfit": 0,
"expectedNetMargin": 0,
"expectedNetProfit": 0,
"description": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reason: '<string>',
comments: '<string>',
versionNumber: 123,
status: '<string>',
costSheetName: '<string>',
clientId: '<string>',
styleId: '<string>',
skuId: '<string>',
mainCurrency: '<string>',
orderQuantity: 123,
bomItems: [
{
materialName: '<string>',
materialType: '<string>',
consumption: 123,
unit: '<string>',
unitCost: 123,
id: '<string>',
materialId: '<string>',
materialSkuId: '<string>',
tolerancePercent: 0,
currency: 'USD',
exchangeRate: 1
}
],
processingItems: [
{
processingType: '<string>',
costAmount: 123,
id: '<string>',
vendorName: '<string>',
supplierId: '<string>',
description: '<string>',
quantity: 1,
unit: 'piece',
unitCost: 123,
currency: 'USD',
exchangeRate: 1
}
],
logisticsItems: [
{
costAmount: 1,
id: '<string>',
calculationMode: 'estimate',
transportMode: 'air',
basis: '<string>',
quantity: 0,
rate: 0,
handlingFee: 0,
baseCost: 0,
contingencyPercent: 0,
contingencyAmount: 0,
shipmentTotal: 123,
orderQuantity: 123,
unitCost: 123,
currency: 'USD',
exchangeRate: 1,
description: '<string>',
notes: '<string>'
}
],
overheadTier3Items: [
{
overheadType: '<string>',
costAmount: 123,
id: '<string>',
description: '<string>',
currency: 'USD',
exchangeRate: 1
}
],
profitScenarios: [
{
quotedPrice: 123,
id: '<string>',
quotedCurrency: 'USD',
expectedGrossMargin: 0,
expectedGrossProfit: 0,
expectedNetMargin: 0,
expectedNetProfit: 0,
description: '<string>'
}
]
})
};
fetch('https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'reason' => '<string>',
'comments' => '<string>',
'versionNumber' => 123,
'status' => '<string>',
'costSheetName' => '<string>',
'clientId' => '<string>',
'styleId' => '<string>',
'skuId' => '<string>',
'mainCurrency' => '<string>',
'orderQuantity' => 123,
'bomItems' => [
[
'materialName' => '<string>',
'materialType' => '<string>',
'consumption' => 123,
'unit' => '<string>',
'unitCost' => 123,
'id' => '<string>',
'materialId' => '<string>',
'materialSkuId' => '<string>',
'tolerancePercent' => 0,
'currency' => 'USD',
'exchangeRate' => 1
]
],
'processingItems' => [
[
'processingType' => '<string>',
'costAmount' => 123,
'id' => '<string>',
'vendorName' => '<string>',
'supplierId' => '<string>',
'description' => '<string>',
'quantity' => 1,
'unit' => 'piece',
'unitCost' => 123,
'currency' => 'USD',
'exchangeRate' => 1
]
],
'logisticsItems' => [
[
'costAmount' => 1,
'id' => '<string>',
'calculationMode' => 'estimate',
'transportMode' => 'air',
'basis' => '<string>',
'quantity' => 0,
'rate' => 0,
'handlingFee' => 0,
'baseCost' => 0,
'contingencyPercent' => 0,
'contingencyAmount' => 0,
'shipmentTotal' => 123,
'orderQuantity' => 123,
'unitCost' => 123,
'currency' => 'USD',
'exchangeRate' => 1,
'description' => '<string>',
'notes' => '<string>'
]
],
'overheadTier3Items' => [
[
'overheadType' => '<string>',
'costAmount' => 123,
'id' => '<string>',
'description' => '<string>',
'currency' => 'USD',
'exchangeRate' => 1
]
],
'profitScenarios' => [
[
'quotedPrice' => 123,
'id' => '<string>',
'quotedCurrency' => 'USD',
'expectedGrossMargin' => 0,
'expectedGrossProfit' => 0,
'expectedNetMargin' => 0,
'expectedNetProfit' => 0,
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}"
payload := strings.NewReader("{\n \"reason\": \"<string>\",\n \"comments\": \"<string>\",\n \"versionNumber\": 123,\n \"status\": \"<string>\",\n \"costSheetName\": \"<string>\",\n \"clientId\": \"<string>\",\n \"styleId\": \"<string>\",\n \"skuId\": \"<string>\",\n \"mainCurrency\": \"<string>\",\n \"orderQuantity\": 123,\n \"bomItems\": [\n {\n \"materialName\": \"<string>\",\n \"materialType\": \"<string>\",\n \"consumption\": 123,\n \"unit\": \"<string>\",\n \"unitCost\": 123,\n \"id\": \"<string>\",\n \"materialId\": \"<string>\",\n \"materialSkuId\": \"<string>\",\n \"tolerancePercent\": 0,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"processingItems\": [\n {\n \"processingType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"vendorName\": \"<string>\",\n \"supplierId\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit\": \"piece\",\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"logisticsItems\": [\n {\n \"costAmount\": 1,\n \"id\": \"<string>\",\n \"calculationMode\": \"estimate\",\n \"transportMode\": \"air\",\n \"basis\": \"<string>\",\n \"quantity\": 0,\n \"rate\": 0,\n \"handlingFee\": 0,\n \"baseCost\": 0,\n \"contingencyPercent\": 0,\n \"contingencyAmount\": 0,\n \"shipmentTotal\": 123,\n \"orderQuantity\": 123,\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1,\n \"description\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"overheadTier3Items\": [\n {\n \"overheadType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"profitScenarios\": [\n {\n \"quotedPrice\": 123,\n \"id\": \"<string>\",\n \"quotedCurrency\": \"USD\",\n \"expectedGrossMargin\": 0,\n \"expectedGrossProfit\": 0,\n \"expectedNetMargin\": 0,\n \"expectedNetProfit\": 0,\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\",\n \"comments\": \"<string>\",\n \"versionNumber\": 123,\n \"status\": \"<string>\",\n \"costSheetName\": \"<string>\",\n \"clientId\": \"<string>\",\n \"styleId\": \"<string>\",\n \"skuId\": \"<string>\",\n \"mainCurrency\": \"<string>\",\n \"orderQuantity\": 123,\n \"bomItems\": [\n {\n \"materialName\": \"<string>\",\n \"materialType\": \"<string>\",\n \"consumption\": 123,\n \"unit\": \"<string>\",\n \"unitCost\": 123,\n \"id\": \"<string>\",\n \"materialId\": \"<string>\",\n \"materialSkuId\": \"<string>\",\n \"tolerancePercent\": 0,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"processingItems\": [\n {\n \"processingType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"vendorName\": \"<string>\",\n \"supplierId\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit\": \"piece\",\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"logisticsItems\": [\n {\n \"costAmount\": 1,\n \"id\": \"<string>\",\n \"calculationMode\": \"estimate\",\n \"transportMode\": \"air\",\n \"basis\": \"<string>\",\n \"quantity\": 0,\n \"rate\": 0,\n \"handlingFee\": 0,\n \"baseCost\": 0,\n \"contingencyPercent\": 0,\n \"contingencyAmount\": 0,\n \"shipmentTotal\": 123,\n \"orderQuantity\": 123,\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1,\n \"description\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"overheadTier3Items\": [\n {\n \"overheadType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"profitScenarios\": [\n {\n \"quotedPrice\": 123,\n \"id\": \"<string>\",\n \"quotedCurrency\": \"USD\",\n \"expectedGrossMargin\": 0,\n \"expectedGrossProfit\": 0,\n \"expectedNetMargin\": 0,\n \"expectedNetProfit\": 0,\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vinmake-erp.onrender.com/api/v1/costings/{costing_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\",\n \"comments\": \"<string>\",\n \"versionNumber\": 123,\n \"status\": \"<string>\",\n \"costSheetName\": \"<string>\",\n \"clientId\": \"<string>\",\n \"styleId\": \"<string>\",\n \"skuId\": \"<string>\",\n \"mainCurrency\": \"<string>\",\n \"orderQuantity\": 123,\n \"bomItems\": [\n {\n \"materialName\": \"<string>\",\n \"materialType\": \"<string>\",\n \"consumption\": 123,\n \"unit\": \"<string>\",\n \"unitCost\": 123,\n \"id\": \"<string>\",\n \"materialId\": \"<string>\",\n \"materialSkuId\": \"<string>\",\n \"tolerancePercent\": 0,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"processingItems\": [\n {\n \"processingType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"vendorName\": \"<string>\",\n \"supplierId\": \"<string>\",\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit\": \"piece\",\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"logisticsItems\": [\n {\n \"costAmount\": 1,\n \"id\": \"<string>\",\n \"calculationMode\": \"estimate\",\n \"transportMode\": \"air\",\n \"basis\": \"<string>\",\n \"quantity\": 0,\n \"rate\": 0,\n \"handlingFee\": 0,\n \"baseCost\": 0,\n \"contingencyPercent\": 0,\n \"contingencyAmount\": 0,\n \"shipmentTotal\": 123,\n \"orderQuantity\": 123,\n \"unitCost\": 123,\n \"currency\": \"USD\",\n \"exchangeRate\": 1,\n \"description\": \"<string>\",\n \"notes\": \"<string>\"\n }\n ],\n \"overheadTier3Items\": [\n {\n \"overheadType\": \"<string>\",\n \"costAmount\": 123,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"exchangeRate\": 1\n }\n ],\n \"profitScenarios\": [\n {\n \"quotedPrice\": 123,\n \"id\": \"<string>\",\n \"quotedCurrency\": \"USD\",\n \"expectedGrossMargin\": 0,\n \"expectedGrossProfit\": 0,\n \"expectedNetMargin\": 0,\n \"expectedNetProfit\": 0,\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"cost_sheet_id": "<string>",
"document_id": "<string>",
"version_number": 123,
"status": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}