Перейти до вмісту

Create a goods received note from a purchase invoice

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

The ERP converts a committed purchase invoice that has no goods received note yet into a committed note with the invoice’s lines, received in the invoice’s warehouse, and answers result, the new note’s integrationId, kind and id for /goodsReceivedNotes.get, with warnings. Stock changes at once and the note cannot be edited afterwards. Only comarch-optima integrations convert an invoice; any other answers 409, as do a draft, cancelled or already converted invoice and an invoice without a warehouse. The ERP’s own refusal answers 422 with the ERP’s message.

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

Example generated

{
"integrationId": 1,
"invoiceId": 1
}

Successful response

Media typeapplication/json
GoodsReceivedNoteRefWriteResult
object
result
required
GoodsReceivedNoteRef
object
integrationId
required
number
kind
required
string
Allowed values: external internal
id
required
number | string
warnings
required
Array<object>
WriteWarning
object
stage
required
string
Allowed values: placements documents tags participants images assetExtras
detail
required
string

Example

{
"result": {
"kind": "external"
},
"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": []
}