How to connect okdoc to Priority ERP
You connect okdoc to Priority with a small connector between the two systems' APIs and webhooks. When a client signs in okdoc, the signed copy is saved as an attachment on the Priority record, and when a Priority record reaches a status you choose, okdoc sends the client a document to sign. There is no built-in button yet, but you set the connector up once and from then on it runs on its own.
What the connection does
It works in both directions. First: when a client signs a document in okdoc, the signed PDF (with its audit certificate) is saved automatically in the attachments of the matching Priority record, for example the sales order. Second: when a Priority record reaches a status you choose, for example an order approved for sending, okdoc sends the client the document to sign by email or WhatsApp. Nobody types the same details twice, and no signed contract gets lost in an inbox.
What you need before you start
On the okdoc side: a plan with API access, currently AGENCY, since API keys can only be created on it. On the Priority side: version 17.2 or later to write data through the API, 19.1 or later for a Personal Access Token (PAT), 21.0 or later to attach files, and the Webhooks module if you also want the second direction. In between: a connector that receives a message from one side and calls the other. It can be a Make or Zapier scenario, an n8n workflow or a short function on your own server.
Step 1: an API key in okdoc
In the okdoc app, open the Developers screen and create a new key. It starts with ok_live_ and is shown only once, so store it in the connector right away, somewhere secure. Every call to the okdoc API carries the header Authorization: Bearer followed by the key.
Step 2: an access token in Priority
In Priority, define a Personal Access Token in the REST Interface Access Tokens form, for a user with permission to the forms the connection needs. Calls to Priority use Basic authentication: the username is the token and the password is simply the word PAT. The API's base URL is specific to each installation, and your Priority administrator knows it.
Step 3: a message from okdoc the moment a document is signed
On the same Developers screen, add a webhook pointing at the connector's HTTPS address and tick the document.signed event. okdoc only delivers to HTTPS addresses, because the message carries the signer's name and email. Each webhook has a secret starting with whsec_, and okdoc signs every message with it: the X-OKDOC-Signature header holds an HMAC-SHA256 of the message body. The connector computes the same value and rejects any message that does not match. This is what the message looks like, and how to check it:
POST https://your-connector.example.com/okdoc
X-OKDOC-Event: document.signed
X-OKDOC-Signature: <HMAC-SHA256 hex of the raw body, keyed with whsec_...>
{
"event": "document.signed",
"created_at": "2026-10-19T09:12:44.120Z",
"data": {
"document": { "id": "6f1c...", "title": "Order SO26000123", "status": "signed", "locale": "he" },
"recipient": { "name": "Dana Levi", "email": "dana@example.com" }
}
}
// Node.js: reject anything that was not signed with your webhook secret
import { createHmac, timingSafeEqual } from "crypto";
const expected = Buffer.from(createHmac("sha256", process.env.OKDOC_WEBHOOK_SECRET).update(rawBody).digest("hex"));
const received = Buffer.from(req.headers["x-okdoc-signature"] ?? "");
const valid = received.length === expected.length && timingSafeEqual(received, expected);Step 4: download the signed copy
The message does not include the file, only the document's ID. The connector calls okdoc with that ID and gets back the status, the signer's details, the event log and a link to download the signed PDF. The link is valid for one hour, so download the file straight away rather than storing the link.
GET https://okdocai.com/api/v1/documents/6f1c...
Authorization: Bearer ok_live_...
200 OK
{
"id": "6f1c...",
"title": "Order SO26000123",
"status": "signed",
"signed_at": "2026-10-19T09:12:41Z",
"signed_pdf_url": "https://... (valid for one hour)",
"recipient": { "name": "Dana Levi", "email": "dana@example.com", "status": "signed" },
"events": [ { "type": "...", "at": "..." } ]
}Step 5: attach the PDF to the Priority record
In Priority you attach a file through the record's attachments subform (EXTFILES_SUBFORM), sending the file as a base64 data URL. From version 22.0 you can add a SUFFIX field with .pdf, and Priority uses it instead of guessing from the file type. The example attaches the file to a sales order; any form with attachments works the same way.
POST {serviceRoot}/ORDERS('SO26000123')/EXTFILES_SUBFORM
Authorization: Basic base64("<your PAT>:PAT")
Content-Type: application/json
{
"EXTFILEDES": "Signed via okdoc",
"EXTFILENAME": "data:application/pdf;base64,JVBERi0xLjcK...",
"SUFFIX": ".pdf"
}
// serviceRoot looks like: https://<server>/odata/Priority/<tabula.ini>/<company>How the connector knows which record to attach to
You need a way to find the Priority record from the okdoc document. The simple way: put the record number in the document title, for example "Order SO26000123", and have the connector read it from the title. The more precise way: when the document is created from Priority (the second direction), the connector stores the document ID okdoc returned next to the record number, so when the signed message arrives it knows exactly where it belongs.
The other direction: Priority sends a document for signature
In Priority, register the connector's address in the Webhook Definitions form (System Management > System Maintenance > Periodic Maintenance > BPM Maintenance) and generate an authentication token. The token is hidden as soon as you leave the line, so copy it immediately. Then add a business rule or BPM rule on the status you want, choose the Webhook action, and list in the message body the fields to send: the record number, the customer's name, email and phone. Priority sends the token in the priority-bpm-token header, and the connector checks that it matches. From there the connector calls okdoc: with a PDF produced in Priority it uses the upload route, which adds a signature block and sends the client a link by email, WhatsApp or both. Without a file, it can create a text document through POST /api/v1/documents.
// What Priority sends (header priority-bpm-token carries your webhook token).
// The fields are the ones you put in the business rule message, for example:
{ "ORDERS": { "ORDNAME": "SO26000123", "CDES": "Dana Levi" } }
// Your connector then sends the PDF to okdoc for signature:
POST https://okdocai.com/api/v1/documents/upload
Authorization: Bearer ok_live_...
Content-Type: multipart/form-data
file = SO26000123.pdf
title = Order SO26000123
recipient_name = Dana Levi
recipient_email = dana@example.com (optional: emails the signing link)
recipient_phone = +972501234567 (optional: WhatsApps the signing link)
201 Created
{ "id": "6f1c...", "status": "sent", "signing_url": "https://...", "emailed": true, "whatsapped": true }Bonus: the deal amount in okdoc's reports
okdoc shows the deal value of every document and the money still open. If the amount already exists in Priority, the connector writes it to the document, even after the document was sent or signed.
PATCH https://okdocai.com/api/v1/documents/6f1c...
Authorization: Bearer ok_live_...
Content-Type: application/json
{ "deal_amount": 12500 }What to check before going live
Send yourself a test document, sign it, and check that the PDF appears in the attachments of the right record. Log every message the connector receives and every call that fails, so a problem never goes unnoticed. In Priority, from version 26.0, there is also a webhook error log. Keep the keys in the connector only, never in a browser or in public code, and give the Priority API user access only to the forms it really needs.
Frequently asked questions
Does okdoc have a built-in Priority integration?
Not yet. The connection is built on the APIs and webhooks of okdoc and Priority, with a small connector in between: Make, Zapier, n8n or your own code. You set it up once, and from then on documents flow on their own.
Which okdoc plan do I need for the integration?
A plan with API access, currently AGENCY. Without an API key the connector cannot download the signed copy or send documents on your behalf. Details are on the pricing page.
Which Priority version is required?
Version 17.2 or later to write through the API, 19.1 or later for a Personal Access Token (PAT) and 21.0 or later to attach files. For Priority to send documents for signature on its own, you also need the Webhooks module.
Can I set it up without a developer?
Most of it, yes. In Make or Zapier you build a module that receives the webhook, an HTTP module that calls okdoc and an HTTP module that calls Priority. Verifying the message signature (HMAC) is best done in code or in a tool that supports it. If you have not worked with APIs before, your IT person or Priority vendor can help.
Is the signers' data protected on the way?
okdoc only sends messages to HTTPS addresses and signs every message with a secret only you hold. The link to the signed PDF is valid for one hour, and the keys live only in your connector.
Does it work with both Priority cloud and on-premise?
Priority's REST API exists in both. On-premise, make sure the connector can reach your Priority server, and that the server can reach the connector if you use webhooks.
Can I update a status in Priority after the client signs?
Yes, by updating (PATCH) the record through Priority's API, in the same step where you attach the PDF. Field and status names depend on your setup, so check them with your Priority administrator first.