Skip to content

Create a product

POST
/products.create
curl --request POST \
--url https://api.sancho-wms.pl/v1/products.create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "integrationId": 1, "values": { "name": "example", "code": "example", "producerCode": "example", "unit": "example", "group": { "id": 1, "code": "example", "name": "example" }, "weight": 1, "description": "example", "url": "example", "type": "product", "composition": "simple", "active": true, "vat": "example", "purchaseVat": "example", "purchasePriceGross": 1, "vatReduced": true, "vatReducedPurchase": true, "prices": [ { "listNumber": 1, "margin": 1, "price": 1, "priceType": "net", "currency": "example" } ], "defaultPriceListNumber": 1, "pricePrecision": 1, "supplier": { "id": 1, "code": "example", "name": "example" }, "supplierCode": "example", "images": [ "example" ], "barcodes": [ { "ean": "example", "type": "ean", "unit": "example", "description": "example", "isDefault": true } ], "relatedDocuments": [ { "label": "example", "linkId": null, "integrationType": "comarch-optima", "integrationId": 1, "id": 1, "type": "goodsReceivedNote", "kind": "external" } ] } }'
Media typeapplication/json
object
integrationId
required
number
values
required
ProductValues
object
name
required
string
code
required
string
producerCode
required
string | null
unit
required
string | null
group
required
Any of:
object
id
required
number | string
code
required
string | null
name
required
string | null
weight
required
Any of:
number
description
required
string
url
required
string
type
required
string
Allowed values: product service
composition
required
string
Allowed values: simple composite
active
required
boolean
vat
required
string | null
purchaseVat
required
string | null
purchasePriceGross
required
Any of:
number
vatReduced
required
boolean
vatReducedPurchase
required
boolean
prices
required
Array<object>
object
listNumber
required
number
margin
required
number | null
price
required
Any of:
number
priceType
required
string
Allowed values: net gross
currency
required
string
defaultPriceListNumber
required
number | null
pricePrecision
required
number
supplier
required
Any of:
object
id
required
number | string
code
required
string | null
name
required
string | null
supplierCode
required
string
images
required
Array<string>
barcodes
required
Array<object>
object
ean
required
string
>= 1 characters <= 40 characters
type
string
default: ean
Allowed values: ean
unit
required
string | null
description
required
string
<= 100 characters
isDefault
required
boolean
relatedDocuments
required
Array<object>
RelatedDocument
One of: discriminator: integrationType
IntegrationRelatedDocument
One of: discriminator: integrationType
object
label
required
string | null
linkId
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

Successful response

Media typeapplication/json
ProductWriteResult
object
result
required
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
warnings
required
Array<object>
WriteWarning
object
stage
required
string
Allowed values: placements documents tags participants images assetExtras
detail
required
string

Example

{
"result": {
"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"
},
"warnings": [
{
"stage": "placements"
}
]
}

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": []
}

Conflict

Media typeapplication/json
error.CONFLICT

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": "CONFLICT",
"message": "Conflict",
"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": []
}