@p7m/billing-backend 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,176 @@
1
+ # @p7m/billing-backend
2
+
3
+ BillingBackend - JavaScript client for @p7m/billing-backend
4
+ # API for managing billing of customers
5
+
6
+ The purpose of this API is to manage customers, articles, recurring billing, and payments.
7
+
8
+ The caller has to be authenticated with the system and provide a JWT token in the Authorization header of
9
+ the HTTP request. When using the API you typically get this token by authenticating first with OAuth 2.0.
10
+
11
+ When you are trying this API using the Swagger interface, you need to click the `Authorize` button and then again
12
+ the Authorize button in the pop-up that gets opened.
13
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
14
+
15
+ - API version: 0.1.1
16
+ - Package version: 0.1.1
17
+ - Generator version: 7.13.0-SNAPSHOT
18
+ - Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
19
+
20
+ ## Installation
21
+
22
+ ### For [Node.js](https://nodejs.org/)
23
+
24
+ #### npm
25
+
26
+ To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
27
+
28
+ Then install it via:
29
+
30
+ ```shell
31
+ npm install @p7m/billing-backend --save
32
+ ```
33
+
34
+ Finally, you need to build the module:
35
+
36
+ ```shell
37
+ npm run build
38
+ ```
39
+
40
+ ##### Local development
41
+
42
+ To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:
43
+
44
+ ```shell
45
+ npm install
46
+ ```
47
+
48
+ Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:
49
+
50
+ ```shell
51
+ npm link
52
+ ```
53
+
54
+ To use the link you just defined in your project, switch to the directory you want to use your @p7m/billing-backend from, and run:
55
+
56
+ ```shell
57
+ npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
58
+ ```
59
+
60
+ Finally, you need to build the module:
61
+
62
+ ```shell
63
+ npm run build
64
+ ```
65
+
66
+ #### git
67
+
68
+ If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID
69
+ then install it via:
70
+
71
+ ```shell
72
+ npm install GIT_USER_ID/GIT_REPO_ID --save
73
+ ```
74
+
75
+ ### For browser
76
+
77
+ The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
78
+ the above steps with Node.js and installing browserify with `npm install -g browserify`,
79
+ perform the following (assuming *main.js* is your entry file):
80
+
81
+ ```shell
82
+ browserify main.js > bundle.js
83
+ ```
84
+
85
+ Then include *bundle.js* in the HTML pages.
86
+
87
+ ### Webpack Configuration
88
+
89
+ Using Webpack you may encounter the following error: "Module not found: Error:
90
+ Cannot resolve module", most certainly you should disable AMD loader. Add/merge
91
+ the following section to your webpack config:
92
+
93
+ ```javascript
94
+ module: {
95
+ rules: [
96
+ {
97
+ parser: {
98
+ amd: false
99
+ }
100
+ }
101
+ ]
102
+ }
103
+ ```
104
+
105
+ ## Getting Started
106
+
107
+ Please follow the [installation](#installation) instruction and execute the following JS code:
108
+
109
+ ```javascript
110
+ var BillingBackend = require('@p7m/billing-backend');
111
+
112
+ var defaultClient = BillingBackend.ApiClient.instance;
113
+ // Configure OAuth2 access token for authorization: oauth
114
+ var oauth = defaultClient.authentications['oauth'];
115
+ oauth.accessToken = "YOUR ACCESS TOKEN"
116
+
117
+ var api = new BillingBackend.BankAccountApi()
118
+ api.getBankAccounts().then(function(data) {
119
+ console.log('API called successfully. Returned data: ' + data);
120
+ }, function(error) {
121
+ console.error(error);
122
+ });
123
+
124
+
125
+ ```
126
+
127
+ ## Documentation for API Endpoints
128
+
129
+ All URIs are relative to *https://billing.api.p7m.de/v1*
130
+
131
+ Class | Method | HTTP request | Description
132
+ ------------ | ------------- | ------------- | -------------
133
+ *BillingBackend.BankAccountApi* | [**getBankAccounts**](docs/BankAccountApi.md#getBankAccounts) | **GET** /bankaccounts | Get a list of all bank accounts
134
+ *BillingBackend.BankAccountApi* | [**postBankAccounts**](docs/BankAccountApi.md#postBankAccounts) | **POST** /bankaccounts | Create a new bank account
135
+ *BillingBackend.CustomerApi* | [**getCustomers**](docs/CustomerApi.md#getCustomers) | **GET** /customers | Get a list of all customers
136
+ *BillingBackend.CustomerApi* | [**getCustomersId**](docs/CustomerApi.md#getCustomersId) | **GET** /customers/{customer_id} | Request a single customer by its ID
137
+ *BillingBackend.CustomerApi* | [**postCustomers**](docs/CustomerApi.md#postCustomers) | **POST** /customers | Create a new customer
138
+ *BillingBackend.CustomerApi* | [**pubCustomersId**](docs/CustomerApi.md#pubCustomersId) | **PUT** /customers/{customer_id} | Update an existing customer
139
+ *BillingBackend.InvoiceApi* | [**getCurrencies**](docs/InvoiceApi.md#getCurrencies) | **GET** /currencies | Get a list of all (available) currencies
140
+ *BillingBackend.InvoiceApi* | [**getInvoices**](docs/InvoiceApi.md#getInvoices) | **GET** /invoices | Get a list of all invoices
141
+ *BillingBackend.InvoiceApi* | [**getInvoicesId**](docs/InvoiceApi.md#getInvoicesId) | **GET** /invoices/{invoice_id} | Get a single invoice by its ID
142
+ *BillingBackend.InvoiceApi* | [**postInvoices**](docs/InvoiceApi.md#postInvoices) | **POST** /invoices | Create a new invoice
143
+ *BillingBackend.InvoiceApi* | [**postInvoicesInvoiceId**](docs/InvoiceApi.md#postInvoicesInvoiceId) | **POST** /invoices/{invoice_id} | Create a new invoice position
144
+
145
+
146
+ ## Documentation for Models
147
+
148
+ - [BillingBackend.BankAccount](docs/BankAccount.md)
149
+ - [BillingBackend.BankAccountData](docs/BankAccountData.md)
150
+ - [BillingBackend.Currency](docs/Currency.md)
151
+ - [BillingBackend.CurrencyData](docs/CurrencyData.md)
152
+ - [BillingBackend.Customer](docs/Customer.md)
153
+ - [BillingBackend.CustomerData](docs/CustomerData.md)
154
+ - [BillingBackend.DetailedInvoice](docs/DetailedInvoice.md)
155
+ - [BillingBackend.Invoice](docs/Invoice.md)
156
+ - [BillingBackend.InvoiceData](docs/InvoiceData.md)
157
+ - [BillingBackend.InvoicePosition](docs/InvoicePosition.md)
158
+ - [BillingBackend.NewBankAccount](docs/NewBankAccount.md)
159
+ - [BillingBackend.NewCustomer](docs/NewCustomer.md)
160
+ - [BillingBackend.NewInvoice](docs/NewInvoice.md)
161
+ - [BillingBackend.NewInvoicePosition](docs/NewInvoicePosition.md)
162
+ - [BillingBackend.Salutation](docs/Salutation.md)
163
+
164
+
165
+ ## Documentation for Authorization
166
+
167
+
168
+ Authentication schemes defined for the API:
169
+ ### oauth
170
+
171
+
172
+ - **Type**: OAuth
173
+ - **Flow**: accessCode
174
+ - **Authorization URL**: https://login.p7m.de/auth/authorize
175
+ - **Scopes**: N/A
176
+