POST

Documents.Get

קריאת הזמנה, הזמנה מפורטת או הצעת מחיר קיימת, ובדיקת אפשרויות עדכון, מחיקה וביטול. Returns data (including items, order_all_fields, updated_date and PDF URL) plus can_update/can_delete/can_cancel and the reason for each blocked action.

Permissions

  • On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
  • A valid staff bearer token from this account is required. Customer portal tokens are rejected.
  • The document must belong to the account and its customer must be accessible to the current user. Proposal visibility restrictions also apply.

Action

  • Reads one business document without changing it. Returns editable fields, full items, saved custom fields and the current updated_date version.
  • Returns actions.can_update, actions.can_delete, actions.can_cancel and their blocking reasons. Capability checks are repeated before a write.

Push Service

  • These routes do not promise a dedicated realtime event. Refresh the document through Documents.Get after changes.

Automation

  • This route emits no new dedicated automation event. Get is read-only.

Special Instructions

  • On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
  • Supported types: purchase_orders (הזמנה), detail_orders (הזמנה מפורטת), order_proposals (הצעת מחיר). Issued invoices, receipts and other accounting document types are rejected.
  • Use a staff bearer token. Customer portal tokens cannot call these routes. Account ownership, customer assignment/sharing and proposal visibility are checked on the server.
  • Documents.Edit and Documents.Delete remain uploaded-file operations. Use Documents.Update, Documents.Remove and Documents.Cancel for BUSINESS documents; the numeric id alone never switches resource type.
  • Call Documents.Get first to inspect data and actions. Capabilities are advisory; the server checks them again when writing. Blocked actions return HTTP 409 document_action_blocked with a reason.
  • Approved, paid or closed documents are blocked. Canceled documents cannot be updated or canceled again. Closed, paid or linked line items block update and cancel.
  • Update and cancel require the permission to create/edit that document type. Remove requires Delete Order permission. Financial edits by team members also require discount-edit permissions and must respect the order price lock.
  • No implicit cancellation cascade is exposed: any related document blocks cancellation. Handle relations through the dashboard before retrying. Removal also checks reverse links and children.
  • Errors: 400 invalid id/unsupported parameter/empty update; 401 missing or invalid bearer token; 403 access/field permission denied; 404 document not found; 409 changed/busy/blocked; 422 unsupported type or invalid values. Do not blindly retry a mutation after a network timeout; inspect Documents.Get first.

Required Parameters

NameTypeSampleExplanation
document_id
post
int123Existing BUSINESS document id from Documents.List or Documents.Get (not an uploaded file id). The server checks account and customer access.

Optional Parameters

No optional body parameters are defined for this function.

Authentication

Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Documents.Get",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "document_id": "123"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Documents.Get",
    "url_domain": "https:\/\/{domain}\/app\/Documents.Get"
}

Endpoint

POST /app/Documents.Get
POST https://{user}.bull36.com/app/Documents.Get
POST https://{domain}/app/Documents.Get

Sample Output

{
    "success": 1,
    "document_id": 123,
    "message": "OK",
    "data": {
        "id": 123,
        "type": "order_proposals",
        "updated_date": "2026-11-16 08:00:00",
        "items": [],
        "order_all_fields": []
    },
    "actions": {
        "can_update": true,
        "update_reason": "",
        "can_delete": true,
        "delete_reason": "",
        "can_cancel": true,
        "cancel_reason": ""
    }
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams({
  "document_id": "123"
});
const response = await fetch('/app/Documents.Get', {
  method: 'POST',
  headers: { Authorization: 'Bearer ' + token },
  body
});
const result = await response.json();
if (!response.ok || !result.success) throw new Error(result.message || 'Request failed');
console.log(result);

Error Example

{
    "success": 0,
    "error": "document_action_blocked",
    "message": "Document is approved"
}