{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Request Message for Performing A Transaction",
  "description": "Request the terminal with the provided TID to complete a transaction of the type defined by the method property.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "jsonrpc",
    "id",
    "method",
    "params"
  ],
  "properties": {
    "jsonrpc": {
      "title": "JSON-RPC Version Number",
      "description": "Identifies the JSON Remote Protocol version that this message uses.",
      "type": "string",
      "enum": [
        "2.0"
      ],
      "default": "2.0"
    },
    "id": {
      "title": "JSON-RPC2 Message ID",
      "description": "Used to identify this request message. The same id will be used in the response message so that the response can be matched with the request.",
      "type": "integer",
      "maximum": 999999,
      "minimum": 0
    },
    "method": {
      "type": "string",
      "enum": [
        "sale",
        "refund",
        "preAuth",
        "completion",
        "accountVerification"
      ]
    },
    "params": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "tid",
        "currency",
        "amount"
      ],
      "properties": {
        "tid": {
          "title": "Terminal Identifier (TID)",
          "description": "The identifier for a terminal.",
          "type": "string",
          "default": "N/A"
        },
        "currency": {
          "title": "Currency Code",
          "description": "The currency this terminal or request is using. If being used to set the currency code of a response message then it must be the same currency as the associated request message. The textual representation from ISO 4217 is used.",
          "type": "string",
          "enum": [
            "GBP",
            "EUR"
          ]
        },
        "amount": {
          "title": "Transaction Amount",
          "description": "Amount in pence/cents.",
          "type": "integer",
          "minimum": 1,
          "maximum": 99999999
        },
        "amountCashback": {
          "title": "Cashback Amount",
          "description": "Amount of cashback to attempt to add to this transaction (in pence). The response to this request will indicate the amount of cashback actually processed. Only valid for a SALE transaction.",
          "type": "integer",
          "minimum": 0,
          "maximum": 10000
        },
        "cardholderNotPresent": {
          "title": "CNP Flag",
          "description": "Indicates whether this transaction should be completed as CNP (e.g. manual entry of card details). If the flag is true the PDQ skips the `Present Card` screen and goes directly into \"Key Card Number\".",
          "type": "boolean"
        },
        "authCode": {
          "title": "Auth Code for Completion",
          "description": "(Ingenico Only). Only used for a COMPLETION transaction. Should contain the auth code of the first pre-auth transaction performed on a customer's card. Pre-auths and completions must be completed on the same card.",
          "type": "string"
        },
        "amountPreAuthorisedTotal": {
          "title": "Sum of Pre-authorised Amounts for Completion",
          "description": "(Ingenico Only). Only used for a COMPLETION transaction. Should contain the sum of all pre-auth transactions performed on a customer's card. Pre-auths and completions must be completed on the same card.",
          "type": "string"
        }
      }
    }
  }
}