Giter VIP home page Giter VIP logo

Comments (7)

richardrandak avatar richardrandak commented on July 17, 2024 1

Aha, so the error with creating the references was not about the total limit of 60 but due to limit of 5 per customer. That make sense :) I did a wrong assumption. Thank you for clearing it out for me.

As you said, unfortunately, the total number of items is not available, so the unlimited page (Limit == -1) can't be implemented. That's why I make it to throw the exception. In theory, it could implemented it as you say, with looping until there are no results). I will consider it, so that it will be (for the SDK consumer) appear consistent with other endpoints.

If you have energy and time, you can ask the Fortnox support regarding the pagination metadata for this endpoint, whether that's something they plan to implement on the server-side :)

from csharp-api-sdk.

richardrandak avatar richardrandak commented on July 17, 2024

Hi!
It seems to be new and it is not implemented. I have briefly looked at it, but this endpoint seems buggy and inconsistent, making it pain to implement :-/
I could make some prototype version so you can try it out.
I am not really sure what the customer reference actually represent.. can you tell me when / where is it used?

from csharp-api-sdk.

martenw avatar martenw commented on July 17, 2024

Hi,

Ok, in what way is it buggy? Do you think it can still be used? I can definitely try out a prototype version.

You can see the list of references in the image posted above, predefined references are a list of contacts (persons) on a customer (company), typically you have the same couple of people that you work with at a customer, so when creating an invoice or order for a customer you can select from a list of predefined names instead of writing as free text every time.

And the requirement I have is that i have name/email of a person that I need to find the customer for, so basically search all references of all customers to find the right one (if that is possible).

from csharp-api-sdk.

richardrandak avatar richardrandak commented on July 17, 2024

Well, not buggy, but confusing.. anyway, I have implemented the connector which tries to hide these inconsistencies.
You can try it out with preview version

As usual, you get the connector by calling var connector = FortnoxClient.CustomerReferenceConnector;

For your requirement, you can call FindAsync to get list of the references.. then you have to go through them yourself to filter according your requirement. The limit/offset/page seems to work, but paging metadata are not returned by the server. From my investigation, only 60 entries are allowed, after that, creating a new one fails.

from csharp-api-sdk.

martenw avatar martenw commented on July 17, 2024

Done some tests now and everything seems to work great, some notes (related to the api, not this implementation):

  • Max number of references per customer is 5 (same as possible to set in Fortnox UI)
  • Found in testing that page size ix max 500 when calling CustomerReferenceConnector.FindAsync, I tried with -1 that can be used on other entities to get all but that throws System.NotImplementedException: Unlimited page is not supported due to missing paging metadata.

There is no info about total number of items available in the response of the first page so I had to loop pages until no more values are returned to get all references, but that will work.

Thank you for a really quick implementation of this!!

from csharp-api-sdk.

martenw avatar martenw commented on July 17, 2024

Will do, will also check why there is a limit of only 5 references and if it can be increased.

from csharp-api-sdk.

martenw avatar martenw commented on July 17, 2024

Got a reply now from Fortnox:

There are plans for both parts you mention, but I don't have a release date right now unfortunately.

So, we will probably get both additional references and better endpoint in the future.

from csharp-api-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.