/sales/buy-orders/{buy-order-id}/lines/{buy-order-line-id}
This endpoint allows you to update a Buy Order Line for a specific Buy Order.
updateBuyOrderLine
| Name | Type | Description |
|---|---|---|
buy-order-id
required
|
string |
The Buy Order ID |
buy-order-line-id
required
|
string |
The Buy Order Line ID |
Content-Type: application/json
description
string | null
Description of the item of Buy Order Line. Only present if buy order type is 'SERVICE'.
material_id
integer | null
ID of the Material item in the Buy Order Line. Only present if the type of Buy Order is 'MATERIAL'.
price
string | null
ID of the Other Cost in the Buy Order Line.
quantity
string
Quantity of the item in the Buy Order Line.
observation
string | null
Observation or notes of the Buy Order Line.
vat
string
VAT applied to the item in the Buy Order Line.
discount
string
Discount percentage applied to the item in the Buy Order Line.
unit
string | null
Unit of the item in the Buy Order Line. Only present if the type of Buy Order is 'MATERIAL'.
cost_center_id
integer | null
ID of the cost center in the Buy Order Line.
data
object
Buy Order Line model structure details
id
string
required
read-only
ID of the Buy Order Line.
type
string
required
read-only
Model type. Model varies with the type of Buy Order.
buy_order_service
buy_order_material
attributes
object
required
order_service_id
integer
read-only
ID of the Buy Order Line. Only present if the type of Buy Order is 'SERVICE'.
order_material_id
integer
read-only
ID of the Buy Order Line. Only present if the type of Buy Order is 'MATERIAL'.
order_id
integer
read-only
ID of the associated Buy Order.
description
string | null
Description of the item of Buy Order Line. Required if buy order type is 'SERVICE'. If the type of buy order is 'MATERIAL', corresponds to the Material name.
material_id
integer | null
ID of the Material item in the Buy Order Line. Only present if the type of Buy Order is 'MATERIAL'.
price
string | null
ID of the Other Cost in the Buy Order Line.
quantity
string
Quantity of the item in the Buy Order Line.
quantity_received
string | null
Received quantity of the item in the Buy Order Line. Only present if the type of Buy Order is 'MATERIAL'.
observation
string | null
Observation or notes of the Buy Order Line.
vat
string
VAT applied to the item in the Buy Order Line.
discount
string
Discount percentage applied to the item in the Buy Order Line.
unit
string | null
Unit of the item in the Buy Order Line. Only present if the type of Buy Order is 'MATERIAL'.
vat_total
number
read-only
Total VAT applied to the Buy Order Line.
discount_total
number
read-only
Total discount the Buy Order Line.
base_total
number
read-only
Total base price the Buy Order Line.
total
number
read-only
Total price the Buy Order Line.
cost_center_id
integer | null
ID of the associated Cost Center.
estimated_at
string | null
Date when material is estimated to arrive. Only present if the type of Buy Order is 'MATERIAL'.
Example: 2021-07-21T18:38:00
status
string
error
error
object
properties
object
Only present when related to property validation error
dev_message
string
Example: Property validation error. Check the "properties" section in the response.
http_code
integer
400
message
string
Example: Property validation error.
more_info
string
status
string
error
error
object
http_code
integer
401
message
string
Example: Authentication token invalid.
more_info
string
status
string
error
error
object
http_code
integer
403
message
string
Example: Action unauthorized
more_info
string
status
string
error
error
object
http_code
integer
404
message
string
Example: Resource not found
more_info
string | null
status
string
error
error
object
http_code
integer
429
message
string
Example: Too Many Requests.
more_info
string
status
string
error
error
object
http_code
integer
500
message
string
Example: An error has occurred during the request.
more_info
string
curl -X PATCH \
'https://api.sandbox.infraspeak.com/v3/sales/buy-orders/{buy-order-id}/lines/{buy-order-line-id}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-d '{
"description": "",
"material_id": 0,
"price": "",
"quantity": "",
"observation": "",
"vat": "",
"discount": "",
"unit": "",
"cost_center_id": 0
}'
const response = await fetch('https://api.sandbox.infraspeak.com/v3/sales/buy-orders/{buy-order-id}/lines/{buy-order-line-id}', {
method: 'PATCH',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
body: JSON.stringify({
"description": "",
"material_id": 0,
"price": "",
"quantity": "",
"observation": "",
"vat": "",
"discount": "",
"unit": "",
"cost_center_id": 0
}),
});
const data = await response.json();
$response = Http::withHeaders([
'Accept' => 'application/json',
'Content-Type' => 'application/json',
])->withToken('YOUR_API_TOKEN')
->patch('https://api.sandbox.infraspeak.com/v3/sales/buy-orders/{buy-order-id}/lines/{buy-order-line-id}',
array (
'description' => '',
'material_id' => 0,
'price' => '',
'quantity' => '',
'observation' => '',
'vat' => '',
'discount' => '',
'unit' => '',
'cost_center_id' => 0,
)
);
import requests
response = requests.patch(
'https://api.sandbox.infraspeak.com/v3/sales/buy-orders/{buy-order-id}/lines/{buy-order-line-id}',
headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
json={
{
"description": "",
"material_id": 0,
"price": "",
"quantity": "",
"observation": "",
"vat": "",
"discount": "",
"unit": "",
"cost_center_id": 0
}
},
)
data = response.json()