{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/two/json-schema/two-order-response-schema-schema.json",
  "title": "OrderResponseSchema",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/two-openapi.yaml#/components/schemas/OrderResponseSchema",
  "properties": {
    "id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "A globally unique ID set by Two.",
      "title": "Id"
    },
    "order_placed_date": {
      "description": "Date the order was placed (UTC)",
      "format": "date-time",
      "title": "Order Placed Date",
      "type": "string"
    },
    "gross_amount": {
      "description": "net_amount + tax_amount",
      "format": "decimal",
      "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
      "title": "Gross Amount",
      "type": "string"
    },
    "payable_amount": {
      "anyOf": [
        {
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "invoice_amount - prepaid_amount",
      "title": "Payable Amount"
    },
    "invoice_amount": {
      "anyOf": [
        {
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "total of invoice",
      "title": "Invoice Amount"
    },
    "prepaid_amount": {
      "anyOf": [
        {
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "amount paid upfront",
      "title": "Prepaid Amount"
    },
    "net_amount": {
      "description": "(quantity * unit_price) - discount_amount",
      "format": "decimal",
      "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
      "title": "Net Amount",
      "type": "string"
    },
    "currency": {
      "$ref": "#/$defs/CurrencyEnum",
      "description": "Currency code in ISO 4217 format. E.g. 'NOK'"
    },
    "discount_amount": {
      "deprecated": true,
      "description": "Deprecated, discount amount is only applicable at line item level",
      "format": "decimal",
      "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
      "title": "Discount Amount",
      "type": "string"
    },
    "discount_rate": {
      "deprecated": true,
      "description": "Deprecated, discount rate is only applicable at line item level",
      "format": "decimal",
      "pattern": "^-?[0-9]+(\\.[0-9]{0,6})?",
      "title": "Discount Rate",
      "type": "string"
    },
    "tax_amount": {
      "description": "net_amount * tax_rate",
      "format": "decimal",
      "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
      "title": "Tax Amount",
      "type": "string"
    },
    "invoice_type": {
      "$ref": "#/$defs/InvoiceTypeEnum",
      "description": "FUNDED_INVOICE: Two will handle the invoice and transfer the funds to the merchant as per the factoring agreement. The invoice_details field will be populated by Two. DIRECT_INVOICE: Two generates and sends the invoice to the customer based on the bank account provided by the merchant, but the merchant takes the full credit and fraud risk on direct invoices and they will not receive a payout."
    },
    "order_type": {
      "$ref": "#/$defs/OrderTypeEnum",
      "description": "Type of order (Buyer or Merchant initiated)"
    },
    "sale_country_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional sale country code (ISO 3166 Alpha-2) to use for this order, if null defaults to buyer country code.",
      "title": "Sale Country Code"
    },
    "merchant_payout_account_alias": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional payee account alias account identifier for multiple accounts setup.",
      "title": "Merchant Payout Account Alias"
    },
    "percentage_fee": {
      "anyOf": [
        {
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,6})?",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Percentage fee",
      "title": "Percentage Fee"
    },
    "fixed_fee": {
      "anyOf": [
        {
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Fixed fee",
      "title": "Fixed Fee"
    },
    "total_fee": {
      "anyOf": [
        {
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total fee",
      "title": "Total Fee"
    },
    "state": {
      "anyOf": [
        {
          "$ref": "#/$defs/OrderStateEnum"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Current Order State"
    },
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/OrderStatusEnum"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Order approval status"
    },
    "recurring": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "If set to true, an invoice will be generated periodically according to the specification provided in recurring_details",
      "title": "Recurring"
    },
    "buyer": {
      "$ref": "#/$defs/LaxBuyerSchema",
      "description": "Fields representing the buyer"
    },
    "buyer_department": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Department the purchase is to be registered on",
      "title": "Buyer Department"
    },
    "buyer_project": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Project the purchase is to be registered on",
      "title": "Buyer Project"
    },
    "buyer_purchase_order_number": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Purchase order number to attribute to the order",
      "title": "Buyer Purchase Order Number"
    },
    "buyer_reference": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "General buyer reference field for information that is not covered by the specific reference fields, e.g. PO-number. Note: Maximum 140 characters",
      "title": "Buyer Reference"
    },
    "buyer_vat_number": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Vat number associated with the buyer company",
      "title": "Buyer Vat Number"
    },
    "electronic_invoice_recipient": {
      "anyOf": [
        {
          "$ref": "#/$defs/ElectronicInvoiceRecipient"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Electronic invoice recipient"
    },
    "line_items": {
      "description": "List of the line items that constitute the order",
      "items": {
        "$ref": "#/$defs/LineItemResponseSchema"
      },
      "title": "Line Items",
      "type": "array"
    },
    "merchant_order_id": {
      "description": "Your order ID registered in your solution",
      "title": "Merchant Order Id",
      "type": "string"
    },
    "merchant_reference": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Field set by merchant for adding a reference to be used internally by the merchant. Does not appear on invoice.",
      "title": "Merchant Reference"
    },
    "merchant_user_id": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Your internal ID of the user (the employee of your business customer) registered for one-click purchase through the Two Trade Account Onboarding API.",
      "title": "Merchant User Id"
    },
    "billing_account_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "ID for the billing account linked to this order. Can be set on order creation or order edit while the order is still editable. A null value means no billing account is linked. When set, billing account payment terms control repayment scheduling.",
      "title": "Billing Account Id"
    },
    "date_created": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Order creation date (UTC)",
      "title": "Date Created"
    },
    "date_updated": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Order update date (UTC)",
      "title": "Date Updated"
    },
    "merchant_additional_info": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Additional info the merchant can connect to the order",
      "title": "Merchant Additional Info"
    },
    "recurring_details": {
      "anyOf": [
        {
          "$ref": "#/$defs/RecurringDetailsSchema"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Currently not available"
    },
    "invoice_details": {
      "anyOf": [
        {
          "$ref": "#/$defs/InvoiceDetailsSchema"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Invoice details are provided by the merchant via Merchant Portal when invoice_type is DIRECT_INVOICE, Two Bank or a 3rd-party bank when invoice_type is FUNDED_INVOICE and empty when invoice_type is CARD."
    },
    "merchant_id": {
      "description": "A globally unique merchant ID set by Two.",
      "format": "uuid",
      "title": "Merchant Id",
      "type": "string"
    },
    "merchant_short_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The short form name of the merchant",
      "title": "Merchant Short Name"
    },
    "merchant_logo_path": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The logo URL of the merchant",
      "title": "Merchant Logo Path"
    },
    "merchant_urls": {
      "anyOf": [
        {
          "$ref": "#/$defs/OrderMerchantUrlsSchema"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "List of urls hosted by the merchant."
    },
    "payment_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "'Redirect the user to Two hosted page to verify the payment.",
      "title": "Payment Url"
    },
    "invoice_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Link to the invoice pdf. E.g.",
      "title": "Invoice Url"
    },
    "credit_note_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Link to the credit note pdf",
      "title": "Credit Note Url"
    },
    "event_log_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "This url returns a list of all events that are associated with the order",
      "title": "Event Log Url"
    },
    "shipping_details": {
      "anyOf": [
        {
          "$ref": "#/$defs/ShippingDetailsSchema"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional shipping details to track the shipment"
    },
    "original_order_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "deprecated": true,
      "description": "The original order id has been deprecated in favor of root_order_id, please use root_order_id instead",
      "title": "Original Order Id"
    },
    "root_order_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The root order id",
      "title": "Root Order Id"
    },
    "parent_order_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The parent order id",
      "title": "Parent Order Id"
    },
    "external_order_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Your external order id",
      "title": "External Order Id"
    },
    "external_order_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Your external order status",
      "title": "External Order Status"
    },
    "decline_reason": {
      "anyOf": [
        {
          "$ref": "#/$defs/DeclineReasonEnum"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Reason for order being declined"
    },
    "recourse_decision_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Reason for recourse decision",
      "title": "Recourse Decision Reason"
    },
    "order_note": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "General note/message from the buyer to the merchant",
      "title": "Order Note"
    },
    "order_origination": {
      "anyOf": [
        {
          "$ref": "#/$defs/OrderOriginationEnum"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "IN_STORE orders are not enabled by default. Please reach out to us if you would like to discuss IN_STORE orders."
    },
    "billing_address": {
      "$ref": "#/$defs/AddressResponseSchema",
      "description": "Order billing address"
    },
    "shipping_address": {
      "$ref": "#/$defs/AddressResponseSchema",
      "description": "Order shipping address"
    },
    "date_fulfilled": {
      "anyOf": [
        {
          "format": "date",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Date when the order was fulfilled (UTC)",
      "title": "Date Fulfilled"
    },
    "tracking_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The tracking_id from `POST /order_intent` ",
      "title": "Tracking Id"
    },
    "vendor_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The id of the vendor",
      "title": "Vendor Id"
    },
    "refunds": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/CreateRefundResponseSchema"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Refunds attached to this order",
      "title": "Refunds"
    },
    "order_revision": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Order revision",
      "title": "Order Revision"
    },
    "vendor_name": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The name of the vendor",
      "title": "Vendor Name"
    },
    "elapsed_time_ms": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Elapsed Time Ms"
    },
    "invoice_insurance_provider": {
      "anyOf": [
        {
          "$ref": "#/$defs/InvoiceInsuranceDecisionEnum"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The insurance provider"
    },
    "tax_subtotals": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/TaxSubtotalSchema"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "List of tax subtotals for unique tax brackets",
      "title": "Tax Subtotals"
    },
    "approved_on_recourse": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Approved On Recourse"
    },
    "recourse_fallback_enabled": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": "Deprecated. Use approved_on_recourse.",
      "deprecated": true,
      "title": "Recourse Fallback Enabled"
    },
    "merchant_display_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The display name of the merchant",
      "title": "Merchant Display Name"
    },
    "terms": {
      "anyOf": [
        {
          "description": "For backwards compatibility, `type` can be omitted for instalment terms, if the fields period and number_of_instalments are populated. It is recommended that that clients always provide a type value.",
          "oneOf": [
            {
              "$ref": "#/$defs/OrderInstalmentTerms"
            },
            {
              "$ref": "#/$defs/OrderNetTerms"
            }
          ]
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The terms of this order",
      "title": "Terms"
    },
    "lending_terms": {
      "anyOf": [
        {
          "$ref": "#/$defs/OrderLendingTermsSchema"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The lending terms of this order associated with a credit line"
    },
    "credit_line_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "ID of the credit line used to fund the order, created through the Two Credit Line API.",
      "title": "Credit Line Id"
    },
    "invoice_distributed_by_merchant": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "If set to true, the invoice is distributed by the merchant",
      "title": "Invoice Distributed By Merchant"
    },
    "principal_amount": {
      "anyOf": [
        {
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total principal amount to be paid back for this order",
      "title": "Principal Amount"
    },
    "buyer_finance_charge_amount": {
      "anyOf": [
        {
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total amount of interest/fees the buyer will pay back by fully paying off this order",
      "title": "Buyer Finance Charge Amount"
    },
    "preferred_distribution_method": {
      "anyOf": [
        {
          "$ref": "#/$defs/DistributionMethodEnum"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Allows merchant to set the method of distribution for the invoice and credit notes of the order, if not set will default to all methods"
    }
  },
  "required": [
    "order_placed_date",
    "gross_amount",
    "payable_amount",
    "invoice_amount",
    "prepaid_amount",
    "net_amount",
    "currency",
    "discount_amount",
    "discount_rate",
    "tax_amount",
    "invoice_type",
    "order_type",
    "buyer",
    "line_items",
    "merchant_order_id",
    "merchant_id",
    "billing_address",
    "shipping_address"
  ],
  "type": "object",
  "$defs": {
    "AddressResponseSchema": {
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "organization_name": {
          "title": "Organization Name",
          "type": "string"
        },
        "street_address": {
          "title": "Street Address",
          "type": "string"
        },
        "postal_code": {
          "title": "Postal Code",
          "type": "string"
        },
        "city": {
          "title": "City",
          "type": "string"
        },
        "region": {
          "title": "Region",
          "type": "string"
        },
        "country": {
          "$ref": "#/$defs/CountryCodeEnum"
        },
        "preferred": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Preferred"
        }
      },
      "required": [
        "id",
        "organization_name",
        "street_address",
        "postal_code",
        "city",
        "region",
        "country"
      ],
      "title": "AddressResponseSchema",
      "type": "object"
    },
    "BankAccountSchema": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "bban": {
          "anyOf": [
            {
              "maxLength": 30,
              "minLength": 7,
              "pattern": "^[0-9A-Za-z]*$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bban"
        },
        "iban": {
          "anyOf": [
            {
              "maxLength": 34,
              "minLength": 15,
              "pattern": "^[0-9A-Za-z]*$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Iban"
        },
        "bic": {
          "anyOf": [
            {
              "maxLength": 12,
              "minLength": 8,
              "pattern": "^[0-9A-Za-z]*$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Bic"
        },
        "country_code": {
          "anyOf": [
            {
              "$ref": "#/$defs/CountryCodeEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "branch_sort_code": {
          "anyOf": [
            {
              "maxLength": 9,
              "pattern": "^[0-9]*$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Branch Sort Code"
        },
        "local_account_number": {
          "anyOf": [
            {
              "maxLength": 12,
              "minLength": 8,
              "pattern": "^[0-9]*$",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Local Account Number"
        },
        "organization_name": {
          "anyOf": [
            {
              "maxLength": 140,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Organization Name"
        },
        "organization_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Organization Number"
        },
        "description": {
          "anyOf": [
            {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        },
        "kid_type": {
          "anyOf": [
            {
              "$ref": "#/$defs/KidTypeEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "title": "BankAccountSchema",
      "type": "object"
    },
    "BarCodeSchema": {
      "properties": {
        "value": {
          "description": "The identifier as a string",
          "title": "Value",
          "type": "string"
        },
        "type": {
          "description": "Type of the identifier. Can be either \"SKU\" or a Global Trade Item Number (GTIN) type like \"UPC\", \"EAN\", \"GS1\".",
          "title": "Type",
          "type": "string"
        }
      },
      "required": [
        "value",
        "type"
      ],
      "title": "BarCodeSchema",
      "type": "object"
    },
    "BuyerRefundSurcharge": {
      "properties": {
        "surcharge_type": {
          "$ref": "#/$defs/BuyerSurchargeType",
          "description": "Type of surcharge"
        },
        "amount": {
          "description": "Amount of the surcharge, excluding VAT/tax. Must be greater than zero.",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Amount",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Human readable text included in the credit note",
          "title": "Description"
        },
        "tax_rate": {
          "anyOf": [
            {
              "format": "decimal",
              "pattern": "^-?[0-9]+(\\.[0-9]{0,6})?",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": "0.00",
          "description": "Tax rate of the surcharge if applicable.",
          "title": "Tax Rate"
        }
      },
      "required": [
        "surcharge_type",
        "amount"
      ],
      "title": "BuyerRefundSurcharge",
      "type": "object"
    },
    "BuyerSurchargeType": {
      "enum": [
        "return_fee",
        "neglected_order_fee",
        "handling_fee",
        "processing_fee",
        "missing_or_damaged_items_fee",
        "return_shipping_fee",
        "discount_reversal_fee",
        "other_fee"
      ],
      "title": "BuyerSurchargeType",
      "type": "string"
    },
    "CallbackAuthTypeEnum": {
      "enum": [
        "BEARER"
      ],
      "title": "CallbackAuthTypeEnum",
      "type": "string"
    },
    "CountryCodeEnum": {
      "enum": [
        "AD",
        "AE",
        "AL",
        "AM",
        "AO",
        "AR",
        "AT",
        "AU",
        "AZ",
        "BA",
        "BB",
        "BD",
        "BE",
        "BF",
        "BG",
        "BH",
        "BI",
        "BJ",
        "BN",
        "BO",
        "BR",
        "BS",
        "BW",
        "CA",
        "CG",
        "CH",
        "CL",
        "CM",
        "CO",
        "CR",
        "CY",
        "CZ",
        "DE",
        "DJ",
        "DK",
        "DO",
        "DZ",
        "EC",
        "EE",
        "EG",
        "ES",
        "ET",
        "FI",
        "FJ",
        "FR",
        "GA",
        "GB",
        "GE",
        "GH",
        "GN",
        "GQ",
        "GR",
        "GT",
        "GY",
        "HN",
        "HR",
        "HT",
        "HU",
        "ID",
        "IE",
        "IL",
        "IN",
        "IQ",
        "IS",
        "IT",
        "JM",
        "JO",
        "JP",
        "KE",
        "KG",
        "KH",
        "KR",
        "KW",
        "KZ",
        "LA",
        "LB",
        "LI",
        "LK",
        "LT",
        "LU",
        "LV",
        "LR",
        "MA",
        "MC",
        "MD",
        "ME",
        "MG",
        "MK",
        "MN",
        "MR",
        "MT",
        "MU",
        "MV",
        "MW",
        "MX",
        "MY",
        "MZ",
        "NA",
        "NE",
        "NG",
        "NL",
        "NO",
        "NP",
        "NZ",
        "OM",
        "PA",
        "PE",
        "PG",
        "PH",
        "PK",
        "PL",
        "PT",
        "PY",
        "QA",
        "RO",
        "RS",
        "RW",
        "SA",
        "SE",
        "SG",
        "SI",
        "SK",
        "SL",
        "SN",
        "SR",
        "SV",
        "SZ",
        "TD",
        "TG",
        "TH",
        "TJ",
        "TM",
        "TN",
        "TR",
        "TT",
        "TZ",
        "UA",
        "UG",
        "US",
        "UY",
        "UZ",
        "VN",
        "ZA",
        "ZM"
      ],
      "title": "CountryCodeEnum",
      "type": "string"
    },
    "CreateRefundResponseSchema": {
      "additionalProperties": true,
      "properties": {
        "id": {
          "description": "A globally unique ID set by Two.",
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "amount": {
          "deprecated": true,
          "description": "payable amount being refunded",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Amount",
          "type": "string"
        },
        "total_amount": {
          "description": "payable_amount + prepaid_amount",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Total Amount",
          "type": "string"
        },
        "payable_amount": {
          "description": "Amount due from the buyer to Two. Formula: invoice_amount - prepaid_amount. This is the portion Two funds and takes risk on.",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Payable Amount",
          "type": "string"
        },
        "prepaid_amount": {
          "default": "0.00",
          "description": "Prepaid amount refunded",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Prepaid Amount",
          "type": "string"
        },
        "currency": {
          "$ref": "#/$defs/CurrencyEnum",
          "description": "Currency refund is being issued in"
        },
        "refund_no": {
          "deprecated": true,
          "description": "Refund number, please use credit_note_number. if you supply your own credit note numbers and it contains non numeric values this value will be null",
          "title": "Refund No",
          "type": "integer"
        },
        "credit_note_number": {
          "description": "A unique, sequential identifier for credit notes, similar to invoice_number. Follows a monotonically increasing series to ensure chronological tracking, prevent duplicates, and maintain auditability and compliance with financial regulations.",
          "title": "Credit Note Number",
          "type": "string"
        },
        "credit_note_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Link to credit note issued by Two",
          "title": "Credit Note Url"
        },
        "line_items": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/LineItemResponseSchema"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "List of the line items that constitute the order",
          "title": "Line Items"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Reason for order refund",
          "title": "Reason"
        },
        "tax_subtotals": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/TaxSubtotalSchema"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "List of tax subtotals for unique tax brackets",
          "title": "Tax Subtotals"
        },
        "buyer_refund_surcharges": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/BuyerRefundSurcharge"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Buyer Refund Surcharges"
        },
        "refund_reference": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Refund Reference"
        },
        "refund_date": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Refund Date"
        }
      },
      "required": [
        "id",
        "amount",
        "total_amount",
        "payable_amount",
        "currency",
        "refund_no",
        "credit_note_number"
      ],
      "title": "CreateRefundResponseSchema",
      "type": "object"
    },
    "CurrencyEnum": {
      "enum": [
        "CHF",
        "CZK",
        "DKK",
        "EUR",
        "GBP",
        "INR",
        "MXN",
        "NOK",
        "PLN",
        "RON",
        "SEK",
        "USD"
      ],
      "title": "CurrencyEnum",
      "type": "string"
    },
    "DeclineReasonEnum": {
      "enum": [
        "TOO_HIGH_RISK",
        "BUYER_LIMIT_EXCEEDED",
        "BUYER_NOT_FOUND",
        "BUYER_ADDRESS_DEVIATION",
        "BUYER_INFO_INCONSISTENT",
        "BUYER_AUTHENTICATION_FAILED",
        "FRAUD_CHECK_NOT_PASSED",
        "CREDIT_CHECK_FAILED",
        "EXCEPTION",
        "SERVICE_UNAVAILABLE",
        "BUYER_IN_ARREARS",
        "DECLINED_IN_VERIFICATION",
        "UNDEFINED",
        "INVALID_LEGAL_REP",
        "ORDER_EXCEEDS_MAX_INVOICE_AMOUNT",
        "SE_SOLE_TRADER",
        "INVALID_ORDER_DATA",
        "INVALID_ORDER_DATA_TOTAL_AMOUNT_MISMATCH",
        "INVALID_ORDER_LINE_ITEM_DATA_AMOUNT_MISMATCH",
        "MERCHANT_LIMIT_EXCEEDED",
        "ORDER_BELOW_MIN_INVOICE_AMOUNT",
        "ORDER_EXCEEDS_MIN_INVOICE_AMOUNT",
        "BUYER_NOT_SUPPORTED",
        "BUYER_IS_BLOCKED",
        "NO_BUSINESS_ACCOUNT",
        "MERCHANT_NOT_ON_RECOURSE",
        "COMPANY_CREDIT_REPORT_CONSENT_REQUIRED",
        "NO_LEGAL_REPRESENTATIVES",
        "CREDIT_REPORT_BLOCKED",
        "ORDER_EXCEEDS_REGIONAL_LIMIT"
      ],
      "title": "DeclineReasonEnum",
      "type": "string"
    },
    "DeliveryMethodEnum": {
      "description": "Enum for types of shipping methods",
      "enum": [
        "PICKUP_STORE",
        "PICKUP_POINT",
        "DELIVERED_TO_SHIPPING_ADDRESS",
        "DELIVERED_DIGITALLY",
        "EXPRESS_PICKUP_POINT",
        "EXPRESS_SHIPPING_ADDRESS",
        "OTHER"
      ],
      "title": "DeliveryMethodEnum",
      "type": "string"
    },
    "DistributionMethodEnum": {
      "enum": [
        "EMAIL",
        "ELECTRONIC_INVOICE"
      ],
      "title": "DistributionMethodEnum",
      "type": "string"
    },
    "DueDateCalculationScheme": {
      "description": "Scheme for calculating invoice due dates for orders.\nWhen set, modifies the due_in_days calculation based on the scheme type.",
      "enum": [
        "END_OF_MONTH",
        "END_OF_WEEK"
      ],
      "title": "DueDateCalculationScheme",
      "type": "string"
    },
    "ElectronicInvoiceRecipient": {
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "type": {
          "$ref": "#/$defs/ElectronicInvoiceRecipientTypeEnum"
        },
        "operator_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Operator Id"
        }
      },
      "required": [
        "id",
        "type"
      ],
      "title": "ElectronicInvoiceRecipient",
      "type": "object"
    },
    "ElectronicInvoiceRecipientTypeEnum": {
      "enum": [
        "NO_ORGNUMBER",
        "SE_ORGNUMBER",
        "GLN",
        "DK_ORGNUMBER",
        "FI_ORGNUMBER",
        "FINVOICE"
      ],
      "title": "ElectronicInvoiceRecipientTypeEnum",
      "type": "string"
    },
    "InvoiceDetailsSchema": {
      "properties": {
        "payee": {
          "anyOf": [
            {
              "$ref": "#/$defs/BankAccountSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "payment_reference": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Payment Reference"
        },
        "payment_reference_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Payment Reference Type"
        },
        "payment_reference_message": {
          "default": "",
          "description": "Text that will be attached to the payment in order for the merchant to reconcile the payment.",
          "title": "Payment Reference Message",
          "type": "string"
        },
        "payment_reference_ocr": {
          "default": "",
          "description": "A string of numbers that will be attached to the payment in order for the merchant to reconcile the payment. E.g. \"KID-nummer\" in Norway.",
          "title": "Payment Reference Ocr",
          "type": "string"
        },
        "payment_status": {
          "anyOf": [
            {
              "$ref": "#/$defs/PaymentStatusEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "due_in_days": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "deprecated": true,
          "description": "Please add terms to order instead, with type NET_TERMS and duration_days",
          "title": "Due In Days"
        },
        "invoice_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Invoice Number"
        },
        "invoice_issue_date": {
          "anyOf": [
            {
              "format": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Invoice Issue Date"
        },
        "due_date": {
          "anyOf": [
            {
              "format": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Due Date"
        },
        "invoice_emails": {
          "anyOf": [
            {
              "items": {
                "format": "email",
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "We will send invoices to all of the email addresses.",
          "title": "Invoice Emails"
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "status": {
          "anyOf": [
            {
              "$ref": "#/$defs/InvoiceStatusEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": "PENDING",
          "description": "Status of invoice, mainly interested if has a status of REPLACED from an invoice edit"
        },
        "invoice_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Invoice Url"
        },
        "due_in_days_calculation_method": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Method for calculating payment terms (e.g., END_OF_MONTH, END_OF_WEEK) at fulfillment.",
          "title": "Due In Days Calculation Method"
        },
        "requested_due_in_days": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The duration_days value requested at order creation, before applying the due_in_days_calculation_method at fulfillment.",
          "title": "Requested Due In Days"
        },
        "recourse_request_status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Status of recourse request if one exists (PENDING, APPROVED, REJECTED).",
          "title": "Recourse Request Status"
        }
      },
      "required": [
        "id"
      ],
      "title": "InvoiceDetailsSchema",
      "type": "object"
    },
    "InvoiceInsuranceDecisionEnum": {
      "enum": [
        "EULER_HERMES",
        "NO_INSURANCE"
      ],
      "title": "InvoiceInsuranceDecisionEnum",
      "type": "string"
    },
    "InvoiceStatusEnum": {
      "enum": [
        "PENDING",
        "ACTIVE",
        "REPLACED"
      ],
      "title": "InvoiceStatusEnum",
      "type": "string"
    },
    "InvoiceTypeEnum": {
      "description": "Enumeration for invoice type.",
      "enum": [
        "FUNDED_INVOICE",
        "DIRECT_INVOICE",
        "CARD"
      ],
      "title": "InvoiceTypeEnum",
      "type": "string"
    },
    "KidTypeEnum": {
      "enum": [
        "MOD_10",
        "MOD_11",
        "NONE"
      ],
      "title": "KidTypeEnum",
      "type": "string"
    },
    "LaxBuyerSchema": {
      "description": "A buyer schema that combines relaxed validation for both the nested company and\nrepresentative objects.",
      "properties": {
        "representative": {
          "anyOf": [
            {
              "$ref": "#/$defs/LaxRepresentativeSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Fields to capture who the order is for"
        },
        "company": {
          "$ref": "#/$defs/LaxCompanySchema",
          "description": "Fields to capture the details of the company for which the order is intended"
        }
      },
      "required": [
        "company"
      ],
      "title": "LaxBuyerSchema",
      "type": "object"
    },
    "LaxCompanySchema": {
      "description": "To be used where we don't need validation on the data being returned, such as for responses,\nor where the organization number has been validated upstream.\nEffectively disables the organization_number validator.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Internal company Id",
          "title": "Id"
        },
        "country_prefix": {
          "$ref": "#/$defs/CountryCodeEnum",
          "description": "Country code in ISO 3166-1 alpha-2 format"
        },
        "organization_number": {
          "description": "National id of the buyer company",
          "title": "Organization Number",
          "type": "string"
        },
        "company_name": {
          "default": null,
          "description": "Legal name of the buyer company",
          "maxLength": 255,
          "minLength": 1,
          "title": "Company Name",
          "type": "string"
        },
        "company_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Type of company placing the order",
          "title": "Company Type"
        },
        "company_canonical_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unique canonical ID representing this company",
          "title": "Company Canonical Id"
        },
        "website": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Company's website",
          "title": "Website"
        }
      },
      "required": [
        "country_prefix",
        "organization_number"
      ],
      "title": "LaxCompanySchema",
      "type": "object"
    },
    "LaxRepresentativeSchema": {
      "description": "Relaxes validation on the representative's phone number by accepting a plain string\ninstead of enforcing the strict `PhoneNumberType` validation.",
      "properties": {
        "first_name": {
          "description": "Representative first name",
          "title": "First Name",
          "type": "string"
        },
        "last_name": {
          "description": "Representative last name",
          "title": "Last Name",
          "type": "string"
        },
        "phone_number": {
          "description": "Representative phone number",
          "title": "Phone Number",
          "type": "string"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Representative email address",
          "title": "Email"
        }
      },
      "required": [
        "first_name",
        "last_name",
        "phone_number"
      ],
      "title": "LaxRepresentativeSchema",
      "type": "object"
    },
    "LineItemResponseSchema": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A globally unique ID set by Two.",
          "title": "Id"
        },
        "name": {
          "description": "short name of the product",
          "title": "Name",
          "type": "string"
        },
        "description": {
          "description": "Longer product description",
          "title": "Description",
          "type": "string"
        },
        "line_item_reference": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Your line item reference",
          "title": "Line Item Reference"
        },
        "discount_amount": {
          "default": "0.00",
          "description": "Discount applied to line item (defaults to 0.0), excluded tax",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Discount Amount",
          "type": "string"
        },
        "gross_amount": {
          "description": "net_amount + tax_amount",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Gross Amount",
          "type": "string"
        },
        "net_amount": {
          "description": "(quantity * unit_price) - discount_amount",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Net Amount",
          "type": "string"
        },
        "quantity": {
          "description": "Number of units for the specific line item (up to 8 decimal places)",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,8})?",
          "title": "Quantity",
          "type": "string"
        },
        "unit_price": {
          "description": "The price of one unit excluding tax and discount (up to 6 decimal places)",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,6})?",
          "title": "Unit Price",
          "type": "string"
        },
        "tax_amount": {
          "description": "net_amount * tax_rate",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Tax Amount",
          "type": "string"
        },
        "tax_rate": {
          "description": "Tax rate on the line item level",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,6})?",
          "title": "Tax Rate",
          "type": "string"
        },
        "tax_class_name": {
          "description": "A description of the tax class (e.g. 'VAT 20%')",
          "title": "Tax Class Name",
          "type": "string"
        },
        "tax_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Tax code from the tax registry (e.g. 'ES_IVA_STANDARD'). Reflects what was persisted.",
          "title": "Tax Code"
        },
        "tax_exemption_reason_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "EN 16931 / PEPPOL BT-121 exemption reason code (e.g. 'VATEX-EU-132'). Populated automatically from the tax_code when the underlying registry entry carries an exemption reason — merchants should not set this themselves.",
          "title": "Tax Exemption Reason Code"
        },
        "quantity_unit": {
          "description": "Unit like kg, l, pcs, etc.",
          "title": "Quantity Unit",
          "type": "string"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Link to the image of the product.",
          "title": "Image Url"
        },
        "product_page_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Link to the store product page.",
          "title": "Product Page Url"
        },
        "type": {
          "$ref": "#/$defs/LineItemTypeEnum",
          "description": "Product type."
        },
        "details": {
          "anyOf": [
            {
              "$ref": "#/$defs/ProductDetailsSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Meta-information and identifiers for the line item."
        },
        "prototype_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Prototype id",
          "title": "Prototype Id"
        },
        "vendor_name": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Vendor for line item",
          "title": "Vendor Name"
        },
        "merchant_child_order_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "In the case that the order created with Two is used to cover multiple orders on the merchant's side, this field could be referencing the merchant order that each line item originates from. This is analogous to how the merchant_order_id on the order itself can be used to map a Two order one-to-one with a merchant order. Depending on your configuration with Two, line items may be grouped by this value in the resulting invoice and the value may be rendered as a reference for each group of line items. In marketplace situations (multiple sub-vendors), this is typically combined with the vendor_name field on the line item, to indicate a vendor per child order.",
          "title": "Merchant Child Order Id"
        }
      },
      "required": [
        "name",
        "description",
        "gross_amount",
        "net_amount",
        "quantity",
        "unit_price",
        "tax_amount",
        "tax_rate",
        "tax_class_name",
        "quantity_unit",
        "type"
      ],
      "title": "LineItemResponseSchema",
      "type": "object"
    },
    "LineItemTypeEnum": {
      "enum": [
        "DIGITAL",
        "PHYSICAL",
        "SHIPPING_FEE",
        "GIFTCARD",
        "SERVICE",
        "BUYER_FEE",
        "OTHER"
      ],
      "title": "LineItemTypeEnum",
      "type": "string"
    },
    "OrderInstalmentTerms": {
      "description": "By setting these fields, a merchant can create an instalment order with the specified terms.",
      "properties": {
        "type": {
          "const": "INSTALMENTS",
          "default": "INSTALMENTS",
          "title": "Type",
          "type": "string"
        },
        "period": {
          "$ref": "#/$defs/TermsPeriod",
          "description": "The time between two instalments. QUARTERLY must be enabled for the merchant by Two; a quarterly order with 4 instalments is repaid over 12 months."
        },
        "number_of_instalments": {
          "description": "The number of instalments the order will be split into.",
          "exclusiveMinimum": 1,
          "title": "Number Of Instalments",
          "type": "integer"
        }
      },
      "required": [
        "period",
        "number_of_instalments"
      ],
      "title": "OrderInstalmentTerms",
      "type": "object"
    },
    "OrderLendingTermsSchema": {
      "properties": {
        "order_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Order Id"
        },
        "credit_line_id": {
          "format": "uuid",
          "title": "Credit Line Id",
          "type": "string"
        },
        "apr": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ],
          "title": "Apr"
        },
        "base_rate": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ],
          "title": "Base Rate"
        },
        "per_payment_rate_factor": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ],
          "title": "Per Payment Rate Factor"
        },
        "margin": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ],
          "title": "Margin"
        },
        "hedge_rate": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hedge Rate"
        }
      },
      "required": [
        "order_id",
        "credit_line_id",
        "apr",
        "base_rate",
        "per_payment_rate_factor",
        "margin",
        "hedge_rate"
      ],
      "title": "OrderLendingTermsSchema",
      "type": "object"
    },
    "OrderMerchantCallbackAuthSchema": {
      "properties": {
        "auth_type": {
          "$ref": "#/$defs/CallbackAuthTypeEnum"
        },
        "value": {
          "title": "Value",
          "type": "string"
        }
      },
      "required": [
        "auth_type",
        "value"
      ],
      "title": "OrderMerchantCallbackAuthSchema",
      "type": "object"
    },
    "OrderMerchantUrlsSchema": {
      "properties": {
        "merchant_confirmation_url": {
          "description": "URL to which you want to redirect your users upon successful order verification.",
          "title": "Merchant Confirmation Url",
          "type": "string"
        },
        "merchant_cancel_order_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL to which you want to redirect your users when they cancel an order.",
          "title": "Merchant Cancel Order Url"
        },
        "merchant_edit_order_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merchant Edit Order Url"
        },
        "merchant_order_verification_pending_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merchant Order Verification Pending Url"
        },
        "merchant_order_verification_failed_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merchant Order Verification Failed Url"
        },
        "merchant_invoice_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merchant Invoice Url"
        },
        "merchant_shipping_document_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merchant Shipping Document Url"
        },
        "merchant_document_urls": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merchant Document Urls"
        },
        "merchant_order_verified_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merchant Order Verified Url"
        },
        "merchant_order_callback_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merchant Order Callback Url"
        },
        "merchant_order_callback_auth": {
          "anyOf": [
            {
              "$ref": "#/$defs/OrderMerchantCallbackAuthSchema"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "merchant_confirmation_url"
      ],
      "title": "OrderMerchantUrlsSchema",
      "type": "object"
    },
    "OrderNetTerms": {
      "description": "By setting these fields, a merchant can create an net terms order with specified terms.",
      "properties": {
        "type": {
          "const": "NET_TERMS",
          "default": "NET_TERMS",
          "title": "Type",
          "type": "string"
        },
        "duration_days": {
          "exclusiveMinimum": 0,
          "title": "Duration Days",
          "type": "integer"
        },
        "duration_days_calculated_from": {
          "anyOf": [
            {
              "$ref": "#/$defs/DueDateCalculationScheme"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional scheme for calculating the invoice due date. When set, modifies how due_in_days is calculated from the fulfillment date:\n- END_OF_MONTH: (days to end of month) + duration_days\n- END_OF_WEEK: (days to end of week, Sunday) + duration_days\nNote: Cannot be used with billing_account_id. Only specific duration_days values are allowed per scheme (typically 30, 45, 60)."
        }
      },
      "required": [
        "duration_days"
      ],
      "title": "OrderNetTerms",
      "type": "object"
    },
    "OrderOriginationEnum": {
      "enum": [
        "ONLINE",
        "IN_STORE"
      ],
      "title": "OrderOriginationEnum",
      "type": "string"
    },
    "OrderStateEnum": {
      "enum": [
        "UNVERIFIED",
        "VERIFIED",
        "CONFIRMED",
        "FULFILLING",
        "FULFILLED",
        "DELIVERED",
        "CANCELLED",
        "REFUNDED",
        "FULFILMENT_NEEDS_MANUAL_RESOLUTION"
      ],
      "title": "OrderStateEnum",
      "type": "string"
    },
    "OrderStatusEnum": {
      "enum": [
        "UNINITIATED",
        "APPROVED",
        "DECLINED",
        "REJECTED",
        "PARTIAL"
      ],
      "title": "OrderStatusEnum",
      "type": "string"
    },
    "OrderTypeEnum": {
      "enum": [
        "BUYER_INITIATED",
        "MERCHANT_INITIATED"
      ],
      "title": "OrderTypeEnum",
      "type": "string"
    },
    "PaymentStatusEnum": {
      "enum": [
        "NOT_PAID",
        "PAID",
        "PARTIAL_PAYMENT",
        "OVERDUE",
        "IN_COLLECTIONS",
        "CANCELLED",
        "REFUNDED",
        "PARTIAL_REFUND",
        "RECOURSED",
        "PARTIAL_RECOURSE"
      ],
      "title": "PaymentStatusEnum",
      "type": "string"
    },
    "PeriodEnum": {
      "enum": [
        "weekly",
        "biweekly",
        "monthly",
        "bimonthly",
        "quarterly",
        "yearly"
      ],
      "title": "PeriodEnum",
      "type": "string"
    },
    "ProductDetailsSchema": {
      "properties": {
        "brand": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The brand name of the item. E.g. \"Heinz\".",
          "title": "Brand"
        },
        "categories": {
          "description": "Array of one or more product categories. E.g. [\"Studio monitors\", \"Music equipment\"]",
          "items": {
            "type": "string"
          },
          "title": "Categories",
          "type": "array"
        },
        "barcodes": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/BarCodeSchema"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Array with Barcode objects for storing SKU, EAN, etc.",
          "title": "Barcodes"
        },
        "part_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The manufacturer's part number",
          "title": "Part Number"
        }
      },
      "required": [
        "categories"
      ],
      "title": "ProductDetailsSchema",
      "type": "object"
    },
    "RecurringDetailsSchema": {
      "properties": {
        "token": {
          "title": "Token",
          "type": "string"
        },
        "description": {
          "title": "Description",
          "type": "string"
        },
        "period": {
          "$ref": "#/$defs/PeriodEnum"
        }
      },
      "required": [
        "token",
        "description",
        "period"
      ],
      "title": "RecurringDetailsSchema",
      "type": "object"
    },
    "ShippingDetailsSchema": {
      "properties": {
        "tracking_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Tracking Number"
        },
        "carrier_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Carrier Name"
        },
        "carrier_tracking_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Carrier Tracking Url"
        },
        "expected_delivery_date": {
          "anyOf": [
            {
              "format": "date",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Expected Delivery Date"
        },
        "address_co": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Address Co"
        },
        "address_reference": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Address Reference"
        },
        "address_attn": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Address Attn"
        },
        "delivery_method": {
          "anyOf": [
            {
              "$ref": "#/$defs/DeliveryMethodEnum"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "id_required_on_delivery": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id Required On Delivery"
        }
      },
      "title": "ShippingDetailsSchema",
      "type": "object"
    },
    "TaxSubtotalSchema": {
      "properties": {
        "tax_amount": {
          "description": "taxable_amount * tax rate",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Tax Amount",
          "type": "string"
        },
        "taxable_amount": {
          "description": "sum(net_amount), per tax rate",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,2})?",
          "title": "Taxable Amount",
          "type": "string"
        },
        "tax_rate": {
          "description": "Must be between 0 and 1 inclusive",
          "format": "decimal",
          "pattern": "^-?[0-9]+(\\.[0-9]{0,6})?",
          "title": "Tax Rate",
          "type": "string"
        }
      },
      "required": [
        "tax_amount",
        "taxable_amount",
        "tax_rate"
      ],
      "title": "TaxSubtotalSchema",
      "type": "object"
    },
    "TermsPeriod": {
      "enum": [
        "MONTHLY",
        "QUARTERLY"
      ],
      "title": "TermsPeriod",
      "type": "string"
    }
  }
}