Cost prices
const url = 'https://api.shypr.app/rest/warehousing/products/cost-prices';const options = { method: 'POST', headers: {'X-API-KEY': '<X-API-KEY>', 'Content-Type': 'application/json'}, body: '{"products":[{"productId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","costPrice":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://api.shypr.app/rest/warehousing/products/cost-prices \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: <X-API-KEY>' \ --data '{ "products": [ { "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "costPrice": 1 } ] }'Creates a ProductBulkSetCostPriceInput resource.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The new ProductBulkSetCostPriceInput resource
Sets the cost price of each given product, for example to the price of a purchase order that came in (PurchaseOrder::getLineCostPrices()). The handler answers for each product. Each product gets a ProductSetCostPriceInput, which makes its own audit row, so this input has none.
object
object
Minor units with 3 decimals, in the default currency of the workspace.
Example generated
{ "products": [ { "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "costPrice": 1 } ]}Sets the cost price of each given product, for example to the price of a purchase order that came in (PurchaseOrder::getLineCostPrices()). The handler answers for each product. Each product gets a ProductSetCostPriceInput, which makes its own audit row, so this input has none.
object
object
Minor units with 3 decimals, in the default currency of the workspace.
Responses
Section titled “Responses”ProductBulkSetCostPriceInput resource created
Sets the cost price of each given product, for example to the price of a purchase order that came in (PurchaseOrder::getLineCostPrices()). The handler answers for each product. Each product gets a ProductSetCostPriceInput, which makes its own audit row, so this input has none.
object
object
Minor units with 3 decimals, in the default currency of the workspace.
Example generated
{ "products": [ { "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "costPrice": 1 } ]}Sets the cost price of each given product, for example to the price of a purchase order that came in (PurchaseOrder::getLineCostPrices()). The handler answers for each product. Each product gets a ProductSetCostPriceInput, which makes its own audit row, so this input has none.
object
object
Minor units with 3 decimals, in the default currency of the workspace.
Invalid input
A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}Forbidden
A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}A representation of common errors.
object
A short, human-readable summary of the problem.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
A URI reference that identifies the problem type
Example
{ "status": 400}An error occurred
Unprocessable entity
object
object
The property path of the violation
The message associated with the violation
The code of the violation
An extra hint to understand the violation
The serialized payload of the violation
object
Example
{ "status": 422}Unprocessable entity
object
object
The property path of the violation
The message associated with the violation
The code of the violation
An extra hint to understand the violation
The serialized payload of the violation
object
Example
{ "status": 422}