{
  "openapi": "3.1.0",
  "info": {
    "title": "TRAK connector operations for Xero Accounting",
    "version": "1.0.0",
    "description": "Outbound operations used by TRAK. The provider hosts these endpoints. Field lists describe the portion used by the connector."
  },
  "servers": [
    {
      "url": "https://api.xero.com/api.xro/2.0"
    }
  ],
  "security": [
    {
      "bearer": [],
      "xeroOrg": []
    }
  ],
  "paths": {
    "/Organisation": {
      "get": {
        "summary": "Read Organisation",
        "description": "Read the selected organisation and currency to check the connection.",
        "responses": {
          "2XX": {
            "description": "Check the returned Organisations records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Organisations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "OrganisationID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "Name": {
                            "type": "string"
                          },
                          "BaseCurrency": {
                            "type": "string"
                          },
                          "IsDemoCompany": {
                            "type": "boolean",
                            "description": "Identifies a Xero Demo Company."
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Organisations"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_organisation"
      }
    },
    "/Contacts": {
      "get": {
        "summary": "Read Contacts",
        "description": "Look up a contact by name or page. Use its ContactID for matching.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "TRAK requests 100 rows.",
            "schema": {
              "type": "integer",
              "enum": [
                100
              ]
            }
          },
          {
            "name": "searchTerm",
            "in": "query",
            "description": "Optional contact search text, up to 100 characters in TRAK.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Contacts records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Contacts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ContactID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "Name": {
                            "type": "string"
                          },
                          "ContactStatus": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Contacts"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_contacts"
      }
    },
    "/Accounts": {
      "get": {
        "summary": "Read Accounts",
        "description": "Read available account codes and payment-account eligibility.",
        "parameters": [
          {
            "name": "where",
            "in": "query",
            "description": "Provider expression specific to this operation.",
            "schema": {
              "type": "string"
            },
            "example": "Code==\"400\""
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Accounts records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "AccountID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "Name": {
                            "type": "string"
                          },
                          "Code": {
                            "type": "string"
                          },
                          "Type": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "CurrencyCode": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Accounts"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_accounts"
      }
    },
    "/TaxRates": {
      "get": {
        "summary": "Read TaxRates",
        "description": "Read available tax types for defaults and line mappings.",
        "responses": {
          "2XX": {
            "description": "Check the returned TaxRates records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "TaxRates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "Name": {
                            "type": "string"
                          },
                          "TaxType": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "EffectiveRate": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "TaxRates"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_taxrates"
      }
    },
    "/TrackingCategories": {
      "get": {
        "summary": "Read TrackingCategories",
        "description": "Read categories and options for tracking.",
        "responses": {
          "2XX": {
            "description": "Check the returned TrackingCategories records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "TrackingCategories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "TrackingCategoryID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "Name": {
                            "type": "string"
                          },
                          "Options": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "TrackingOptionID": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "Name": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "TrackingCategories"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_trackingcategories"
      }
    },
    "/Invoices": {
      "get": {
        "summary": "Read Invoices",
        "description": "Read a sample or locate a synced receivable or supplier bill. For supplier bills TRAK checks the number, contact and ACCPAY type.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "TRAK requests 100 rows.",
            "schema": {
              "type": "integer",
              "enum": [
                100
              ]
            }
          },
          {
            "name": "InvoiceNumbers",
            "in": "query",
            "description": "Expected invoice number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ContactIDs",
            "in": "query",
            "description": "Supplier contact ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "where",
            "in": "query",
            "description": "Provider expression specific to this operation.",
            "schema": {
              "type": "string"
            },
            "example": "Type==\"ACCPAY\""
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Invoices records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Invoices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "InvoiceID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "Type": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "InvoiceNumber": {
                            "type": "string"
                          },
                          "Reference": {
                            "type": "string"
                          },
                          "CurrencyCode": {
                            "type": "string"
                          },
                          "Total": {
                            "type": "number"
                          },
                          "AmountDue": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Invoices"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_invoices"
      },
      "post": {
        "summary": "Create a draft sales invoice",
        "description": "Send an issued TRAK invoice or approved project package with the matched contact and lines (Type ACCREC).",
        "parameters": [
          {
            "name": "unitdp",
            "in": "query",
            "description": "Four decimal places for unit amounts.",
            "schema": {
              "type": "integer",
              "enum": [
                4
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Stable key for the same authorized write.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Invoices records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Invoices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "InvoiceID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "Type": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "InvoiceNumber": {
                            "type": "string"
                          },
                          "Reference": {
                            "type": "string"
                          },
                          "CurrencyCode": {
                            "type": "string"
                          },
                          "Total": {
                            "type": "number"
                          },
                          "AmountDue": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Invoices"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicesBody"
              }
            }
          }
        },
        "operationId": "post_invoices"
      },
      "put": {
        "summary": "Create a draft supplier bill",
        "description": "Use Type ACCPAY, supplier contact, invoice number, due date and approved lines.",
        "parameters": [
          {
            "name": "unitdp",
            "in": "query",
            "description": "Four decimal places for unit amounts.",
            "schema": {
              "type": "integer",
              "enum": [
                4
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Stable key for the same authorized write.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Invoices records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Invoices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "InvoiceID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "Type": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "InvoiceNumber": {
                            "type": "string"
                          },
                          "Reference": {
                            "type": "string"
                          },
                          "CurrencyCode": {
                            "type": "string"
                          },
                          "Total": {
                            "type": "number"
                          },
                          "AmountDue": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Invoices"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoicesBody"
              }
            }
          }
        },
        "operationId": "put_invoices"
      }
    },
    "/Quotes": {
      "get": {
        "summary": "Read Quotes",
        "description": "Find an existing quote by its quote number.",
        "parameters": [
          {
            "name": "QuoteNumber",
            "in": "query",
            "description": "TRAK document number.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Quotes records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Quotes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "QuoteID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "QuoteNumber": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "CurrencyCode": {
                            "type": "string"
                          },
                          "Reference": {
                            "type": "string"
                          },
                          "Total": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Quotes"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_quotes"
      },
      "post": {
        "summary": "Create a draft quote",
        "description": "Send the customer quote document number, expiry, terms and line items.",
        "parameters": [
          {
            "name": "unitdp",
            "in": "query",
            "description": "Four decimal places for unit amounts.",
            "schema": {
              "type": "integer",
              "enum": [
                4
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Stable key for the same authorized write.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Quotes records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Quotes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "QuoteID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "QuoteNumber": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "CurrencyCode": {
                            "type": "string"
                          },
                          "Reference": {
                            "type": "string"
                          },
                          "Total": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Quotes"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotesBody"
              }
            }
          }
        },
        "operationId": "post_quotes"
      }
    },
    "/Payments": {
      "get": {
        "summary": "Read Payments",
        "description": "Find a prior receipt by its exact Reference before writing it.",
        "parameters": [
          {
            "name": "where",
            "in": "query",
            "description": "Provider expression specific to this operation.",
            "schema": {
              "type": "string"
            },
            "example": "Reference==\"Example receipt 1042\""
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Payments records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Payments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "PaymentID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "Reference": {
                            "type": "string"
                          },
                          "Amount": {
                            "type": "number"
                          },
                          "Invoice": {
                            "type": "object",
                            "properties": {
                              "InvoiceID": {
                                "type": "string",
                                "format": "uuid"
                              }
                            }
                          },
                          "Account": {
                            "type": "object",
                            "properties": {
                              "AccountID": {
                                "type": "string",
                                "format": "uuid"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Payments"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_payments"
      },
      "put": {
        "summary": "Publish a customer receipt",
        "description": "Link the Xero invoice and eligible payment account. Send the date, amount and stable receipt reference.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Stable key for the same authorized write.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Payments records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Payments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "PaymentID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "Reference": {
                            "type": "string"
                          },
                          "Amount": {
                            "type": "number"
                          },
                          "Invoice": {
                            "type": "object",
                            "properties": {
                              "InvoiceID": {
                                "type": "string",
                                "format": "uuid"
                              }
                            }
                          },
                          "Account": {
                            "type": "object",
                            "properties": {
                              "AccountID": {
                                "type": "string",
                                "format": "uuid"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Payments"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsBody"
              }
            }
          }
        },
        "operationId": "put_payments"
      }
    },
    "/PurchaseOrders": {
      "get": {
        "summary": "Read PurchaseOrders",
        "description": "Check existing POs in the draft date window and reconcile matching records.",
        "parameters": [
          {
            "name": "DateFrom",
            "in": "query",
            "description": "First document date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "DateTo",
            "in": "query",
            "description": "Last document date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number, starting at 1.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "TRAK requests 100 rows.",
            "schema": {
              "type": "integer",
              "enum": [
                100
              ]
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned PurchaseOrders records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "PurchaseOrders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "PurchaseOrderID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "PurchaseOrderNumber": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "PurchaseOrders"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_purchaseorders"
      },
      "put": {
        "summary": "Create a draft purchase order",
        "description": "Use the matched supplier, purchase-order number, document date and inventory lines.",
        "parameters": [
          {
            "name": "unitdp",
            "in": "query",
            "description": "Four decimal places for unit amounts.",
            "schema": {
              "type": "integer",
              "enum": [
                4
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Stable key for the same authorized write.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned PurchaseOrders records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "PurchaseOrders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "PurchaseOrderID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "PurchaseOrderNumber": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "PurchaseOrders"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrdersBody"
              }
            }
          }
        },
        "operationId": "put_purchaseorders"
      }
    },
    "/Invoices/{invoiceID}": {
      "get": {
        "summary": "Read linked Invoices",
        "description": "Retrieve the existing document by its stored or reconciled Xero identifier.",
        "parameters": [
          {
            "name": "invoiceID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Invoices records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Invoices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "InvoiceID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "Type": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "InvoiceNumber": {
                            "type": "string"
                          },
                          "Reference": {
                            "type": "string"
                          },
                          "CurrencyCode": {
                            "type": "string"
                          },
                          "Total": {
                            "type": "number"
                          },
                          "AmountDue": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Invoices"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_invoices_invoiceid"
      }
    },
    "/Quotes/{quoteID}": {
      "get": {
        "summary": "Read linked Quotes",
        "description": "Retrieve the existing document by its stored or reconciled Xero identifier.",
        "parameters": [
          {
            "name": "quoteID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Quotes records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Quotes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "QuoteID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "QuoteNumber": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          },
                          "CurrencyCode": {
                            "type": "string"
                          },
                          "Reference": {
                            "type": "string"
                          },
                          "Total": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Quotes"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_quotes_quoteid"
      }
    },
    "/PurchaseOrders/{purchaseOrderID}": {
      "get": {
        "summary": "Read linked PurchaseOrders",
        "description": "Retrieve the existing document by its stored or reconciled Xero identifier.",
        "parameters": [
          {
            "name": "purchaseOrderID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned PurchaseOrders records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "PurchaseOrders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "PurchaseOrderID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "PurchaseOrderNumber": {
                            "type": "string"
                          },
                          "Status": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "PurchaseOrders"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "operationId": "get_purchaseorders_purchaseorderid"
      }
    },
    "/Invoices/{invoiceID}/Attachments/{fileName}": {
      "post": {
        "summary": "Attach an approved evidence pack",
        "description": "Upload the ZIP bytes against the linked invoice. The connector sets IncludeOnline=false.",
        "parameters": [
          {
            "name": "invoiceID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "fileName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IncludeOnline",
            "in": "query",
            "description": "Keep the evidence off the online invoice.",
            "schema": {
              "type": "boolean",
              "enum": [
                false
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Stable key for the same authorized write.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "2XX": {
            "description": "Check the returned Attachments records. For writes, TRAK checks the resulting document, payment or attachment before linking it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Attachments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "AttachmentID": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "FileName": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "Attachments"
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Provider error. Check authorization, resource access and the response before retrying."
          },
          "429": {
            "description": "Xero rate limit reached. Reconcile and retry the same document after the provider permits another request."
          },
          "400": {
            "description": "Xero rejected the supplied document, selector or data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "Detail": {
                      "type": "string"
                    },
                    "Elements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ValidationErrors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "Message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "The Xero access token is invalid or expired. Reconnect the organisation if refresh fails."
          },
          "403": {
            "description": "The connected app or user lacks the required organisation or resource permissions."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/zip": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "operationId": "post_invoices_invoiceid_attachments_filename"
      }
    },
    "/connections": {
      "get": {
        "operationId": "get_xero_connections",
        "summary": "Discover authorised Xero organisations",
        "description": "After exchanging the authorisation code, TRAK reads this top-level array, skips rows without tenantId and asks the user to choose when several organisations are available. One result is selected automatically.",
        "servers": [
          {
            "url": "https://api.xero.com"
          }
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current organisation connections accessible using this bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "tenantId"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Connection ID."
                      },
                      "tenantId": {
                        "type": "string",
                        "format": "uuid",
                        "description": "Xero organisation identifier selected for subsequent accounting requests."
                      },
                      "tenantName": {
                        "type": "string",
                        "description": "Organisation name displayed for selection."
                      },
                      "tenantType": {
                        "type": "string",
                        "description": "Xero tenant type."
                      },
                      "createdDateUtc": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedDateUtc": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "id": "11111111-1111-4111-8111-111111111111",
                    "tenantId": "22222222-2222-4222-8222-222222222222",
                    "tenantName": "Example Services",
                    "tenantType": "ORGANISATION",
                    "createdDateUtc": "2026-11-20T03:00:00Z",
                    "updatedDateUtc": "2026-11-20T03:00:00Z"
                  }
                ]
              }
            }
          },
          "401": {
            "description": "The OAuth access token was rejected."
          },
          "429": {
            "description": "The provider rate limit was reached."
          },
          "default": {
            "description": "Organisation discovery failed. Restart the connection if authorisation has expired."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "xeroOrg": {
        "type": "apiKey",
        "in": "header",
        "name": "xero-tenant-id"
      }
    },
    "schemas": {
      "Contact": {
        "type": "object",
        "properties": {
          "ContactID": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "AccountID": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "LineItem": {
        "type": "object",
        "properties": {
          "Description": {
            "type": "string"
          },
          "Quantity": {
            "type": "number"
          },
          "UnitAmount": {
            "type": "number"
          },
          "TaxAmount": {
            "type": "number"
          },
          "AccountCode": {
            "type": "string"
          },
          "TaxType": {
            "type": "string"
          },
          "DiscountRate": {
            "type": "number"
          }
        },
        "required": [
          "Description",
          "Quantity",
          "UnitAmount",
          "AccountCode",
          "TaxType"
        ]
      },
      "InvoicesBody": {
        "type": "object",
        "properties": {
          "Invoices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "Status": {
                  "type": "string",
                  "enum": [
                    "DRAFT"
                  ]
                },
                "Contact": {
                  "$ref": "#/components/schemas/Contact"
                },
                "Date": {
                  "type": "string",
                  "format": "date"
                },
                "LineItems": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LineItem"
                  }
                },
                "LineAmountTypes": {
                  "type": "string"
                },
                "CurrencyCode": {
                  "type": "string"
                },
                "Type": {
                  "type": "string",
                  "enum": [
                    "ACCREC",
                    "ACCPAY"
                  ]
                },
                "InvoiceNumber": {
                  "type": "string"
                },
                "DueDate": {
                  "type": "string",
                  "format": "date"
                },
                "Reference": {
                  "type": "string"
                }
              },
              "required": [
                "Status",
                "Contact",
                "Date",
                "LineItems"
              ]
            }
          }
        },
        "required": [
          "Invoices"
        ]
      },
      "QuotesBody": {
        "type": "object",
        "properties": {
          "Quotes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "Status": {
                  "type": "string",
                  "enum": [
                    "DRAFT"
                  ]
                },
                "Contact": {
                  "$ref": "#/components/schemas/Contact"
                },
                "Date": {
                  "type": "string",
                  "format": "date"
                },
                "LineItems": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LineItem"
                  }
                },
                "LineAmountTypes": {
                  "type": "string"
                },
                "CurrencyCode": {
                  "type": "string"
                },
                "QuoteNumber": {
                  "type": "string"
                },
                "Reference": {
                  "type": "string"
                },
                "Terms": {
                  "type": "string"
                },
                "ExpiryDate": {
                  "type": "string",
                  "format": "date"
                }
              },
              "required": [
                "Status",
                "Contact",
                "Date",
                "LineItems"
              ]
            }
          }
        },
        "required": [
          "Quotes"
        ]
      },
      "PurchaseOrdersBody": {
        "type": "object",
        "properties": {
          "PurchaseOrders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "Status": {
                  "type": "string",
                  "enum": [
                    "DRAFT"
                  ]
                },
                "Contact": {
                  "$ref": "#/components/schemas/Contact"
                },
                "Date": {
                  "type": "string",
                  "format": "date"
                },
                "LineItems": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LineItem"
                  }
                },
                "LineAmountTypes": {
                  "type": "string"
                },
                "CurrencyCode": {
                  "type": "string"
                },
                "PurchaseOrderNumber": {
                  "type": "string"
                }
              },
              "required": [
                "Status",
                "Contact",
                "Date",
                "LineItems"
              ]
            }
          }
        },
        "required": [
          "PurchaseOrders"
        ]
      },
      "PaymentsBody": {
        "type": "object",
        "properties": {
          "Payments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "Invoice": {
                  "type": "object",
                  "properties": {
                    "InvoiceID": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "Account": {
                  "$ref": "#/components/schemas/Account"
                },
                "Date": {
                  "type": "string",
                  "format": "date"
                },
                "Amount": {
                  "type": "number"
                },
                "Reference": {
                  "type": "string"
                }
              },
              "required": [
                "Invoice",
                "Account",
                "Date",
                "Amount",
                "Reference"
              ]
            }
          }
        },
        "required": [
          "Payments"
        ]
      }
    }
  }
}
