Zum Inhalt springen

Get a product

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

Returns one product with its stock per warehouse, its delivery batches (empty where the ERP keeps stock only per warehouse), prices, barcodes, units and suppliers. Identify it by integrationId and productId, which is product.id from the product list.

Media typeapplication/json
object
integrationId
required
number
productId
required
string | number

Example generated

{
"integrationId": 1,
"productId": "example"
}

Successful response

Media typeapplication/json
ProductDetails
One of: discriminator: integrationType
ComarchOptimaProductDetails
object
product
required
object
id
required
number
code
required
string
producerCode
required
string | null
name
required
string
description
required
string | null
unit
required
string | null
ean
required
string | null
active
required
boolean
weight
required
number | null
vatRate
required
string | null
defaultSupplierId
required
number | null
vatRatePurchase
required
string | null
vatReduced
required
boolean
vatReducedPurchase
required
boolean
defaultPriceListNumber
required
number | null
category
required
string | number | null
categoryCode
required
string | null
categoryName
required
string | null
salesCategory
required
string | null
purchaseCategory
required
string | null
supplierCode
required
string | null
url
required
string | null
type
required
Any of:
string
Allowed values: product service
composition
required
Any of:
string
Allowed values: simple composite
pricePrecision
required
integer
default: 2 >= 2 <= 4
quantityPrecision
required
integer
default: 4 <= 4
stock
required
Array<object>
ProductStock
object
warehouseId
required
number | string
warehouseCode
required
string | null
warehouseName
required
string | null
quantity
required
number
> 0
reserved
required
number
ordered
required
number
totalValue
required
number
batches
required
Array<object>
object
id
required
number
warehouseId
required
number | null
warehouseCode
required
string | null
warehouseName
required
string | null
deliveryDate
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
quantity
required
number
unitPrice
required
number
totalValue
required
number
sourceDocument
required
Any of:
IntegrationRelatedDocumentOutput
One of:
object
label
required
string | null
linkId
required
number | null
integrationType
required
string
Allowed values: comarch-optima erp-next fakturownia comarch-bmp custom
integrationId
required
number
id
required
number | string
type
required
string
Allowed value: goodsReceivedNote
kind
required
string
Allowed values: external internal
prices
required
Array<object>
object
id
required
number
listNumber
required
number
unitPrice
required
number
currency
required
string
margin
required
number
priceType
required
string
Allowed values: net gross
barcodes
required
Array<object>
object
id
required
number
ean
required
string
description
required
string | null
unit
required
string | null
isDefault
required
boolean
units
required
Array<object>
object
id
required
number
unit
required
string
numerator
required
string
denominator
required
string
suppliers
required
Array<object>
ProductSupplier
object
counterPartyId
required
number | string | null
code
required
string | null
name
required
string | null
taxId
required
string | null
supplierProductCode
required
string | null
currency
required
string | null
lastDeliveryDate
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
totalUnits
required
number | null
customFields
required
CustomFields
object
key
additional properties
CustomFieldValue
One of:
object
type
required
string
Allowed value: text
value
required
string
customFieldsMeta
required
CustomFieldsMeta
object
key
additional properties
object
savedAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
user
required
object
id
required
number
name
required
string
avatar
required
string | null
relatedDocuments
required
Array<object>
default:
RelatedDocumentOutput
One of: discriminator: integrationType
IntegrationRelatedDocumentOutput
One of: discriminator: integrationType
object
label
required
string | null
linkId
required
number | null
integrationType
required
string
Allowed values: comarch-optima erp-next fakturownia comarch-bmp custom
integrationId
required
number
id
required
number | string
type
required
string
Allowed value: goodsReceivedNote
kind
required
string
Allowed values: external internal
snapshotSavedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
integrationId
required
number
integrationType
required
string
Allowed value: comarch-optima

Example

{
"product": {
"vatReduced": false,
"vatReducedPurchase": false,
"type": "product",
"composition": "simple",
"pricePrecision": 2,
"quantityPrecision": 4
},
"batches": [
{
"sourceDocument": {
"linkId": null,
"integrationType": "comarch-optima",
"type": "goodsReceivedNote",
"kind": "external"
}
}
],
"prices": [
{
"priceType": "net"
}
],
"customFields": {},
"customFieldsMeta": {},
"relatedDocuments": [],
"snapshotSavedAt": null,
"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": []
}