Comments (7)
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.
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.
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.
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.
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 throwsSystem.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.
Will do, will also check why there is a limit of only 5 references and if it can be increased.
from csharp-api-sdk.
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)
- Language is missing in Order and Offert HOT 1
- CurrencySearch should not have LastModified as search parameter HOT 2
- version history HOT 1
- Using `StandardAuth` for backend automations without user interaction HOT 6
- Casting issue in Invoice-entity HOT 7
- More Sources for payments
- Add WebshopArticle to ArticleSearch HOT 1
- How to check for the expiry of the RefreshToken? HOT 2
- EmploymentForm SVT missing in SDK HOT 5
- RateLimiter not working when auth is controlled by DelegatingHandler HOT 3
- TaxReductionAmounts in Green Technology HOT 1
- Employee Creation returns Object cannot be Null HOT 7
- Property or indexer 'VoucherRow.Description' cannot be assigned to -- it is read only HOT 4
- Not availability of the VATCode key in the SDK HOT 1
- Failed to format date. Not given in any of the valid formats. HOT 1
- CustomerSearch on Phone HOT 1
- Missing Order.TotalToPay field - is the SDK up to date with the API?
- Limit setting on search queries - seems hardcoded to 100 records? HOT 2
- Invoice - Setting DueDate to null does not omit the field from JSON. HOT 2
- Wrong VAT on some articles HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csharp-api-sdk.