Przejdź do głównej zawartości

Get a recipe

POST
/recipes.get
curl --request POST \
--url https://api.sancho-wms.pl/v1/recipes.get \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "integrationId": 1, "id": 1 }'

Returns one production recipe with its components, in the ERP’s order. The components make the recipe’s quantity of the product. Each states its quantity in unit as the recipe holds it, and the same amount in the component card’s base unit as stockQuantity in stockUnit. warehouseId is the warehouse it is issued from, or null when the production receipt’s warehouse applies. Identify the recipe by the integrationId and id the list gives it.

Media typeapplication/json
object
integrationId
required
number
id
required
integer
> 0 <= 9007199254740991

Example generated

{
"integrationId": 1,
"id": 1
}

Successful response

Media typeapplication/json
RecipeDetails
One of: discriminator: integrationType
ComarchOptimaRecipeDetails
object
id
required
number
integrationId
required
number
code
required
string
name
required
string
description
required
string
isDefault
required
boolean
productId
required
number
productCode
required
string
productName
required
string
quantity
required
number
unit
required
string
componentCount
required
number
integrationType
required
string
Allowed value: comarch-optima
components
required
Array<object>
RecipeComponent
object
id
required
number
productId
required
number
productCode
required
string
productName
required
string
quantity
required
number
unit
required
string
stockQuantity
required
number
stockUnit
required
string
warehouseId
required
number | null
warehouseCode
required
string | null

Example

{
"integrationType": "comarch-optima"
}

Bad request

Media typeapplication/json
error.BAD_REQUEST

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "BAD_REQUEST",
"message": "Bad request",
"issues": []
}

Unauthorized

Media typeapplication/json
error.UNAUTHORIZED

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}

Payment required

Media typeapplication/json
error.PAYMENT_REQUIRED

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "PAYMENT_REQUIRED",
"message": "Payment required",
"issues": []
}

Forbidden

Media typeapplication/json
error.FORBIDDEN

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "FORBIDDEN",
"message": "Forbidden",
"issues": []
}

Not found

Media typeapplication/json
error.NOT_FOUND

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}

Unprocessable content

Media typeapplication/json
error.UNPROCESSABLE_CONTENT

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNPROCESSABLE_CONTENT",
"message": "Unprocessable content",
"issues": []
}

Too many requests

Media typeapplication/json
error.TOO_MANY_REQUESTS

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "TOO_MANY_REQUESTS",
"message": "Too many requests",
"issues": []
}

Internal server error

Media typeapplication/json
error.INTERNAL_SERVER_ERROR

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}

Service unavailable

Media typeapplication/json
error.SERVICE_UNAVAILABLE

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "SERVICE_UNAVAILABLE",
"message": "Service unavailable",
"issues": []
}