{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/clickatell/main/json-schema/clickatell-pay-by-link-request-schema.json",
  "title": "PayByLinkRequest",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clickatell-chat-2-pay-api-openapi.json#/components/schemas/PayByLinkRequest",
  "required": [
    "channel",
    "currency",
    "orderNumber",
    "timestamp",
    "to",
    "totalAmount"
  ],
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "description": "The channel used to send the payment link to the end-user. Values: sms, whatsapp, none (only used if you do not want to send the payment link through a channel configured on Chat 2 Pay)",
      "enum": [
        "ChannelType.SMS(name=SMS, id=1)",
        "ChannelType.WHATSAPP(name=WHATSAPP, id=2)",
        "ChannelType.NONE(name=NONE, id=0)"
      ]
    },
    "from": {
      "type": "string",
      "description": "The mobile number of the sender used when sending payment link"
    },
    "to": {
      "type": "string",
      "description": "The end-user’s mobile number that the payment link must be sent to."
    },
    "orderNumber": {
      "maxLength": 32,
      "minLength": 0,
      "type": "string",
      "description": "The order number associated with this payment"
    },
    "timestamp": {
      "type": "string",
      "description": "The date and time that the system sends the request (ISO 8601 format)",
      "format": "date-time"
    },
    "currency": {
      "pattern": "[A-Za-z]{3}",
      "type": "string",
      "description": "The currency that the end-user is using to transact (Three-character ISO Standard Currency Codes)"
    },
    "taxAmount": {
      "minimum": 0,
      "exclusiveMinimum": false,
      "type": "number",
      "description": "Tax due on this purchase"
    },
    "subTotalAmount": {
      "minimum": 0,
      "exclusiveMinimum": true,
      "type": "number",
      "description": "Amount due before tax"
    },
    "totalAmount": {
      "minimum": 0,
      "exclusiveMinimum": true,
      "type": "number",
      "description": "Amount that the end-user needs to pay"
    },
    "paymentGatewaySettingsId": {
      "type": "string",
      "description": "ID of payment gateway settings if multiple payment gateway settings were configured"
    },
    "additionalData": {
      "$ref": "#/$defs/JsonNode"
    },
    "returnPaymentLink": {
      "type": "boolean",
      "description": "Returns the payment link in the response if set to ‘true’"
    },
    "applicationId": {
      "type": "string",
      "description": "Unique reference number generated by Clickatell to identify the client’s application. This ID can be retrieved from the Clickatell customer portal."
    },
    "paymentReviewAutoReversal": {
      "type": "boolean",
      "description": "Make automatically transaction reversal in case of REVIEW state",
      "default": false
    },
    "transactionType": {
      "type": "string",
      "description": "Specifies the type of transaction that will be performed by the Payment Gateway. Allowed values are: Sale or Authorization. If a value is not supplied, the default transaction type that was set as part of the payment settings for the Chat 2 Pay configuration in the Clickatell Portal will be used.",
      "enum": [
        "TransactionType.AUTHORIZATION(name=Authorization, id=1)",
        "TransactionType.SALE(name=Sale, id=2)",
        "TransactionType.VOID(name=Void, id=3)",
        "TransactionType.CAPTURE(name=Capture, id=4)"
      ]
    },
    "orderLineItems": {
      "type": "array",
      "description": "The list of items associated with an order, e.g. products. ",
      "items": {
        "$ref": "#/$defs/LineItemRequest"
      }
    },
    "reconciliationId": {
      "maxLength": 60,
      "minLength": 0,
      "type": "string",
      "description": "Reference number that you use to reconcile your transaction reports with your processor reports. Also known as Transaction Reference Number or TRN."
    },
    "merchantDescriptor": {
      "type": "string",
      "description": "Merchant's business name. This name is displayed on the cardholder’s statement. Check your payment gateway integration guides for restrictions on maximum data length and allowed characters."
    }
  },
  "$defs": {
    "JsonNode": {
      "type": "object",
      "description": "Any additional data over and above what is already included that you want to store in the database along with that record and/or return in the response"
    },
    "LineItemRequest": {
      "required": [
        "name",
        "unitPrice"
      ],
      "type": "object",
      "properties": {
        "code": {
          "maxLength": 255,
          "minLength": 0,
          "type": "string",
          "description": "Type of product"
        },
        "name": {
          "maxLength": 255,
          "minLength": 0,
          "type": "string",
          "description": "Name of the item"
        },
        "quantity": {
          "minimum": 1,
          "type": "integer",
          "description": "Quantity of line items",
          "format": "int32"
        },
        "sku": {
          "maxLength": 255,
          "minLength": 0,
          "type": "string",
          "description": "Identification code for the product"
        },
        "unitPrice": {
          "minimum": 0,
          "exclusiveMinimum": true,
          "type": "number",
          "description": "Price of the line item"
        },
        "taxAmount": {
          "minimum": 0,
          "exclusiveMinimum": true,
          "type": "number",
          "description": "Tax amount to apply to the line item"
        }
      },
      "description": "The list of items associated with an order, e.g. products. "
    }
  }
}