From 6ac99860aee9acc0eff1f10372d97452c25214fb Mon Sep 17 00:00:00 2001 From: SidneyAllen Date: Tue, 20 Nov 2018 14:55:29 -0800 Subject: [PATCH] Updates to Accounting, Assets and addition of BankFeeds Add terms of service and contact Improve numeric data types. Add the format for numbers that are floats Use of integer instead of number where appropriate. Add descriptions for Assets and AssetTypes Update any numeric data types --- README.md | 1 - spec/v3/Xero_accounting_2.0.0_swagger.json | 102 ++- spec/v3/Xero_accounting_2.0.0_swagger.yaml | 75 +- spec/v3/Xero_assets_1.0.0_swagger.json | 166 +++-- spec/v3/Xero_assets_1.0.0_swagger.yaml | 165 ++-- spec/v3/Xero_bankfeeds_1.0.0_swagger.json | 828 +++++++++++++++++++++ spec/v3/Xero_bankfeeds_1.0.0_swagger.yaml | 690 +++++++++++++++++ 7 files changed, 1827 insertions(+), 200 deletions(-) create mode 100644 spec/v3/Xero_bankfeeds_1.0.0_swagger.json create mode 100644 spec/v3/Xero_bankfeeds_1.0.0_swagger.yaml diff --git a/README.md b/README.md index bf5e23eb9..2c7fc92eb 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ OpenAPI spec 3.0 * [Fixed Assets API - yaml](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_assets_1.0.0_swagger.yaml) * [Fixed Assets API - json](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_assets_1.0.0_swagger.json) - OpenAPI spec 2.0 (Swagger) * [Accounting API - yaml](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v2/accounting2.yaml) * [Accounting API - json](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v2/accounting2.json) diff --git a/spec/v3/Xero_accounting_2.0.0_swagger.json b/spec/v3/Xero_accounting_2.0.0_swagger.json index 3bba62767..f101d07a9 100644 --- a/spec/v3/Xero_accounting_2.0.0_swagger.json +++ b/spec/v3/Xero_accounting_2.0.0_swagger.json @@ -5,7 +5,13 @@ } ], "info" : { "title" : "Accounting API", - "version" : "2.0.0" + "version" : "2.0.0", + "termsOfService" : "https://developer.xero.com/xero-developer-platform-terms-conditions/", + "contact" : { + "name" : "Xero Platform Team", + "email" : "api@xero.com", + "url" : "https://developer.xero.com" + } }, "paths" : { "/Accounts" : { @@ -685,7 +691,7 @@ "name" : "page", "description" : "e.g. page=1 – Up to 100 bank transactions will be returned in a single API call with line items shown for each bank transaction", "schema" : { - "type" : "number" + "type" : "integer" } } ] }, @@ -1854,7 +1860,7 @@ "name" : "page", "description" : "e.g. page=1 - Up to 100 contacts will be returned in a single API call.", "schema" : { - "type" : "number" + "type" : "integer" } }, { "in" : "query", @@ -2678,7 +2684,7 @@ "name" : "page", "description" : "e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note", "schema" : { - "type" : "number" + "type" : "integer" } } ] }, @@ -3798,7 +3804,7 @@ "name" : "page", "description" : "e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice", "schema" : { - "type" : "number" + "type" : "integer" } }, { "in" : "query", @@ -4738,7 +4744,7 @@ "in" : "query", "name" : "offset", "schema" : { - "type" : "number" + "type" : "integer" } }, { "in" : "query", @@ -4811,7 +4817,7 @@ "name" : "page", "description" : "Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1.", "schema" : { - "type" : "number" + "type" : "integer" } }, { "in" : "query", @@ -5040,7 +5046,7 @@ "name" : "page", "description" : "e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment", "schema" : { - "type" : "number" + "type" : "integer" } } ] }, @@ -5547,7 +5553,7 @@ "name" : "page", "description" : "e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment", "schema" : { - "type" : "number" + "type" : "integer" } } ] } @@ -6056,7 +6062,7 @@ "name" : "page", "description" : "e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment", "schema" : { - "type" : "number" + "type" : "integer" } } ] }, @@ -6239,7 +6245,7 @@ "name" : "page", "description" : "To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned.", "schema" : { - "type" : "number" + "type" : "integer" } } ] }, @@ -7561,14 +7567,14 @@ "in" : "query", "name" : "periods", "schema" : { - "type" : "number" + "type" : "integer" } }, { "in" : "query", "name" : "timeframe", "description" : "The period size to compare to (1=month, 3=quarter, 12=year)", "schema" : { - "type" : "number" + "type" : "integer" } }, { "in" : "query", @@ -7632,14 +7638,14 @@ "name" : "period", "description" : "The number of periods to compare (integer between 1 and 12)", "schema" : { - "type" : "number" + "type" : "integer" } }, { "in" : "query", "name" : "timeframe", "description" : "The period size to compare to (1=month, 3=quarter, 12=year)", "schema" : { - "type" : "number" + "type" : "integer" } } ] } @@ -7775,14 +7781,15 @@ "name" : "periods", "description" : "The number of periods to compare (integer between 1 and 12)", "schema" : { - "type" : "number" + "type" : "integer" } }, { "in" : "query", "name" : "timeframe", "description" : "The period size to compare to (1=month, 3=quarter, 12=year)", "schema" : { - "type" : "number" + "type" : "string", + "enum" : [ "MONTH", "QUARTER", "YEAR" ] } }, { "in" : "query", @@ -8643,7 +8650,8 @@ }, "CurrencyRate" : { "description" : "Exchange rate to base currency when money is spent or received. e.g. 0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments.", - "type" : "number" + "type" : "number", + "format" : "float" }, "Url" : { "description" : "URL link to a source document – shown as “Go to App Name”", @@ -8660,15 +8668,18 @@ }, "SubTotal" : { "description" : "Total of bank transaction excluding taxes", - "type" : "number" + "type" : "number", + "format" : "float" }, "TotalTax" : { "description" : "Total tax on bank transaction", - "type" : "number" + "type" : "number", + "format" : "float" }, "Total" : { "description" : "Total of bank transaction tax inclusive", - "type" : "number" + "type" : "number", + "format" : "float" }, "BankTransactionID" : { "description" : "Xero generated unique identifier for bank transaction", @@ -8718,11 +8729,13 @@ }, "Quantity" : { "description" : "LineItem Quantity", - "type" : "string" + "type" : "number", + "format" : "float" }, "UnitAmount" : { "description" : "LineItem Unit Amount", - "type" : "number" + "type" : "number", + "format" : "float" }, "ItemCode" : { "description" : "See Items", @@ -8738,11 +8751,13 @@ }, "TaxAmount" : { "description" : "The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct.", - "type" : "number" + "type" : "number", + "format" : "float" }, "LineAmount" : { "description" : "If you wish to omit either of the or you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100)", - "type" : "number" + "type" : "number", + "format" : "float" }, "Tracking" : { "description" : "Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 elements.", @@ -8926,7 +8941,8 @@ }, "Amount" : { "description" : "The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00", - "type" : "number" + "type" : "number", + "format" : "float" }, "Payments" : { "type" : "array", @@ -8989,8 +9005,7 @@ }, "SortOrder" : { "description" : "Integer – ranked order of branding theme. The default branding theme has a value of 0", - "type" : "number", - "format" : "double" + "type" : "integer" }, "CreatedDateUTC" : { "description" : "UTC timestamp of creation date of branding theme", @@ -9301,7 +9316,7 @@ }, "Rate" : { "description" : "CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned", - "type" : "number" + "type" : "integer" } } }, @@ -9534,7 +9549,8 @@ }, "Amount" : { "description" : "the amount being applied to the invoice", - "type" : "number" + "type" : "number", + "format" : "float" }, "Date" : { "description" : "the date the prepayment is applied YYYY-MM-DD (read-only). This will be the latter of the invoice date and the prepayment date.", @@ -10058,7 +10074,8 @@ "properties" : { "UnitPrice" : { "description" : "Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request.", - "type" : "number" + "type" : "number", + "format" : "float" }, "AccountCode" : { "description" : "Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items", @@ -10684,11 +10701,13 @@ }, "CurrencyRate" : { "description" : "Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500", - "type" : "number" + "type" : "number", + "format" : "float" }, "Amount" : { "description" : "The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00", - "type" : "number" + "type" : "number", + "format" : "float" }, "Reference" : { "description" : "An optional description for the payment e.g. Direct Debit", @@ -11449,8 +11468,7 @@ "properties" : { "Period" : { "description" : "Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months)", - "type" : "number", - "format" : "double" + "type" : "integer" }, "Unit" : { "description" : "One of the following : WEEKLY or MONTHLY", @@ -11458,8 +11476,7 @@ }, "DueDate" : { "description" : "Integer used with due date type e.g 20 (of following month), 31 (of current month)", - "type" : "number", - "format" : "double" + "type" : "integer" }, "DueDateType" : { "allOf" : [ { @@ -11556,12 +11573,14 @@ "DisplayTaxRate" : { "description" : "Tax Rate (decimal to 4dp) e.g 12.5000", "readOnly" : true, - "type" : "number" + "type" : "number", + "format" : "float" }, "EffectiveRate" : { "description" : "Effective Tax Rate (decimal to 4dp) e.g 12.5000", "readOnly" : true, - "type" : "number" + "type" : "number", + "format" : "float" } }, "required" : [ "ReportTaxType" ], @@ -11578,7 +11597,8 @@ }, "Rate" : { "description" : "Tax Rate (up to 4dp)", - "type" : "number" + "type" : "number", + "format" : "float" }, "IsCompound" : { "description" : "Boolean to describe if Tax rate is compounded.", @@ -11724,7 +11744,7 @@ "properties" : { "ErrorNumber" : { "description" : "Exception number", - "type" : "number" + "type" : "integer" }, "Type" : { "description" : "Exception type", diff --git a/spec/v3/Xero_accounting_2.0.0_swagger.yaml b/spec/v3/Xero_accounting_2.0.0_swagger.yaml index 5fe495148..b3e68f92d 100644 --- a/spec/v3/Xero_accounting_2.0.0_swagger.yaml +++ b/spec/v3/Xero_accounting_2.0.0_swagger.yaml @@ -4,6 +4,11 @@ servers: info: title: Accounting API version: "2.0.0" + termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/" + contact: + name: "Xero Platform Team" + email: "api@xero.com" + url: "https://developer.xero.com" paths: /Accounts: get: @@ -484,7 +489,7 @@ paths: name: page description: e.g. page=1 – Up to 100 bank transactions will be returned in a single API call with line items shown for each bank transaction schema: - type: number + type: integer put: tags: - Accounting @@ -1299,7 +1304,7 @@ paths: name: page description: e.g. page=1 - Up to 100 contacts will be returned in a single API call. schema: - type: number + type: integer - in: query name: includeArchived description: e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response @@ -1876,7 +1881,7 @@ paths: name: page description: e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note schema: - type: number + type: integer put: tags: - Accounting @@ -2660,7 +2665,7 @@ paths: name: page description: e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice schema: - type: number + type: integer - in: query name: includeArchived description: e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response @@ -3317,7 +3322,7 @@ paths: - in: query name: offset schema: - type: number + type: integer - in: query name: paymentsOnly schema: @@ -3368,7 +3373,7 @@ paths: name: page description: Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. schema: - type: number + type: integer - in: query name: LinkedTransactionID description: The Xero identifier for an Linked Transaction @@ -3529,7 +3534,7 @@ paths: name: page description: e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment schema: - type: number + type: integer put: tags: - Accounting @@ -3884,7 +3889,7 @@ paths: name: page description: e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment schema: - type: number + type: integer '/Overpayments/{OverpaymentID}': x-related-model: Overpayment get: @@ -4238,7 +4243,7 @@ paths: name: page description: e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment schema: - type: number + type: integer put: tags: - Accounting @@ -4366,7 +4371,7 @@ paths: name: page description: To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. schema: - type: number + type: integer put: tags: - Accounting @@ -5287,12 +5292,12 @@ paths: - in: query name: periods schema: - type: number + type: integer - in: query name: timeframe description: The period size to compare to (1=month, 3=quarter, 12=year) schema: - type: number + type: integer - in: query name: trackingOptionID1 schema: @@ -5336,12 +5341,12 @@ paths: name: period description: The number of periods to compare (integer between 1 and 12) schema: - type: number + type: integer - in: query name: timeframe description: The period size to compare to (1=month, 3=quarter, 12=year) schema: - type: number + type: integer '/Reports': x-related-model: Report get: @@ -5435,12 +5440,16 @@ paths: name: periods description: The number of periods to compare (integer between 1 and 12) schema: - type: number + type: integer - in: query name: timeframe description: The period size to compare to (1=month, 3=quarter, 12=year) schema: - type: number + type: string + enum: + - MONTH + - QUARTER + - YEAR - in: query name: trackingCategoryID schema: @@ -6124,6 +6133,7 @@ components: user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. type: number + format: float Url: description: URL link to a source document – shown as “Go to App Name” type: string @@ -6141,15 +6151,15 @@ components: SubTotal: description: Total of bank transaction excluding taxes type: number - + format: float TotalTax: description: Total tax on bank transaction type: number - + format: float Total: description: Total of bank transaction tax inclusive type: number - + format: float BankTransactionID: description: Xero generated unique identifier for bank transaction readOnly: true @@ -6202,10 +6212,12 @@ components: type: string Quantity: description: LineItem Quantity - type: string + type: number + format: float UnitAmount: description: LineItem Unit Amount type: number + format: float ItemCode: description: See Items type: string @@ -6223,6 +6235,7 @@ components: (see below) based on the tax rate. This value can be overriden if the calculated is not correct. type: number + format: float LineAmount: description: >- If you wish to omit either of the or you can @@ -6231,6 +6244,7 @@ components: has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100) type: number + format: float Tracking: description: >- Optional Tracking Category – see Tracking. Any LineItem can have a @@ -6377,6 +6391,7 @@ components: The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 type: number + format: float Payments: type: array items: @@ -6424,8 +6439,7 @@ components: description: >- Integer – ranked order of branding theme. The default branding theme has a value of 0 - type: number - format: double + type: integer CreatedDateUTC: description: UTC timestamp of creation date of branding theme type: string @@ -6675,7 +6689,7 @@ components: type: boolean Rate: description: CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned - type: number + type: integer ContactPerson: externalDocs: url: 'http://developer.xero.com/documentation/api/contacts/' @@ -6874,6 +6888,7 @@ components: Amount: description: the amount being applied to the invoice type: number + format: float Date: description: >- the date the prepayment is applied YYYY-MM-DD (read-only). This will @@ -7324,6 +7339,7 @@ components: decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. type: number + format: float AccountCode: description: >- Default account code to be used for purchased/sale. Not applicable @@ -7878,11 +7894,13 @@ components: Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 type: number + format: float Amount: description: >- The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 type: number + format: float Reference: description: An optional description for the payment e.g. Direct Debit type: string @@ -8497,8 +8515,7 @@ components: properties: Period: description: 'Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months)' - type: number - format: double + type: integer Unit: description: 'One of the following : WEEKLY or MONTHLY' type: string @@ -8506,8 +8523,7 @@ components: description: >- Integer used with due date type e.g 20 (of following month), 31 (of current month) - type: number - format: double + type: integer DueDateType: allOf: - description: See Payment Terms @@ -8659,10 +8675,12 @@ components: description: Tax Rate (decimal to 4dp) e.g 12.5000 readOnly: true type: number + format: float EffectiveRate: description: Effective Tax Rate (decimal to 4dp) e.g 12.5000 readOnly: true type: number + format: float required: - ReportTaxType type: object @@ -8676,6 +8694,7 @@ components: Rate: description: Tax Rate (up to 4dp) type: number + format: float IsCompound: description: Boolean to describe if Tax rate is compounded. type: boolean @@ -8788,7 +8807,7 @@ components: properties: ErrorNumber: description: Exception number - type: number + type: integer Type: description: Exception type type: string diff --git a/spec/v3/Xero_assets_1.0.0_swagger.json b/spec/v3/Xero_assets_1.0.0_swagger.json index 9de3aff5e..1387d0ab6 100644 --- a/spec/v3/Xero_assets_1.0.0_swagger.json +++ b/spec/v3/Xero_assets_1.0.0_swagger.json @@ -4,9 +4,11 @@ "version" : "1.0.0", "title" : "Xero Assets API", "description" : "This the Xero Assets API", + "termsOfService" : "https://developer.xero.com/xero-developer-platform-terms-conditions/", "contact" : { - "name" : "Xero API team", - "email" : "api@xero.com" + "name" : "Xero Platform Team", + "email" : "api@xero.com", + "url" : "https://developer.xero.com" }, "license" : { "name" : "MIT", @@ -14,9 +16,6 @@ } }, "servers" : [ { - "description" : "SwaggerHub API Auto Mocking", - "url" : "https://virtserver.swaggerhub.com/Xero/assets/1.0.0" - }, { "description" : "Xero API servers", "url" : "https://api.xero.com/assets.xro/1.0/" } ], @@ -26,7 +25,7 @@ "tags" : [ "Asset" ], "summary" : "searches fixed asset", "operationId" : "getAssets", - "description" : "By passing in the appropriate options, you can search for\navailable fixed asset in the system\n", + "description" : "By passing in the appropriate options, you can search for available fixed asset in the system", "parameters" : [ { "name" : "status", "in" : "query", @@ -35,7 +34,8 @@ "type" : "string", "enum" : [ "Draft", "Registered", "Disposed" ], "example" : "Draft" - } + }, + "required" : true }, { "name" : "page", "in" : "query", @@ -76,12 +76,10 @@ "description" : "A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields.", "schema" : { "type" : "string", - "example" : "Draft" + "example" : "Draft", + "enum" : [ "AssetName", "AssetNumber", "Description", "AssetTypeName" ] } } ], - "security" : [ { - "apiKey" : [ ] - } ], "responses" : { "200" : { "description" : "search results matching criteria", @@ -103,12 +101,9 @@ "summary" : "adds a fixed asset", "operationId" : "createAsset", "description" : "Adds an asset to the system", - "security" : [ { - "apiKey" : [ ] - } ], "responses" : { "200" : { - "description" : "search results matching criteria", + "description" : "return single object - create new asset", "content" : { "application/json" : { "schema" : { @@ -148,12 +143,9 @@ "schema" : { "type" : "string", "format" : "uuid", - "example" : "xxxx" + "example" : "4f7bcdcb-5ec1-4258-9558-19f662fccdfe" } } ], - "security" : [ { - "apiKey" : [ ] - } ], "responses" : { "200" : { "description" : "search results matching criteria", @@ -176,10 +168,7 @@ "tags" : [ "Asset" ], "summary" : "searches fixed asset types", "operationId" : "getAssetTypes", - "description" : "By passing in the appropriate options, you can search for\navailable fixed asset types in the system\n", - "security" : [ { - "apiKey" : [ ] - } ], + "description" : "By passing in the appropriate options, you can search for available fixed asset types in the system", "responses" : { "200" : { "description" : "search results matching criteria", @@ -204,12 +193,9 @@ "summary" : "adds a fixed asset type", "operationId" : "createAssetType", "description" : "Adds an fixed asset type to the system", - "security" : [ { - "apiKey" : [ ] - } ], "responses" : { "200" : { - "description" : "search results matching criteria", + "description" : "results single object - created fixed type", "content" : { "application/json" : { "schema" : { @@ -222,7 +208,7 @@ "description" : "invalid input, object invalid" }, "409" : { - "description" : "an existing type already exists" + "description" : "a type already exists" } }, "requestBody" : { @@ -242,10 +228,7 @@ "tags" : [ "Asset" ], "summary" : "searches fixed asset settings", "operationId" : "getAssetSettings", - "description" : "By passing in the appropriate options, you can search for\navailable fixed asset types in the system\n", - "security" : [ { - "apiKey" : [ ] - } ], + "description" : "By passing in the appropriate options, you can search for available fixed asset types in the system", "responses" : { "200" : { "description" : "search results matching criteria", @@ -265,13 +248,6 @@ } }, "components" : { - "securitySchemes" : { - "ApiKeyAuth" : { - "type" : "apiKey", - "in" : "header", - "name" : "X-API-Key" - } - }, "schemas" : { "Assets" : { "type" : "object", @@ -314,42 +290,49 @@ "assetId" : { "type" : "string", "format" : "uuid", + "description" : "The Xero-generated Id for the asset", "example" : "3b5b3a38-5649-495f-87a1-14a4e5918634" }, "assetName" : { "type" : "string", + "description" : "The name of the asset", "example" : "Awesome Truck 3" }, "assetNumber" : { "type" : "string", - "format" : "string", + "description" : "Must be unique.", "example" : "FA-0013" }, "purchaseDate" : { "type" : "string", "format" : "date", + "description" : "The date the asset was purchased YYYY-MM-DD", "example" : "2015-07-01T00:00:00" }, "purchasePrice" : { "type" : "integer", + "description" : "The purchase price of the asset", "example" : "1000" }, "disposalPrice" : { "type" : "integer", + "description" : "The price the asset was disposed at", "example" : 0 }, "assetStatus" : { "type" : "string", - "example" : "Draft" + "description" : "See Asset Status Codes.", + "example" : "Draft", + "enum" : [ "Draft", "Registered", "Disposed" ] }, "warrantyExpiryDate" : { "type" : "string", - "format" : "string", + "description" : "The date the asset’s warranty expires (if needed) YYYY-MM-DD", "example" : "ca4c6b39-4f4f-43e8-98da-5e1f350a6694" }, "serialNumber" : { "type" : "string", - "format" : "string", + "description" : "The asset's serial number", "example" : "ca4c6b39-4f4f-43e8-98da-5e1f350a6694" }, "bookDepreciationSetting" : { @@ -360,10 +343,12 @@ }, "canRollBack" : { "type" : "boolean", + "description" : "Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back.", "example" : true }, "AccountingBookValue" : { "type" : "integer", + "description" : "The accounting value of the asset", "example" : 0 } } @@ -375,33 +360,39 @@ "assetTypeId" : { "type" : "string", "format" : "uuid", - "example" : "5da209c5-5e19-4a43-b925-71b776c49ced" + "example" : "5da209c5-5e19-4a43-b925-71b776c49ced", + "description" : "Xero generated unique identifier for asset types" }, "assetTypeName" : { "type" : "string", - "example" : "Computer Equipment" + "example" : "Computer Equipment", + "description" : "The name of the asset type" }, "fixedAssetAccountId" : { "type" : "string", - "format" : "string", - "example" : "24e260f1-bfc4-4766-ad7f-8a8ce01de879" + "format" : "uuid", + "example" : "24e260f1-bfc4-4766-ad7f-8a8ce01de879", + "description" : "The asset account for fixed assets of this type" }, "depreciationExpenseAccountId" : { "type" : "string", - "format" : "string", - "example" : "b23fc79b-d66b-44b0-a240-e138e086fcbc" + "format" : "uuid", + "example" : "b23fc79b-d66b-44b0-a240-e138e086fcbc", + "description" : "The expense account for the depreciation of fixed assets of this type" }, "accumulatedDepreciationAccountId" : { "type" : "string", - "format" : "string", - "example" : "ca4c6b39-4f4f-43e8-98da-5e1f350a6694" + "format" : "uuid", + "example" : "ca4c6b39-4f4f-43e8-98da-5e1f350a6694", + "description" : "The account for accumulated depreciation of fixed assets of this type" }, "bookDepreciationSetting" : { "$ref" : "#/components/schemas/BookDepreciationSetting" }, "locks" : { "type" : "integer", - "example" : 33 + "example" : 33, + "description" : "All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed." } } }, @@ -411,25 +402,31 @@ "depreciationMethod" : { "type" : "string", "enum" : [ "NoDepreciation", "StraightLine", "DiminishingValue100", "DiminishingValue150", "DiminishingValue200", "FullDepreciation" ], - "example" : "StraightLine" + "example" : "StraightLine", + "description" : "The method of depreciation applied to this asset. See Depreciation Methods" }, "averagingMethod" : { "type" : "string", "enum" : [ "FullMonth", "ActualDays" ], - "example" : "ActualDays" + "example" : "ActualDays", + "description" : "The method of averaging applied to this asset. See Averaging Methods" }, "depreciationRate" : { - "type" : "integer", - "example" : 33 + "type" : "number", + "format" : "float", + "example" : 0.05, + "description" : "The rate of depreciation (e.g. 0.05)" }, "effectiveLifeYears" : { "type" : "integer", - "example" : 5 + "example" : 5, + "description" : "Effective life of the asset in years (e.g. 5)" }, "depreciationCalculationMethod" : { "type" : "string", "enum" : [ "Rate", "Life", "None" ], - "example" : "None" + "example" : "None", + "description" : "See Depreciation Calculation Methods" } } }, @@ -438,31 +435,39 @@ "properties" : { "currentCapitalGain" : { "type" : "integer", - "example" : 0 + "example" : 0, + "description" : "When an asset is disposed, this will be the sell price minus the purchase price if a profit was made." }, "currentGainLoss" : { "type" : "integer", - "example" : 0 + "example" : 0, + "description" : "When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value." }, "depreciationStartDate" : { "type" : "string", - "example" : "2015-07-01T00:00:00" + "format" : "date", + "example" : "2015-07-01T00:00:00", + "description" : "YYYY-MM-DD" }, "costLimit" : { "type" : "integer", - "example" : 100000 + "example" : 100000, + "description" : "The value of the asset you want to depreciate, if this is less than the cost of the asset." }, "residualValue" : { "type" : "integer", - "example" : 10000 + "example" : 10000, + "description" : "The value of the asset remaining when you've fully depreciated it." }, "priorAccumDepreciationAmount" : { "type" : "integer", - "example" : 0 + "example" : 0, + "description" : "All depreciation prior to the current financial year." }, "currentAccumDepreciationAmount" : { "type" : "integer", - "example" : 0 + "example" : 0, + "description" : "All depreciation occurring in the current financial year." } } }, @@ -471,34 +476,47 @@ "properties" : { "assetNumberPrefix" : { "type" : "string", - "example" : "StraightLine" + "example" : "FA-", + "description" : "The prefix used for fixed asset numbers (“FA-” by default)" }, "assetNumberSequence" : { - "type" : "integer", - "example" : "StraightLine" + "type" : "string", + "example" : "0022", + "description" : "The next available sequence number" }, "assetStartDate" : { "type" : "string", - "example" : "StraightLine" + "format" : "date", + "example" : "2015-07-31T00:00:00", + "description" : "The date depreciation calculations started on registered fixed assets in Xero" }, "lastDepreciationDate" : { "type" : "string", - "example" : "StraightLine" + "format" : "date", + "example" : "2015-07-01T00:00:00", + "description" : "The last depreciation date" }, "defaultGainOnDisposalAccountId" : { "type" : "string", - "example" : "StraightLine" + "format" : "uuid", + "example" : "346ddb97-739a-4274-b43b-66aa3218d17c", + "description" : "Default account that gains are posted to" }, "defaultLossOnDisposalAccountId" : { "type" : "string", - "example" : "StraightLine" + "format" : "uuid", + "example" : "1b798541-24e2-4855-9309-c023a0b576f3", + "description" : "Default account that losses are posted to" }, - "defaultCapitalGainOnDisposalAccount" : { + "defaultCapitalGainOnDisposalAccountId" : { "type" : "string", - "example" : "StraightLine" + "format" : "uuid", + "example" : "6d6a0bdb-e118-45d8-a023-2ad617ec1cb7", + "description" : "Default account that capital gains are posted to" }, "optInForTax" : { "type" : "boolean", + "description" : "opt in for tax calculation", "example" : false } }, diff --git a/spec/v3/Xero_assets_1.0.0_swagger.yaml b/spec/v3/Xero_assets_1.0.0_swagger.yaml index 8564a52a0..278ab570c 100644 --- a/spec/v3/Xero_assets_1.0.0_swagger.yaml +++ b/spec/v3/Xero_assets_1.0.0_swagger.yaml @@ -3,16 +3,15 @@ info: version: "1.0.0" title: Xero Assets API description: This the Xero Assets API - contact: - name: Xero API team - email: api@xero.com + termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/" + contact: + name: "Xero Platform Team" + email: "api@xero.com" + url: "https://developer.xero.com" license: name: MIT url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE' servers: -# Added by API Auto Mocking Plugin - - description: SwaggerHub API Auto Mocking - url: https://virtserver.swaggerhub.com/Xero/assets/1.0.0 - description: Xero API servers url: https://api.xero.com/assets.xro/1.0/ paths: @@ -22,8 +21,7 @@ paths: - Asset summary: searches fixed asset operationId: getAssets - description: | - By passing in the appropriate options, you can search for + description: By passing in the appropriate options, you can search for available fixed asset in the system parameters: - name: status @@ -31,8 +29,12 @@ paths: description: Required when retrieving a collection of assets. See Asset Status Codes schema: type: string - enum: [Draft,Registered,Disposed] + enum: + - Draft + - Registered + - Disposed example: Draft + required: true - name: page in: query description: Results are paged. This specifies which page of the results to return. The default page is 1. @@ -50,14 +52,23 @@ paths: description: Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. schema: type: string - enum: [AssetType, AssetName,AssetNumber,PurchaseDate, PurchasePrice,DisposalDate,DisposalPrice] + enum: + - AssetType + - AssetName + - AssetNumber + - PurchaseDate + - PurchasePrice + - DisposalDate + - DisposalPrice example: AssetName - name: sortDirection in: query description: ASC or DESC schema: type: string - enum: [asc, desc] + enum: + - asc + - desc example: ASC - name: filterBy in: query @@ -65,8 +76,11 @@ paths: schema: type: string example: Draft - security: - - apiKey: [] + enum: + - AssetName + - AssetNumber + - Description + - AssetTypeName responses: '200': description: search results matching criteria @@ -82,11 +96,9 @@ paths: summary: adds a fixed asset operationId: createAsset description: Adds an asset to the system - security: - - apiKey: [] responses: '200': - description: search results matching criteria + description: return single object - create new asset content: application/json: schema: @@ -117,9 +129,7 @@ paths: schema: type: string format: uuid - example: xxxx - security: - - apiKey: [] + example: "4f7bcdcb-5ec1-4258-9558-19f662fccdfe" responses: '200': description: search results matching criteria @@ -135,11 +145,8 @@ paths: - Asset summary: searches fixed asset types operationId: getAssetTypes - description: | - By passing in the appropriate options, you can search for + description: By passing in the appropriate options, you can search for available fixed asset types in the system - security: - - apiKey: [] responses: '200': description: search results matching criteria @@ -157,11 +164,9 @@ paths: summary: adds a fixed asset type operationId: createAssetType description: Adds an fixed asset type to the system - security: - - apiKey: [] responses: '200': - description: search results matching criteria + description: results single object - created fixed type content: application/json: schema: @@ -169,7 +174,7 @@ paths: '400': description: 'invalid input, object invalid' '409': - description: an existing type already exists + description: a type already exists requestBody: content: application/json: @@ -182,11 +187,8 @@ paths: - Asset summary: searches fixed asset settings operationId: getAssetSettings - description: | - By passing in the appropriate options, you can search for + description: By passing in the appropriate options, you can search for available fixed asset types in the system - security: - - apiKey: [] responses: '200': description: search results matching criteria @@ -197,11 +199,6 @@ paths: '400': description: bad input parameter components: - securitySchemes: - ApiKeyAuth: - type: apiKey - in: header - name: X-API-Key schemas: Assets: type: object @@ -236,34 +233,44 @@ components: assetId: type: string format: uuid + description: "The Xero-generated Id for the asset" example: "3b5b3a38-5649-495f-87a1-14a4e5918634" assetName: type: string + description: "The name of the asset" example: "Awesome Truck 3" assetNumber: type: string - format: string + description: "Must be unique." example: "FA-0013" purchaseDate: type: string format: date + description: "The date the asset was purchased YYYY-MM-DD" example: "2015-07-01T00:00:00" purchasePrice: type: integer + description: "The purchase price of the asset" example: "1000" disposalPrice: type: integer + description: "The price the asset was disposed at" example: 0 assetStatus: type: string + description: "See Asset Status Codes." example: "Draft" + enum: + - Draft + - Registered + - Disposed warrantyExpiryDate: type: string - format: string + description: "The date the asset’s warranty expires (if needed) YYYY-MM-DD" example: "ca4c6b39-4f4f-43e8-98da-5e1f350a6694" serialNumber: type: string - format: string + description: "The asset's serial number" example: "ca4c6b39-4f4f-43e8-98da-5e1f350a6694" bookDepreciationSetting: $ref: '#/components/schemas/BookDepreciationSetting' @@ -271,9 +278,11 @@ components: $ref: '#/components/schemas/BookDepreciationDetail' canRollBack: type: boolean + description: "Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back." example: true AccountingBookValue: type: integer + description: "The accounting value of the asset" example: 0 AssetType: type: object @@ -286,48 +295,71 @@ components: type: string format: uuid example: "5da209c5-5e19-4a43-b925-71b776c49ced" + description: "Xero generated unique identifier for asset types" assetTypeName: type: string example: "Computer Equipment" + description: "The name of the asset type" fixedAssetAccountId: type: string - format: string + format: uuid example: "24e260f1-bfc4-4766-ad7f-8a8ce01de879" + description: "The asset account for fixed assets of this type" depreciationExpenseAccountId: type: string - format: string + format: uuid example: "b23fc79b-d66b-44b0-a240-e138e086fcbc" + description: "The expense account for the depreciation of fixed assets of this type" accumulatedDepreciationAccountId: type: string - format: string + format: uuid example: "ca4c6b39-4f4f-43e8-98da-5e1f350a6694" + description: "The account for accumulated depreciation of fixed assets of this type" bookDepreciationSetting: $ref: '#/components/schemas/BookDepreciationSetting' locks: type: integer example: 33 + description: "All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed." BookDepreciationSetting: required: - name properties: depreciationMethod: type: string - enum: [NoDepreciation,StraightLine,DiminishingValue100,DiminishingValue150,DiminishingValue200,FullDepreciation] + enum: + - NoDepreciation + - StraightLine + - DiminishingValue100 + - DiminishingValue150 + - DiminishingValue200 + - FullDepreciation example: "StraightLine" + description: "The method of depreciation applied to this asset. See Depreciation Methods" averagingMethod: type: string - enum: [FullMonth,ActualDays] + enum: + - FullMonth + - ActualDays example: "ActualDays" + description: "The method of averaging applied to this asset. See Averaging Methods" depreciationRate: - type: integer - example: 33 + type: number + format: float + example: 0.05 + description: "The rate of depreciation (e.g. 0.05)" effectiveLifeYears: type: integer example: 5 + description: "Effective life of the asset in years (e.g. 5)" depreciationCalculationMethod: type: string - enum: [Rate,Life,None] + enum: + - Rate + - Life + - None example: "None" + description: "See Depreciation Calculation Methods" BookDepreciationDetail: required: - name @@ -335,50 +367,71 @@ components: currentCapitalGain: type: integer example: 0 + description: "When an asset is disposed, this will be the sell price minus the purchase price if a profit was made." currentGainLoss: type: integer example: 0 + description: "When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value." depreciationStartDate: type: string + format: date example: "2015-07-01T00:00:00" + description: "YYYY-MM-DD" costLimit: type: integer example: 100000 + description: "The value of the asset you want to depreciate, if this is less than the cost of the asset." residualValue: type: integer example: 10000 + description: "The value of the asset remaining when you've fully depreciated it." priorAccumDepreciationAmount: type: integer example: 0 + description: "All depreciation prior to the current financial year." currentAccumDepreciationAmount: type: integer example: 0 + description: "All depreciation occurring in the current financial year." Setting: required: - name properties: assetNumberPrefix: type: string - example: "StraightLine" + example: "FA-" + description: "The prefix used for fixed asset numbers (“FA-” by default)" assetNumberSequence: - type: integer - example: "StraightLine" + type: string + example: "0022" + description: "The next available sequence number" assetStartDate: type: string - example: "StraightLine" + format: date + example: "2015-07-31T00:00:00" + description: "The date depreciation calculations started on registered fixed assets in Xero" lastDepreciationDate: type: string - example: "StraightLine" + format: date + example: "2015-07-01T00:00:00" + description: "The last depreciation date" defaultGainOnDisposalAccountId: type: string - example: "StraightLine" + format: uuid + example: "346ddb97-739a-4274-b43b-66aa3218d17c" + description: "Default account that gains are posted to" defaultLossOnDisposalAccountId: type: string - example: "StraightLine" - defaultCapitalGainOnDisposalAccount: + format: uuid + example: "1b798541-24e2-4855-9309-c023a0b576f3" + description: "Default account that losses are posted to" + defaultCapitalGainOnDisposalAccountId: type: string - example: "StraightLine" + format: uuid + example: "6d6a0bdb-e118-45d8-a023-2ad617ec1cb7" + description: "Default account that capital gains are posted to" optInForTax: type: boolean + description: "opt in for tax calculation" example: false type: object \ No newline at end of file diff --git a/spec/v3/Xero_bankfeeds_1.0.0_swagger.json b/spec/v3/Xero_bankfeeds_1.0.0_swagger.json new file mode 100644 index 000000000..b7468346e --- /dev/null +++ b/spec/v3/Xero_bankfeeds_1.0.0_swagger.json @@ -0,0 +1,828 @@ +{ + "openapi" : "3.0.0", + "info" : { + "version" : "1.0.0", + "title" : "Bank Feeds API", + "description" : "The Xero Bank Feeds API", + "contact" : { + "name" : "Xero API team", + "email" : "api@xero.com" + }, + "license" : { + "name" : "MIT", + "url" : "https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE" + } + }, + "servers" : [ { + "description" : "Xero Bank Feeds API base url", + "url" : "https://api.xero.com/bankfeeds.xro/1.0/" + } ], + "paths" : { + "/FeedConnections" : { + "get" : { + "tags" : [ "BankFeeds" ], + "summary" : "searches feed connections", + "operationId" : "getFeedConnections", + "description" : "By passing in the appropriate options, you can search for available feed connections in the system", + "parameters" : [ { + "name" : "page", + "in" : "query", + "description" : "Page number which specifies the set of records to retrieve. By default the number of the records per set is 10. Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned.", + "schema" : { + "type" : "integer", + "example" : 1 + } + }, { + "name" : "pageSize", + "in" : "query", + "description" : "Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to specify page size of 100.", + "schema" : { + "type" : "integer", + "example" : 100 + } + } ], + "security" : [ { + "apiKey" : [ ] + } ], + "responses" : { + "201" : { + "description" : "search results matching criteria", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/FeedConnections" + }, + "example" : { + "pagination" : { + "page" : 1, + "pageSize" : 20, + "pageCount" : 1, + "itemCount" : 2 + }, + "items" : [ { + "id" : "50d3cf8d-95dc-4466-8dc0-47e6d1197e28", + "accountToken" : "10000123", + "accountNumber" : "3809087654321500", + "accountName" : "Joe's Savings Account", + "accountType" : "BANK", + "currency" : "AUD" + }, { + "id" : "cab0d76e-1325-4d81-b5f8-5a8fadecbe87", + "accountToken" : "10000124", + "accountNumber" : "1234", + "accountName" : "Sam's Credit Card", + "accountType" : "CREDITCARD", + "currency" : "AUD" + } ] + } + } + } + }, + "400" : { + "description" : "bad input parameter" + } + } + }, + "post" : { + "tags" : [ "BankFeeds" ], + "summary" : "create one or more new feed connection", + "operationId" : "createFeedConnections", + "description" : "By passing in the appropriate body, you can create one or more new feed connections in the system\n", + "security" : [ { + "apiKey" : [ ] + } ], + "requestBody" : { + "required" : true, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/FeedConnections" + }, + "example" : { + "items" : [ { + "AccountToken" : "10058695", + "AccountNumber" : "3809058454321500", + "AccountName" : "Mike's Savings Account", + "AccountType" : "BANK", + "Currency" : "GBP" + }, { + "AccountToken" : "10045844", + "AccountNumber" : "3809058887441500", + "AccountName" : "Gee's Saving's Account", + "AccountType" : "BANK", + "Currency" : "GBP", + "Country" : "GB" + } ] + } + } + }, + "description" : "Feed Connection(s) to add" + }, + "responses" : { + "201" : { + "description" : "feed connection created", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/FeedConnections" + }, + "example" : { + "items" : [ { + "AccountToken" : "10058695", + "Status" : "PENDING" + }, { + "accountToken" : "10045844", + "status" : "REJECTED", + "error" : { + "type" : "feed-already-connected-in-current-organisation", + "title" : "Feed Connection failed", + "detail" : "The AccountToken is already connected to another Xero Bank Account associated with this bank in the selected Xero Organisation." + } + } ] + } + } + } + }, + "400" : { + "description" : "invalid input, object invalid" + } + } + } + }, + "/FeedConnections/{id}" : { + "get" : { + "tags" : [ "BankFeeds" ], + "summary" : "get single feed connection by id", + "operationId" : "getFeedConnection", + "description" : "By passing in a FeedConnection Id options, you can search for\navailable feed connections in the system\n", + "parameters" : [ { + "name" : "id", + "in" : "path", + "required" : true, + "description" : "feed connection id for single object", + "schema" : { + "type" : "string", + "example" : "xxxx" + } + } ], + "security" : [ { + "apiKey" : [ ] + } ], + "responses" : { + "200" : { + "description" : "search results matching criteria", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/FeedConnection" + }, + "example" : { + "id" : "50d3cf8d-95dc-4466-8dc0-47e6d1197e28", + "accountToken" : "10000123", + "accountNumber" : "3809087654321500", + "accountName" : "Joe's Savings Account", + "accountType" : "BANK", + "currency" : "AUD" + } + } + } + }, + "400" : { + "description" : "bad input parameter" + } + } + } + }, + "/FeedConnections/DeleteRequests" : { + "post" : { + "tags" : [ "BankFeeds" ], + "summary" : "delete an exsiting feed connection", + "operationId" : "deleteFeedConnections", + "description" : "By passing in the appropriate body, you can create a new feed connections in the system\n", + "security" : [ { + "apiKey" : [ ] + } ], + "requestBody" : { + "required" : true, + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/FeedConnections" + }, + "example" : { + "items" : [ { + "id" : "50d3cf8d-95dc-4466-8dc0-47e6d1197e28" + }, { + "accountToken" : "10000123" + } ] + } + } + }, + "description" : "Feed Connections to delete" + }, + "responses" : { + "202" : { + "description" : "create results matching body content", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/FeedConnections" + }, + "example" : { + "items" : [ { + "id" : "50d3cf8d-95dc-4466-8dc0-47e6d1197e28", + "accountToken" : "10000123", + "status" : "PENDING" + }, { + "accountToken" : "10000125", + "status" : "REJECTED", + "error" : { + "type" : "feed-connected-in-different-organisation", + "title" : "Feed connected in different organisation", + "detail" : "The AccountToken is connected to another Xero Bank Account associated with this bank. This Xero Bank Account belongs to a different Xero Organisation." + } + } ] + } + } + } + }, + "400" : { + "description" : "bad input parameter" + } + } + } + }, + "/Statements" : { + "get" : { + "tags" : [ "BankFeeds" ], + "operationId" : "getStatements", + "parameters" : [ { + "in" : "query", + "name" : "page", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "in" : "query", + "name" : "pageSize", + "required" : false, + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "Xero-Application-Id", + "in" : "header", + "required" : false, + "schema" : { + "type" : "string", + "default" : "00000000-0000-0000-0000-0000000010000" + } + }, { + "name" : "Xero-Tenant-Id", + "in" : "header", + "required" : false, + "schema" : { + "type" : "string", + "default" : "00000000-0000-0000-0000-0000020000000" + } + }, { + "name" : "Xero-User-Id", + "in" : "header", + "required" : false, + "schema" : { + "type" : "string", + "default" : "00000000-0000-0000-0000-0000030000000" + } + } ], + "responses" : { + "200" : { + "description" : "search results matching criteria", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Statements" + }, + "example" : { + "pagination" : { + "page" : 1, + "pageCount" : 1, + "pageSize" : 50, + "itemCount" : 3 + }, + "items" : [ { + "id" : "ba4f3127-5e46-427d-80ea-dea2fcd26afe", + "feedConnectionId" : "87cb0dc8-fa32-409c-b622-19f8de8dcc83", + "status" : "PENDING", + "startDate" : "2018-07-27", + "endDate" : "2018-07-27", + "startBalance" : { + "amount" : "9.0000", + "creditDebitIndicator" : "DEBIT" + }, + "endBalance" : { + "amount" : "10.1340", + "creditDebitIndicator" : "DEBIT" + }, + "statementLineCount" : "1" + } ] + } + } + } + }, + "400" : { + "description" : "bad input parameter", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Statements" + }, + "example" : { + "type" : "invalid-request", + "title" : "Invalid Request", + "status" : 400, + "detail" : "For the request field missing parameter." + } + } + } + } + } + }, + "post" : { + "tags" : [ "BankFeeds" ], + "operationId" : "createStatements", + "responses" : { + "202" : { + "description" : "Success", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Statements" + }, + "example" : { + "items" : [ { + "id" : "ed8580c9-fe82-4692-be66-9fc9c1c9a918", + "feedConnectionId" : "5a896e9e-7dce-4b64-b2c5-2a51abedcac0", + "status" : "REJECTED", + "errors" : [ { + "type" : "duplicate-statement", + "title" : "Duplicate Statement Received", + "status" : 409, + "detail" : "The received statement was marked as a duplicate." + } ] + }, { + "id" : "26c52a2b-a92d-4d0f-9d38-6e217ef5c0f3", + "feedConnectionId" : "746f347a-e58d-4906-98ab-9dfaa04f3cf2", + "status" : "PENDING" + } ] + } + } + } + }, + "400" : { + "description" : "Statement failed validation", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Statements" + }, + "example" : { + "type" : "invalid-request", + "title" : "Invalid Request", + "status" : 400, + "detail" : "For the request field 'StatementLine.ChequeNumber' exceeded the maximum length of 20." + } + } + } + }, + "403" : { + "description" : "Invalid application or feed connection", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + }, + "example" : { + "type" : "invalid-application", + "title" : "Invalid Application", + "status" : 403, + "detail" : "The application has not been configured to use these API endpoints." + } + } + } + }, + "409" : { + "description" : "Duplicate statement received", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Statements" + }, + "example" : { + "type" : "duplicate-statement", + "title" : "Duplicate Statement Received", + "status" : 409, + "detail" : "The received statement was marked as a duplicate." + } + } + } + }, + "413" : { + "description" : "Statement exceeds size limit", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Statements" + }, + "example" : { + "type" : "invalid-request", + "title" : "Request too large", + "status" : 413, + "detail" : "Request size of 3500000 bytes exceeds the limit of 3000000 bytes." + } + } + } + }, + "500" : { + "description" : "Intermittent Xero Error", + "content" : { + "application/problem+json" : { + "schema" : { + "$ref" : "#/components/schemas/Statements" + }, + "example" : { + "type" : "internal-error", + "title" : "Intermittent Internal Xero Error", + "status" : 500, + "detail" : "The request should be retried. If the error persists, a Xero support issue should be raised." + } + } + } + } + }, + "requestBody" : { + "description" : "Feed Connection(s) to add", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Statements" + }, + "example" : { + "items" : [ { + "feedConnectionId" : "5a896e9e-7dce-4b64-b2c5-2a51abedcac0", + "startDate" : "2018-06-10", + "endDate" : "2018-06-11", + "startBalance" : { + "amount" : 100.0, + "creditDebitIndicator" : "DEBIT" + }, + "endBalance" : { + "amount" : 110.0, + "creditDebitIndicator" : "DEBIT" + }, + "statementLines" : [ { + "postedDate" : "2018-06-10", + "description" : "Description for statement line 1", + "amount" : 5.0, + "creditDebitIndicator" : "CREDIT", + "transactionId" : "transaction-id-1" + }, { + "postedDate" : "2018-06-10", + "description" : "Description for statement line 2", + "amount" : 5.0, + "creditDebitIndicator" : "CREDIT", + "transactionId" : "transaction-id-2", + "payeeName" : "Payee name for statement line 2", + "reference" : "Reference for statement line 2", + "chequeNumber" : "021" + } ] + }, { + "feedConnectionId" : "746f347a-e58d-4906-98ab-9dfaa04f3cf2", + "startDate" : "2018-06-10", + "endDate" : "2018-06-11", + "startBalance" : { + "amount" : 200.0, + "creditDebitIndicator" : "DEBIT" + }, + "endBalance" : { + "amount" : 215.5, + "creditDebitIndicator" : "DEBIT" + }, + "statementLines" : [ { + "postedDate" : "2018-06-10", + "description" : "Description for statement line 1", + "amount" : 5.5, + "creditDebitIndicator" : "CREDIT", + "transactionId" : "transaction-id-10" + }, { + "postedDate" : "2018-06-10", + "description" : "Description for statement line 2", + "amount" : 10.0, + "creditDebitIndicator" : "CREDIT", + "transactionId" : "transaction-id-11", + "payeeName" : "Payee name for statement line 2", + "reference" : "Reference for statement line 2", + "chequeNumber" : "031" + } ] + } ] + } + } + } + } + } + }, + "/Statements/{statementId}" : { + "get" : { + "tags" : [ "BankFeeds" ], + "operationId" : "getStatement", + "parameters" : [ { + "name" : "statementId", + "in" : "path", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "search results matching id for single statement", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Statement" + }, + "example" : { + "id" : "ba4f3127-5e46-427d-80ea-dea2fcd26afe", + "feedConnectionId" : "87cb0dc8-fa32-409c-b622-19f8de8dcc83", + "status" : "PENDING", + "startDate" : "2018-07-27", + "endDate" : "2018-07-27", + "startBalance" : { + "amount" : "9.0000", + "creditDebitIndicator" : "DEBIT" + }, + "endBalance" : { + "amount" : "10.1340", + "creditDebitIndicator" : "DEBIT" + }, + "statementLineCount" : "1" + } + } + } + }, + "404" : { + "description" : "Statement not found" + } + } + } + } + }, + "components" : { + "securitySchemes" : { + "ApiKeyAuth" : { + "type" : "apiKey", + "in" : "header", + "name" : "X-API-Key" + } + }, + "schemas" : { + "FeedConnections" : { + "type" : "object", + "properties" : { + "pagination" : { + "$ref" : "#/components/schemas/Pagination" + }, + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/FeedConnection" + } + } + } + }, + "FeedConnection" : { + "type" : "object", + "required" : [ "id" ], + "properties" : { + "id" : { + "type" : "string", + "example" : "0d3cf8d-95dc-4466-8dc0-47e6d1197e28" + }, + "accountToken" : { + "type" : "string", + "example" : "10000123" + }, + "accountNumber" : { + "type" : "string", + "example" : "3809087654321500" + }, + "accountName" : { + "type" : "string", + "example" : "Joe's Savings Account" + }, + "accountId" : { + "type" : "string", + "example" : "079a88ea-276d-41fb-a1f1-366ef3e22921" + }, + "accountType" : { + "enum" : [ "BANK", "CREDITCARD" ], + "example" : "BANK" + }, + "currency" : { + "type" : "string", + "example" : "AUD" + }, + "country" : { + "type" : "string", + "example" : "GB" + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "REJECTED" ], + "example" : "REJECTED" + }, + "error" : { + "$ref" : "#/components/schemas/Error" + } + } + }, + "Statements" : { + "type" : "object", + "properties" : { + "pagination" : { + "$ref" : "#/components/schemas/Pagination" + }, + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Statement" + } + } + } + }, + "Pagination" : { + "properties" : { + "page" : { + "type" : "integer", + "example" : 1 + }, + "pageSize" : { + "type" : "integer", + "example" : 10 + }, + "pageCount" : { + "type" : "integer", + "example" : 1 + }, + "itemCount" : { + "type" : "integer", + "example" : 2 + } + } + }, + "Statement" : { + "type" : "object", + "required" : [ "id" ], + "properties" : { + "id" : { + "type" : "string", + "example" : "ba4f3127-5e46-427d-80ea-dea2fcd26afe" + }, + "feedConnectionId" : { + "type" : "string", + "example" : "87cb0dc8-fa32-409c-b622-19f8de8dcc83" + }, + "status" : { + "enum" : [ "PENDING", "REJECTED", "DELIVERED" ], + "example" : "PENDING" + }, + "startDate" : { + "type" : "string", + "format" : "date", + "example" : "2018-07-27" + }, + "endDate" : { + "type" : "string", + "format" : "date", + "example" : "2018-07-27" + }, + "startBalance" : { + "$ref" : "#/components/schemas/StartBalance" + }, + "endBalance" : { + "$ref" : "#/components/schemas/EndBalance" + }, + "statementLines" : { + "$ref" : "#/components/schemas/StatementLines" + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Error" + } + }, + "statementLineCount" : { + "type" : "integer", + "example" : 1 + } + } + }, + "StartBalance" : { + "type" : "object", + "properties" : { + "amount" : { + "type" : "string", + "example" : "9.0000" + }, + "creditDebitIndicator" : { + "$ref" : "#/components/schemas/CreditDebitIndicator" + } + } + }, + "EndBalance" : { + "type" : "object", + "properties" : { + "amount" : { + "type" : "string", + "example" : "10.1340" + }, + "creditDebitIndicator" : { + "$ref" : "#/components/schemas/CreditDebitIndicator" + } + } + }, + "StatementLines" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StatementLine" + } + }, + "StatementLine" : { + "type" : "object", + "properties" : { + "postedDate" : { + "type" : "string", + "format" : "date", + "example" : "2018-06-10" + }, + "description" : { + "type" : "string", + "example" : "Description for statement line 2" + }, + "amount" : { + "type" : "string", + "example" : "5.00" + }, + "creditDebitIndicator" : { + "$ref" : "#/components/schemas/CreditDebitIndicator" + }, + "transactionId" : { + "type" : "string", + "example" : "transaction-id-2" + }, + "payeeName" : { + "type" : "string", + "example" : "Payee name for statement line 2" + }, + "reference" : { + "type" : "string", + "example" : "Reference for statement line 2" + }, + "chequeNumber" : { + "type" : "string", + "example" : "021" + } + } + }, + "Error" : { + "type" : "object", + "description" : "On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json.", + "properties" : { + "title" : { + "type" : "string", + "example" : "Invalid Application" + }, + "status" : { + "type" : "integer", + "example" : 403 + }, + "detail" : { + "type" : "string", + "example" : "The application has not been configured to use these API endpoints." + }, + "type" : { + "type" : "string", + "enum" : [ "invalid-request", "invalid-application", "invalid-feed-connection", "duplicate-statement", "internal-error" ], + "example" : "invalid-application" + } + } + }, + "CreditDebitIndicator" : { + "type" : "string", + "enum" : [ "CREDIT", "DEBIT" ] + } + } + } +} \ No newline at end of file diff --git a/spec/v3/Xero_bankfeeds_1.0.0_swagger.yaml b/spec/v3/Xero_bankfeeds_1.0.0_swagger.yaml new file mode 100644 index 000000000..493be31c4 --- /dev/null +++ b/spec/v3/Xero_bankfeeds_1.0.0_swagger.yaml @@ -0,0 +1,690 @@ +openapi: 3.0.0 +info: + version: "1.0.0" + title: Bank Feeds API + description: The Xero Bank Feeds API + contact: + name: Xero API team + email: api@xero.com + license: + name: MIT + url: 'https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE' +servers: + - description: Xero Bank Feeds API base url + url: https://api.xero.com/bankfeeds.xro/1.0/ +paths: + /FeedConnections: + get: + tags: + - BankFeeds + summary: searches feed connections + operationId: getFeedConnections + description: + By passing in the appropriate options, you can search for + available feed connections in the system + parameters: + - name: page + in: query + description: Page number which specifies the set of records to retrieve. By default the number of the records per set is 10. Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. + schema: + type: integer + example: 1 + - name: pageSize + in: query + description: Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to specify page size of 100. + schema: + type: integer + example: 100 + security: + - apiKey: [] + responses: + '201': + description: search results matching criteria + content: + application/json: + schema: + $ref: '#/components/schemas/FeedConnections' + example: + pagination: + { + "page": 1, + "pageSize": 20, + "pageCount": 1, + "itemCount": 2 + } + items: + [ + { + "id": "50d3cf8d-95dc-4466-8dc0-47e6d1197e28", + "accountToken": "10000123", + "accountNumber": "3809087654321500", + "accountName": "Joe's Savings Account", + "accountType": "BANK", + "currency": "AUD" + }, + { + "id": "cab0d76e-1325-4d81-b5f8-5a8fadecbe87", + "accountToken": "10000124", + "accountNumber": "1234", + "accountName": "Sam's Credit Card", + "accountType": "CREDITCARD", + "currency": "AUD" + } + ] + '400': + description: bad input parameter + post: + tags: + - BankFeeds + summary: create one or more new feed connection + operationId: createFeedConnections + description: | + By passing in the appropriate body, you can create one or more new feed connections in the system + security: + - apiKey: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FeedConnections' + example: + items: + [ + { + "AccountToken": "10058695", + "AccountNumber": "3809058454321500", + "AccountName": "Mike's Savings Account", + "AccountType": "BANK", + "Currency": "GBP" + }, + { + "AccountToken": "10045844", + "AccountNumber": "3809058887441500", + "AccountName": "Gee's Saving's Account", + "AccountType": "BANK", + "Currency": "GBP", + "Country": "GB" + } + ] + description: Feed Connection(s) to add + responses: + '201': + description: feed connection created + content: + application/json: + schema: + $ref: '#/components/schemas/FeedConnections' + example: + items: + [ + { + "AccountToken": "10058695", + "Status": "PENDING" + + }, + { + "accountToken": "10045844", + "status": "REJECTED", + "error": { + "type": "feed-already-connected-in-current-organisation", + "title": "Feed Connection failed", + "detail": "The AccountToken is already connected to another Xero Bank Account associated with this bank in the selected Xero Organisation.", + } + } + ] + '400': + description: 'invalid input, object invalid' + /FeedConnections/{id}: + get: + tags: + - BankFeeds + summary: get single feed connection by id + operationId: getFeedConnection + description: | + By passing in a FeedConnection Id options, you can search for + available feed connections in the system + parameters: + - name: id + in: path + required: true + description: feed connection id for single object + schema: + type: string + example: xxxx + security: + - apiKey: [] + responses: + '200': + description: search results matching criteria + content: + application/json: + schema: + $ref: '#/components/schemas/FeedConnection' + example: + { + "id": "50d3cf8d-95dc-4466-8dc0-47e6d1197e28", + "accountToken": "10000123", + "accountNumber": "3809087654321500", + "accountName": "Joe's Savings Account", + "accountType": "BANK", + "currency": "AUD" + } + '400': + description: bad input parameter + /FeedConnections/DeleteRequests: + post: + tags: + - BankFeeds + summary: delete an exsiting feed connection + operationId: deleteFeedConnections + description: | + By passing in the appropriate body, you can create a new feed connections in the system + security: + - apiKey: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FeedConnections' + example: + items: [ + { + "id": "50d3cf8d-95dc-4466-8dc0-47e6d1197e28" + }, + { + "accountToken": "10000123" + } + ] + description: Feed Connections to delete + responses: + '202': + description: create results matching body content + content: + application/json: + schema: + $ref: '#/components/schemas/FeedConnections' + example: + items: [ + { + "id": "50d3cf8d-95dc-4466-8dc0-47e6d1197e28", + "accountToken": "10000123", + "status": "PENDING" + }, + { + "accountToken": "10000125", + "status": "REJECTED", + "error": { + "type": "feed-connected-in-different-organisation", + "title": "Feed connected in different organisation", + "detail": "The AccountToken is connected to another Xero Bank Account associated with this bank. This Xero Bank Account belongs to a different Xero Organisation." + } + } + ] + '400': + description: bad input parameter + /Statements: + get: + tags: + - BankFeeds + operationId: getStatements + parameters: + - in: query + name: page + required: false + schema: + type: integer + format: int32 + - in: query + name: pageSize + required: false + schema: + type: integer + format: int32 + - name: Xero-Application-Id + in: header + required: false + schema: + type: string + default: 00000000-0000-0000-0000-0000000010000 + - name: Xero-Tenant-Id + in: header + required: false + schema: + type: string + default: 00000000-0000-0000-0000-0000020000000 + - name: Xero-User-Id + in: header + required: false + schema: + type: string + default: 00000000-0000-0000-0000-0000030000000 + responses: + '200': + description: search results matching criteria + content: + application/json: + schema: + $ref: '#/components/schemas/Statements' + example: + pagination: + { + "page": 1, + "pageCount": 1, + "pageSize": 50, + "itemCount": 3 + } + items: + [ + { + "id": "ba4f3127-5e46-427d-80ea-dea2fcd26afe", + "feedConnectionId": "87cb0dc8-fa32-409c-b622-19f8de8dcc83", + "status": "PENDING", + "startDate": "2018-07-27", + "endDate": "2018-07-27", + "startBalance": { + "amount": "9.0000", + "creditDebitIndicator": "DEBIT" + }, + "endBalance": { + "amount": "10.1340", + "creditDebitIndicator": "DEBIT" + }, + "statementLineCount": "1" + } + ] + '400': + description: bad input parameter + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Statements' + example: { + "type": "invalid-request", + "title": "Invalid Request", + "status": 400, + "detail": "For the request field missing parameter." + } + post: + tags: + - BankFeeds + operationId: createStatements + responses: + '202': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Statements' + example: + items: [ + { + "id": "ed8580c9-fe82-4692-be66-9fc9c1c9a918", + "feedConnectionId": "5a896e9e-7dce-4b64-b2c5-2a51abedcac0", + "status": "REJECTED", + "errors": [ + { + "type": "duplicate-statement", + "title": "Duplicate Statement Received", + "status": 409, + "detail": "The received statement was marked as a duplicate." + } + ] + }, + { + "id": "26c52a2b-a92d-4d0f-9d38-6e217ef5c0f3", + "feedConnectionId": "746f347a-e58d-4906-98ab-9dfaa04f3cf2", + "status": "PENDING" + } + ] + '400': + description: Statement failed validation + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Statements' + example: { + "type": "invalid-request", + "title": "Invalid Request", + "status": 400, + "detail": "For the request field 'StatementLine.ChequeNumber' exceeded the maximum length of 20." + } + '403': + description: Invalid application or feed connection + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Error' + example: { + "type": "invalid-application", + "title": "Invalid Application", + "status": 403, + "detail": "The application has not been configured to use these API endpoints." + } + '409': + description: Duplicate statement received + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Statements' + example: { + "type": "duplicate-statement", + "title": "Duplicate Statement Received", + "status": 409, + "detail": "The received statement was marked as a duplicate." + } + '413': + description: Statement exceeds size limit + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Statements' + example: { + "type": "invalid-request", + "title": "Request too large", + "status": 413, + "detail": "Request size of 3500000 bytes exceeds the limit of 3000000 bytes." + } + '500': + description: Intermittent Xero Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/Statements' + example: { + "type": "internal-error", + "title": "Intermittent Internal Xero Error", + "status": 500, + "detail": "The request should be retried. If the error persists, a Xero support issue should be raised." + } + requestBody: + description: Feed Connection(s) to add + content: + application/json: + schema: + $ref: '#/components/schemas/Statements' + example: + items: [ + { + "feedConnectionId": "5a896e9e-7dce-4b64-b2c5-2a51abedcac0", + "startDate": "2018-06-10", + "endDate": "2018-06-11", + "startBalance": { + "amount": 100.00, + "creditDebitIndicator": "DEBIT" + }, + "endBalance": { + "amount": 110.00, + "creditDebitIndicator": "DEBIT" + }, + "statementLines": [ + { + "postedDate": "2018-06-10", + "description": "Description for statement line 1", + "amount": 5.00, + "creditDebitIndicator": "CREDIT", + "transactionId": "transaction-id-1" + }, + { + "postedDate": "2018-06-10", + "description": "Description for statement line 2", + "amount": 5.00, + "creditDebitIndicator": "CREDIT", + "transactionId": "transaction-id-2", + + "payeeName": "Payee name for statement line 2", + "reference": "Reference for statement line 2", + "chequeNumber": "021" + } + ] + }, + { + "feedConnectionId": "746f347a-e58d-4906-98ab-9dfaa04f3cf2", + "startDate": "2018-06-10", + "endDate": "2018-06-11", + "startBalance": { + "amount": 200.00, + "creditDebitIndicator": "DEBIT" + }, + "endBalance": { + "amount": 215.50, + "creditDebitIndicator": "DEBIT" + }, + "statementLines": [ + { + "postedDate": "2018-06-10", + "description": "Description for statement line 1", + "amount": 5.50, + "creditDebitIndicator": "CREDIT", + "transactionId": "transaction-id-10" + }, + { + "postedDate": "2018-06-10", + "description": "Description for statement line 2", + "amount": 10.00, + "creditDebitIndicator": "CREDIT", + "transactionId": "transaction-id-11", + + "payeeName": "Payee name for statement line 2", + "reference": "Reference for statement line 2", + "chequeNumber": "031" + } + ] + } + ] + /Statements/{statementId}: + get: + tags: + - BankFeeds + operationId: getStatement + parameters: + - name: statementId + in: path + required: true + schema: + type: string + responses: + '200': + description: search results matching id for single statement + content: + application/json: + schema: + $ref: '#/components/schemas/Statement' + example: + { + "id": "ba4f3127-5e46-427d-80ea-dea2fcd26afe", + "feedConnectionId": "87cb0dc8-fa32-409c-b622-19f8de8dcc83", + "status": "PENDING", + "startDate": "2018-07-27", + "endDate": "2018-07-27", + "startBalance": { + "amount": "9.0000", + "creditDebitIndicator": "DEBIT" + }, + "endBalance": { + "amount": "10.1340", + "creditDebitIndicator": "DEBIT" + }, + "statementLineCount": "1" + } + '404': + description: Statement not found +components: + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: X-API-Key + schemas: + FeedConnections: + type: object + properties: + pagination: + $ref: '#/components/schemas/Pagination' + items: + type: array + items: + $ref: '#/components/schemas/FeedConnection' + FeedConnection: + type: object + required: + - id + properties: + id: + type: string + example: "0d3cf8d-95dc-4466-8dc0-47e6d1197e28" + accountToken: + type: string + example: "10000123" + accountNumber: + type: string + example: "3809087654321500" + accountName: + type: string + example: "Joe's Savings Account" + accountId: + type: string + example: "079a88ea-276d-41fb-a1f1-366ef3e22921" + accountType: + enum: [BANK,CREDITCARD] + example: "BANK" + currency: + type: string + example: "AUD" + country: + type: string + example: "GB" + status: + type: string + enum: [PENDING,REJECTED] + example: "REJECTED" + error: + $ref: '#/components/schemas/Error' + Statements: + type: object + properties: + pagination: + $ref: '#/components/schemas/Pagination' + items: + type: array + items: + $ref: '#/components/schemas/Statement' + Pagination: + properties: + page: + type: integer + example: 1 + pageSize: + type: integer + example: 10 + pageCount: + type: integer + example: 1 + itemCount: + type: integer + example: 2 + Statement: + type: object + required: + - id + properties: + id: + type: string + example: "ba4f3127-5e46-427d-80ea-dea2fcd26afe" + feedConnectionId: + type: string + example: "87cb0dc8-fa32-409c-b622-19f8de8dcc83" + status: + enum: ["PENDING","REJECTED","DELIVERED"] + example: "PENDING" + startDate: + type: string + format: date + example: "2018-07-27" + endDate: + type: string + format: date + example: "2018-07-27" + startBalance: + $ref: '#/components/schemas/StartBalance' + endBalance: + $ref: '#/components/schemas/EndBalance' + statementLines: + $ref: '#/components/schemas/StatementLines' + errors: + type: array + items: + $ref: '#/components/schemas/Error' + statementLineCount: + type: integer + example: 1 + StartBalance: + type: object + properties: + amount: + type: string + example: "9.0000" + creditDebitIndicator: + $ref: '#/components/schemas/CreditDebitIndicator' + EndBalance: + type: object + properties: + amount: + type: string + example: "10.1340" + creditDebitIndicator: + $ref: '#/components/schemas/CreditDebitIndicator' + StatementLines: + type: array + items: + $ref: '#/components/schemas/StatementLine' + StatementLine: + type: object + properties: + postedDate: + type: string + format: date + example: "2018-06-10" + description: + type: string + example: "Description for statement line 2" + amount: + type: string + example: "5.00" + creditDebitIndicator: + $ref: '#/components/schemas/CreditDebitIndicator' + transactionId: + type: string + example: "transaction-id-2" + payeeName: + type: string + example: "Payee name for statement line 2" + reference: + type: string + example: "Reference for statement line 2" + chequeNumber: + type: string + example: "021" + Error: + type: object + description: On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. + properties: + title: + type: string + example: "Invalid Application" + status: + type: integer + example: 403 + detail: + type: string + example: "The application has not been configured to use these API endpoints." + type: + type: string + enum: ["invalid-request","invalid-application","invalid-feed-connection","duplicate-statement","internal-error"] + example: "invalid-application" + CreditDebitIndicator: + type: string + enum: + - CREDIT + - DEBIT \ No newline at end of file