Skip to main content

Document Webhook

When a document-related event occurs, the webhook will send a POST request with one of the following JSON payloads:

Standard Document Payload

{
"code": "INV-2023-0042",
"document_type_name": "Commercial Invoice",
"issue_date": "2023-07-05",
"due_date": "2023-08-05",
"partner_code": "PRT-0042",
"customer_code": "CUST-ACME-001",
"region": "SP",
"custom_fields": {
"organization_code": "ORG-BR-001",
"negotiation_type": "30 Days"
},
"companies": ["Acme Corporation"]
}

Protocol Document Payload

{
"code": "Contract-2023-0042",
"protocol": {
"code": "PROT-2023-07-001",
"issue_date": "2023-07-15",
"due_date": "2023-12-31"
},
"document_type_name": "Service Agreement",
"issue_date": "2023-07-10",
"due_date": "2023-12-31",
"partner_code": "PRT-0042",
"customer_code": "CUST-ACME-001",
"region": "SP",
"custom_fields": {
"organization_code": "ORG-BR-001",
"negotiation_type": "Annual Contract"
},
"companies": ["Acme Corporation"]
}

Field Descriptions

  • code: The document's description/identifier
  • protocol: Object containing protocol-specific information (only in protocol documents)
    • code: The protocol code
    • issue_date: Date when the protocol was issued
    • due_date: Date when the protocol is due
  • document_type_name: The type/category of the document
  • issue_date: Date when the document was issued
  • due_date: Date when the document is due
  • partner_code: The partner's unique identifier in the ERP system
  • customer_code: The partner's cost center code
  • region: Two-letter state abbreviation from the partner's main address
  • custom_fields: Object containing additional custom fields
  • companies: Array containing related company names