You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+79-29Lines changed: 79 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,7 @@ const fivaldi = new FivaldiApiClient({
44
44
timeout:120000
45
45
});
46
46
```
47
+
47
48
## Usage
48
49
49
50
To make API requests to certain company, the API client needs id for the company, which is called `cuid`.
@@ -53,21 +54,23 @@ Fivaldi API client has few general root methods that you can use without cuid. T
53
54
### Root methods
54
55
55
56
If you don't know the cuid of the company you want to access to with the API, you can fetch it with root methods. Easiest way is to search the company's info by `businessId` (y-tunnus):
If you don't know the business id of the company or you want to see all the customers your partner id has access to, you can use `getCustomers()` method.
62
63
64
+
If you don't know the business id of the company or you want to see all the customers your partner id has access to, you can use `getCustomers()` method.
63
65
64
-
:heavy_exclamation_mark:**_NOTE:_** One partner id can have access to multiple customers. One customer can have access to multiple companies.
65
-
66
+
:heavy*exclamation_mark: \*\*\_NOTE:*\*\* One partner id can have access to multiple customers. One customer can have access to multiple companies.
66
67
67
68
```ts
68
69
const customers =awaitfivaldi.getCustomers();
69
70
```
71
+
70
72
Then you can use `getCompanies()` again to search all the companies that certain customer has access to.
73
+
71
74
```ts
72
75
// See all the companies chosen customer has access to
0 commit comments