Linkit

Digital service contract

Agreement JSON, sign, and public blank templates

Digital service contract

All five /api/v1/contracts/digital-service* routes are mounted. Live Ocima owner JWT, 2026-09-10: agreement 200, tenant PDF 200, templates 200 without a token.

Signing replaces the stored PDF. There is no "already signed" refusal. A second sign with a new company name overwrites contract_file.


Routes

EndpointGuardLive
GET /api/v1/contracts/digital-serviceauthenticated200 agreement JSON
POST /api/v1/contracts/digital-service/signauthenticated400 if accept_terms is not true
GET /api/v1/contracts/digital-service/pdfauthenticated200 application/pdf (signed or blank)
GET /api/v1/contracts/digital-service/template.pdfpublic200 without Authorization
GET /api/v1/contracts/digital-service/template.htmlpublic200 text/html bilingual page

Unauthenticated GET of the agreement is 401.


Agreement body (live, unsigned)

Top-level keys: provider, client, pricing, payment, suspension_notice, governing_law, download_url, template_download_url, signed_contract, legal_highlights.

signed_contract on Ocima:

{
  "signed": false,
  "signer_name": "جمعة السيد",
  "stored_contract_file": "ocima_contract_ws4hggmuhc.pdf",
  "stored_contract_file_url": "/api/files/users/6yuq0469q3r40vy/ocima_contract_ws4hggmuhc.pdf"
}

download_url is /api/v1/contracts/digital-service/pdf. amount_per_branch_sar follows the live platform rate (100 on this host).

Contract prose is not localised by the admin catalogue — the bilingual HTML template is the translated artefact.


Sign

{
  "accept_terms": true,
  "accept_terms_ar": true,
  "company_name": "Ocima",
  "address": "Jeddah",
  "signer_name": "Owner"
}

accept_terms false or omitted → 400 {data:{}, message:"Accept_terms must be true before signing.", status:400} (sentenized).

accept_terms covers the English text only. accept_terms_ar is the Arabic half. Both signature_en and signature_ar together take the bilingual ink path; otherwise Go's original /sign path runs.

Signer ladder: request signer_name, then request client_name, then profile, username, email.