XeroAPI/Xero-OpenAPI

Allocation summarize errors

andrews05 opened this issue · 9 comments

Allocations seem to be missing the standard error handling properties:

  • There's no summarizeErrors parameter for put method.
  • There's no StatusAttributeString or ValidationErrors properties for the schema.

The schema is also missing the CreditNote property (and similar for Prepayment etc).

@andrews05 - are you saying these are parameters and properties that are in our documentation or are undocumented? Please link to any relevant documentation on developer.xero.com or example payloads where properties appear that are not part of the OpenAPI spec.

OR are you asking for support of these params and properties to be added to the API?

The error handling is common to the entire accounting API and is valid for all PUT and POST requests. It’s just missing from Allocations in the OpenAPI spec.

The CreditNote/Prepayment/Overpayment properties seem to be undocumented but do appear in the response.

Here's an example response using summarizeErrors=false

{
  "Id": "6c6fe713-ec66-4f5a-a50c-4cf7e7f09590",
  "Status": "OK",
  "ProviderName": "Example",
  "DateTimeUTC": "\/Date(1591646243669)\/",
  "Allocations": [
    {
      "Amount": 15.00,
      "Date": "\/Date(-62135596800000)\/",
      "Invoice": {
        "InvoiceID": "85028b56-9d0a-44e9-9607-cbc95e8332c7",
        "Payments": [],
        "CreditNotes": [],
        "Prepayments": [],
        "Overpayments": [],
        "IsDiscounted": false,
        "HasErrors": false,
        "LineItems": [],
        "ValidationErrors": []
      },
      "CreditNote": {
        "CreditNoteID": "82776dd1-6e09-4cbf-b248-455b76a63f6e",
        "ID": "82776dd1-6e09-4cbf-b248-455b76a63f6e",
        "HasErrors": false,
        "LineItems": []
      },
      "StatusAttributeString": "OK",
      "ValidationErrors": []
    }
  ]
}

@andrews05 - thank you for the feedback.

We've updated the OpenAPI spec
https://github.com/XeroAPI/Xero-OpenAPI/releases/tag/2.2.1

@SidneyAllen Thanks heaps!
It's still missing the summarizeErrors parameter though? So is createPayment.
guess being singular methods it's not so important to disable summarize for these, but personally I prefer to leave summarize off for all methods, even if just for consistency.

@andrews05

Both createOverpaymentAllocations and createPrepaymentAllocations has summarizeErrors

I won't be adding summarize error to createPayment as it's a singular method and there is a createPayments which does have summarizeErrors

Is there another method I'm missing?

@SidneyAllen Yes, createCreditNoteAllocation is missing it.

Thank you :)