POST

Documents.ApproveSign

Submit a customer signature for an order_proposals, purchase_orders, or detail_orders document. Same as the public Approve Order Proposal page (signature pad + Name + Corporation / ח.פ או ת.ז → Send). Uploads the signature, sets documents.approve=1, regenerates the PDF, and runs the same email / auto-create / automation rules as the dashboard.

Permissions

  • User must be logged in with a valid bearer token.
  • The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
  • Returned or changed records are limited by the user permissions, team access, folder access, and account settings.

Action

  • Runs the Documents.ApproveSign function and returns JSON.

Push Service

No push is sent because this function only reads data or returns helper information.

Automation

No automation is run for this function.

Special Instructions

  • Required: document_id and signatureJSON (PNG data URL or base64). Aliases for signature: signature, approve_sign_img, sign.
  • Optional: name, corporation (defaults to current document values).
  • Staff token: any org document. Customer.Login token: only that customer's document (also via Customer.Documents.ApproveSign).
  • Already signed documents return success with already_signed=1.
  • To open the browser page instead, use Documents.ApproveSign.Link.
  • User must be from the same company domain as the request Host.

Required Parameters

NameTypeSampleExplanation
document_id
post
int1627documents.id (not last_documents_id). Aliases: id, inid.
signatureJSON
post
stringdata:image/png;base64,...Signature PNG as data URL or raw base64. Aliases: signature, approve_sign_img, sign.

Optional Parameters

NameTypeSampleWhat it gives
name
post
stringDemoSigner display name (שם). Defaults to document name.
corporation
post
string032451296Company/ID number (ח.פ או ת.ז). Defaults to document corporation.

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.ApproveSign",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "document_id": "1627",
        "name": "Demo",
        "corporation": "032451296",
        "signatureJSON": "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Documents.ApproveSign",
    "url_domain": "https:\/\/{domain}\/app\/Documents.ApproveSign"
}

Endpoint

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

Sample Output

{
    "success": 1,
    "message": "Success",
    "document_id": 1627,
    "last_documents_id": 1627,
    "type": "order_proposals",
    "approve": 1,
    "approve_sign_img": "biz1upload\/order_approve_sign\/xxx.png",
    "pdf_url": "biz1upload\/...\/file.pdf",
    "name": "Demo",
    "corporation": "032451296"
}

JavaScript Example

const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('document_id', '1627');
body.set('name', 'Demo');
body.set('corporation', '032451296');
body.set('signatureJSON', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==');

const res = await fetch('/app/Documents.ApproveSign', {
  method: 'POST',
  headers: { Authorization: `Bearer ${token}` },
  body
});
const data = await res.json();
console.log(data);

Error Example

{
    "success": 0,
    "message": "Your signature is required"
}