Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add hyperlinks into invoice history notes #724

Open
camnealie opened this issue Sep 30, 2024 · 3 comments
Open

Ability to add hyperlinks into invoice history notes #724

camnealie opened this issue Sep 30, 2024 · 3 comments

Comments

@camnealie
Copy link

SDK you're using (please complete the following information):

  • Version 9.3

Is your feature request related to a problem? Please describe.
When I create invoices, I like to provide a link back to the URL the invoice was created from.

This is possible via the xero web interface (though not shown to the user). Using standard <a href=... links, a hyperlink can be inserted into the text.

Unfortunately, it doesn't appear this is possible via the xero-node package - I've tried with and without escaping characters.

Describe the solution you'd like
The ability to add HTML formatted hyperlinks into invoice notes

Describe alternatives you've considered
At present, I add the url without hyperlink. This allows users to copy/paste the text to follow the link, but that's not ideal!

Additional context
Add any other context or screenshots about the feature request here.

Copy link

PETOSS-608

Copy link

Thanks for raising an issue, a ticket has been created to track your request

@camnealie
Copy link
Author

camnealie commented Sep 30, 2024

Taking a bit of a guess after playing with this for a few hours - the endpoints of the xero site are different than the ones provided for developers.

When I add a note to an invoice in xero, I see the request is like this:

POST https://go.xero.com/api/history/classic-history/notes?timezone=Pacific%2FAuckland
{"body":"I add note <a href=\"/test\"> with a link </a>","
referenceId":"xxxyyy",
"referenceTypeCode":"ACCRECINVOICE",
"createdDate":"2024-09-30T14:42:23.621+13:00"}

But, when we make an API request to do the same, the request is:

PUT https://api.xero.com/api.xro/2.0/Invoices/{{INVOICEID}}/History
{data:   HistoryRecords: [
    {
      Details: 'add a note <a href="/test"> with a link </a>',
      Changes: undefined,
      User: undefined,
      DateUTC: undefined
    }
  ]
}

My suspicion is api.xero.com handles the request differently than go.xero.com/api/, and it manipulates the string before handling it, with the end result looking like:

HistoryRecord {
  details: 'add a note &lt;a href=&quot;/test&quot;&gt; with a link &lt;/a&gt;',
  changes: 'Note',
  user: 'System Generated',
  dateUTC: 2024-09-30T01:47:50.663Z
}

If that's the case, there's not a lot we can do! I haven't been able to find anyone else attempting this yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant