Webhook
You need to implement an endpoint on your side where we can deliver the structured data. Usually, you would use a Bearer token so you can authenticate if it is really us who are dropping a message. Please share your URL with us.
Structure
Webhook response.
Attributes:
Name | Type | Description |
---|---|---|
template |
str
|
The template which was used to extract data. |
message_id |
str
|
The message_id which was passed by you, uploading your PDF document. |
log_id |
str
|
The log id returned by us at the upload. |
result |
bytes | None
|
If successful then the opentrans xml. |
status |
ProcessorResultStatus
|
one of the statuses. |
status_reason |
ProcessorResultStatusReason | None
|
a deeper explanation of the status. |
Status of a processed document.
Attributes:
Name | Type | Description |
---|---|---|
IGNORED |
ignored
|
The document was ignored and there might be no feedback to you(the customer). |
REJECTED |
rejected
|
The document was rejected because of an applied rule. |
FAILED |
failed
|
Processing of the document failed. |
DEFERRED_FOR_RETRY |
deferred_for_retry
|
Processing of the document was deferred for retry later, because of a mapping lookup errors. |
SUCCESS |
success
|
Processed successfully. |
Define list of possible reasons for a result status.
The reason is rendered in the rejection email template.
Attributes:
Name | Type | Description |
---|---|---|
CANNOT_PARSE_DELIVERY_ADDRESS |
cannot_parse_delivery_address
|
The delivery address cannot be parsed. |
CANNOT_PARSE_ITEMS |
cannot_parse_items
|
The items of the documents cannot be parsed. |
DOCUMENT_ID_MISSING |
document_id_missing
|
One of the required document ids is missing or incorrect. |
MAPPING_NOT_RESOLVED |
The mapping cannot be resolved. |
|
NOT_AN_INVOICE |
not_an_order
|
The document is not an order. |
NOT_AN_ORDER |
not_an_order
|
The document is not an order. |
NOT_AN_ORDER_RESPONSE |
not_an_order_response
|
The document is not an orderresponse. |
VAT_ID_MISSING |
vat_id_missing
|
There is no VAT-ID in the document. |
UNKNOWN_FORMAT |
unknown_format
|
The format is not known to the template. |
Example
POST /your-incoming-endpoint HTTP/1.1
Authentication: Bearer Your-token.
{
"template": "processed_template",
"message_id": "<unique id by you>",
"log_id": "<from POST response before>",
"result": "<xml...",
"status": "rejected|success|ignored",
"status_reason": "..."
}