---
$schema: "http://json-schema.org/draft-04/schema#"
title: SignatoryFieldSignature
description: |
  A signatory field for placing signature boxes on the document.
type: object
properties:
  type:
    type: string
    enum:
      - signature
  name:
    type: string
    description: |
      A name for the signature field.

      The signatory will not see the name of the signature field, however it
      will be used in the Evidence Log as a reference.
  signature:
    anyOf:
      - type: "null"
        description: When the signatory has not yet drawn a signature.
      - type: string
        description: The File ID of the signature drawn by the signatory.
    readOnly: true
  is_obligatory:
    type: boolean
    default: true
  should_be_filled_by_sender:
    type: boolean
    default: false
  placements:
    description: |
      **Needs to be set, otherwise the signatory will not be able to draw a signature.**

      Defines where this field should be placed on the document.
      This is both for the signatory to fill out on the signing page, and for
      the final sealed PDF.

      Note that this is an array, you can have multiple placements for the same
      field.

      The easiest way to set the `xrel`, `yrel`, etc. values is to create a
      template in the document UI design view, and use those values.
    $ref: ./SignatoryFieldStandardPlacements.yaml
required:
  - type
  - name
example:
  {
    "type": "signature",
    "name": "Signature 1",
    "signature": "9215148251416996589",
    "is_obligatory": true,
    "should_be_filled_by_sender": false,
    "placements": [
      {
        "xrel": 0.3510526315789474,
        "yrel": 0.1796747967479675,
        "wrel": 0.2736842105263158,
        "hrel": 0.08292682926829269,
        "fsrel": 0.0168,
        "page": 1,
        "tip": "right",
        "anchors": []
      }
    ]
  }
