pnap_invoicing_api 1.0.0
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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +153 -0
- data/Rakefile +10 -0
- data/VERSION +1 -0
- data/docs/Error.md +20 -0
- data/docs/Invoice.md +32 -0
- data/docs/InvoicesApi.md +307 -0
- data/docs/PaginatedInvoices.md +24 -0
- data/docs/PaginatedResponse.md +22 -0
- data/lib/pnap_invoicing_api/api/invoices_api.rb +323 -0
- data/lib/pnap_invoicing_api/api_client.rb +397 -0
- data/lib/pnap_invoicing_api/api_error.rb +58 -0
- data/lib/pnap_invoicing_api/configuration.rb +298 -0
- data/lib/pnap_invoicing_api/models/error.rb +234 -0
- data/lib/pnap_invoicing_api/models/invoice.rb +341 -0
- data/lib/pnap_invoicing_api/models/paginated_invoices.rb +281 -0
- data/lib/pnap_invoicing_api/models/paginated_response.rb +256 -0
- data/lib/pnap_invoicing_api/version.rb +19 -0
- data/lib/pnap_invoicing_api.rb +44 -0
- data/pnap_invoicing_api.gemspec +39 -0
- data/spec/api/invoices_api_spec.rb +91 -0
- data/spec/models/error_spec.rb +42 -0
- data/spec/models/invoice_spec.rb +78 -0
- data/spec/models/paginated_invoices_spec.rb +54 -0
- data/spec/models/paginated_response_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- metadata +116 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a32817deaf98f40b7bde7e579154b8eb31809d06294e6843338863785b601b62
|
4
|
+
data.tar.gz: 98d2ee76805c252b167388ae87941dc9712c33036d9047ad6c8827941b7ee1dd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 805036b6f1e81cd471f2bacda5d862aea306319c87fdda326a06cd20b7628e9ee2f29217639cfb1c3bee52d9984ce58c85eecc12a7da0c5d6baa64c458e28d4f
|
7
|
+
data.tar.gz: ca9aa3410d1d4a2063eada1ffbf8440219da161ca65cdbc19abd1c5cba30ff83dcfda2f885015cfaf3e8164e2127b7a9a7fc9ff140e4375f5ee17f3fc48d6f12
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
# pnap_invoicing_api
|
2
|
+
|
3
|
+
InvoicingApi - the Ruby gem for the Invoicing API
|
4
|
+
|
5
|
+
List, fetch and pay invoices with the Invoicing API.
|
6
|
+
|
7
|
+
|
8
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
9
|
+
|
10
|
+
- API version: 1.0
|
11
|
+
For more information, please visit [https://phoenixnap.com/](https://phoenixnap.com/)
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
### Build a gem
|
16
|
+
|
17
|
+
To build the Ruby code into a gem:
|
18
|
+
|
19
|
+
```shell
|
20
|
+
gem build pnap_invoicing_api.gemspec
|
21
|
+
```
|
22
|
+
|
23
|
+
Then either install the gem locally, replacing `<VERSION>` with the actual version:
|
24
|
+
|
25
|
+
```shell
|
26
|
+
gem install ./pnap_invoicing_api-<VERSION>.gem
|
27
|
+
```
|
28
|
+
|
29
|
+
(for development, run `gem install --dev ./pnap_invoicing_api-<VERSION>.gem` to install the development dependencies)
|
30
|
+
|
31
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
32
|
+
|
33
|
+
Finally add this to the Gemfile:
|
34
|
+
|
35
|
+
gem 'pnap_invoicing_api', '~> <VERSION>'
|
36
|
+
|
37
|
+
### Install from Git
|
38
|
+
|
39
|
+
To install this Gem from this repository, you'll need to get Bundler by doing `gem install bundler`. Add the following line in your Gemfile:
|
40
|
+
|
41
|
+
gem 'pnap_invoicing_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'InvoicingApi/*.gemspec'
|
42
|
+
|
43
|
+
If you'd like the development version:
|
44
|
+
|
45
|
+
gem 'pnap_invoicing_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'InvoicingApi/*.gemspec', branch: 'develop'
|
46
|
+
|
47
|
+
Then run `bundle install`.
|
48
|
+
|
49
|
+
### Include the Ruby code directly
|
50
|
+
|
51
|
+
Include the Ruby code directly using `-I` as follows:
|
52
|
+
|
53
|
+
```shell
|
54
|
+
ruby -Ilib script.rb
|
55
|
+
```
|
56
|
+
|
57
|
+
## Getting Started
|
58
|
+
|
59
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
# Load the gem
|
63
|
+
require 'pnap_invoicing_api'
|
64
|
+
|
65
|
+
# Setup authorization
|
66
|
+
InvoicingApi.configure do |config|
|
67
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
68
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
69
|
+
# Configure a proc to get access tokens in lieu of the static access_token configuration
|
70
|
+
config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' }
|
71
|
+
end
|
72
|
+
|
73
|
+
api_instance = InvoicingApi::InvoicesApi.new
|
74
|
+
opts = {
|
75
|
+
number: '13218-1180326', # String | A user-friendly reference number assigned to the invoice.
|
76
|
+
status: 'PAID', # String | Payment status of the invoice.
|
77
|
+
sent_on_from: Time.parse('2020-04-13T00:00:00.000Z'), # Time | Minimum value to filter invoices by sent on date.
|
78
|
+
sent_on_to: Time.parse('2022-04-13T00:00:00.000Z'), # Time | Maximum value to filter invoices by sent on date.
|
79
|
+
limit: 25, # Integer | The limit of the number of results returned. The number of records returned may be smaller than the limit.
|
80
|
+
offset: 5, # Integer | The number of items to skip in the results.
|
81
|
+
sort_field: 'number', # String | If a sortField is requested, pagination will be done after sorting. Default sorting is by number.
|
82
|
+
sort_direction: 'ASC' # String | Sort Given Field depending on the desired direction. Default sorting is descending.
|
83
|
+
}
|
84
|
+
|
85
|
+
begin
|
86
|
+
#List invoices.
|
87
|
+
result = api_instance.invoices_get(opts)
|
88
|
+
p result
|
89
|
+
rescue InvoicingApi::ApiError => e
|
90
|
+
puts "Exception when calling InvoicesApi->invoices_get: #{e}"
|
91
|
+
end
|
92
|
+
|
93
|
+
```
|
94
|
+
|
95
|
+
Authorization can also be setup by using the [`oauth`](https://github.com/oauth-xx/oauth2) library:
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
# Load the gem
|
99
|
+
require 'pnap_invoicing_api'
|
100
|
+
require 'oauth2'
|
101
|
+
|
102
|
+
# Setup variables for getting a token.
|
103
|
+
client_id = 'YOUR_CLIENT_ID'
|
104
|
+
client_secret = 'YOUR_CLIENT_SECRET'
|
105
|
+
auth_url = 'https://auth.phoenixnap.com/auth/realms/BMC/protocol/openid-connect/token'
|
106
|
+
|
107
|
+
|
108
|
+
# Setup authorization
|
109
|
+
InvoicingApi.configure do |config|
|
110
|
+
# Retrieve the token using OAuth2.
|
111
|
+
client = OAuth2::Client.new(client_id, client_secret, token_url: auth_url)
|
112
|
+
token = client.client_credentials.get_token
|
113
|
+
|
114
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
115
|
+
config.access_token = token.token
|
116
|
+
end
|
117
|
+
|
118
|
+
```
|
119
|
+
|
120
|
+
## Documentation for API Endpoints
|
121
|
+
|
122
|
+
All URIs are relative to *https://api.phoenixnap.com/invoicing/v1*
|
123
|
+
|
124
|
+
Class | Method | HTTP request | Description
|
125
|
+
------------ | ------------- | ------------- | -------------
|
126
|
+
*InvoicingApi::InvoicesApi* | [**invoices_get**](docs/InvoicesApi.md#invoices_get) | **GET** /invoices | List invoices.
|
127
|
+
*InvoicingApi::InvoicesApi* | [**invoices_invoice_id_generate_pdf_post**](docs/InvoicesApi.md#invoices_invoice_id_generate_pdf_post) | **POST** /invoices/{invoiceId}/actions/generate-pdf | Generate invoice details as PDF.
|
128
|
+
*InvoicingApi::InvoicesApi* | [**invoices_invoice_id_get**](docs/InvoicesApi.md#invoices_invoice_id_get) | **GET** /invoices/{invoiceId} | Get invoice details.
|
129
|
+
*InvoicingApi::InvoicesApi* | [**invoices_invoice_id_pay_post**](docs/InvoicesApi.md#invoices_invoice_id_pay_post) | **POST** /invoices/{invoiceId}/actions/pay | Pay an invoice.
|
130
|
+
|
131
|
+
|
132
|
+
## Documentation for Models
|
133
|
+
|
134
|
+
- [InvoicingApi::Error](docs/Error.md)
|
135
|
+
- [InvoicingApi::Invoice](docs/Invoice.md)
|
136
|
+
- [InvoicingApi::PaginatedInvoices](docs/PaginatedInvoices.md)
|
137
|
+
- [InvoicingApi::PaginatedResponse](docs/PaginatedResponse.md)
|
138
|
+
|
139
|
+
|
140
|
+
## Documentation for Authorization
|
141
|
+
|
142
|
+
|
143
|
+
Authentication schemes defined for the API:
|
144
|
+
### OAuth2
|
145
|
+
|
146
|
+
|
147
|
+
- **Type**: OAuth
|
148
|
+
- **Flow**: application
|
149
|
+
- **Authorization URL**:
|
150
|
+
- **Scopes**:
|
151
|
+
- invoices: Grants full access to Invoicing API.
|
152
|
+
- invoices.read: Grants read only access to Invoicing API.
|
153
|
+
|
data/Rakefile
ADDED
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
data/docs/Error.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# InvoicingApi::Error
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **message** | **String** | The description detailing the cause of the error code. | [readonly] |
|
8
|
+
| **validation_errors** | **Array<String>** | Validation errors, if any. | [optional][readonly] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'pnap_invoicing_api'
|
14
|
+
|
15
|
+
instance = InvoicingApi::Error.new(
|
16
|
+
message: null,
|
17
|
+
validation_errors: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
data/docs/Invoice.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# InvoicingApi::Invoice
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **String** | The unique resource identifier of the Invoice. | |
|
8
|
+
| **number** | **String** | A user-friendly reference number assigned to the invoice. | |
|
9
|
+
| **currency** | **String** | The currency of the invoice. Currently, this field should be set to `EUR` or `USD`. | |
|
10
|
+
| **amount** | **Float** | The invoice amount. | |
|
11
|
+
| **outstanding_amount** | **Float** | The invoice outstanding amount. | |
|
12
|
+
| **status** | **String** | The status of the invoice. Currently, this field should be set to `PAID`, `OVERDUE`, `PROCESSING_PAYMENT`, or `UNPAID`. | |
|
13
|
+
| **sent_on** | **Time** | Date and time when the invoice was sent. | |
|
14
|
+
| **due_date** | **Time** | Date and time when the invoice payment is due. | |
|
15
|
+
|
16
|
+
## Example
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
require 'pnap_invoicing_api'
|
20
|
+
|
21
|
+
instance = InvoicingApi::Invoice.new(
|
22
|
+
id: 5fa54d1e91867c03a0a7b4a4,
|
23
|
+
number: 34440-2488782,
|
24
|
+
currency: EUR,
|
25
|
+
amount: 100.99,
|
26
|
+
outstanding_amount: 100.99,
|
27
|
+
status: UNPAID,
|
28
|
+
sent_on: 2021-03-13T20:24:32.491Z,
|
29
|
+
due_date: 2021-04-13T20:24:32.491Z
|
30
|
+
)
|
31
|
+
```
|
32
|
+
|
data/docs/InvoicesApi.md
ADDED
@@ -0,0 +1,307 @@
|
|
1
|
+
# InvoicingApi::InvoicesApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api.phoenixnap.com/invoicing/v1*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**invoices_get**](InvoicesApi.md#invoices_get) | **GET** /invoices | List invoices. |
|
8
|
+
| [**invoices_invoice_id_generate_pdf_post**](InvoicesApi.md#invoices_invoice_id_generate_pdf_post) | **POST** /invoices/{invoiceId}/actions/generate-pdf | Generate invoice details as PDF. |
|
9
|
+
| [**invoices_invoice_id_get**](InvoicesApi.md#invoices_invoice_id_get) | **GET** /invoices/{invoiceId} | Get invoice details. |
|
10
|
+
| [**invoices_invoice_id_pay_post**](InvoicesApi.md#invoices_invoice_id_pay_post) | **POST** /invoices/{invoiceId}/actions/pay | Pay an invoice. |
|
11
|
+
|
12
|
+
|
13
|
+
## invoices_get
|
14
|
+
|
15
|
+
> <PaginatedInvoices> invoices_get(opts)
|
16
|
+
|
17
|
+
List invoices.
|
18
|
+
|
19
|
+
List invoices.
|
20
|
+
|
21
|
+
### Examples
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'time'
|
25
|
+
require 'pnap_invoicing_api'
|
26
|
+
# setup authorization
|
27
|
+
InvoicingApi.configure do |config|
|
28
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
29
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
30
|
+
end
|
31
|
+
|
32
|
+
api_instance = InvoicingApi::InvoicesApi.new
|
33
|
+
opts = {
|
34
|
+
number: '13218-1180326', # String | A user-friendly reference number assigned to the invoice.
|
35
|
+
status: 'PAID', # String | Payment status of the invoice.
|
36
|
+
sent_on_from: Time.parse('2020-04-13T00:00:00.000Z'), # Time | Minimum value to filter invoices by sent on date.
|
37
|
+
sent_on_to: Time.parse('2022-04-13T00:00:00.000Z'), # Time | Maximum value to filter invoices by sent on date.
|
38
|
+
limit: 25, # Integer | The limit of the number of results returned. The number of records returned may be smaller than the limit.
|
39
|
+
offset: 5, # Integer | The number of items to skip in the results.
|
40
|
+
sort_field: 'number', # String | If a sortField is requested, pagination will be done after sorting. Default sorting is by number.
|
41
|
+
sort_direction: 'ASC' # String | Sort Given Field depending on the desired direction. Default sorting is descending.
|
42
|
+
}
|
43
|
+
|
44
|
+
begin
|
45
|
+
# List invoices.
|
46
|
+
result = api_instance.invoices_get(opts)
|
47
|
+
p result
|
48
|
+
rescue InvoicingApi::ApiError => e
|
49
|
+
puts "Error when calling InvoicesApi->invoices_get: #{e}"
|
50
|
+
end
|
51
|
+
```
|
52
|
+
|
53
|
+
#### Using the invoices_get_with_http_info variant
|
54
|
+
|
55
|
+
This returns an Array which contains the response data, status code and headers.
|
56
|
+
|
57
|
+
> <Array(<PaginatedInvoices>, Integer, Hash)> invoices_get_with_http_info(opts)
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
begin
|
61
|
+
# List invoices.
|
62
|
+
data, status_code, headers = api_instance.invoices_get_with_http_info(opts)
|
63
|
+
p status_code # => 2xx
|
64
|
+
p headers # => { ... }
|
65
|
+
p data # => <PaginatedInvoices>
|
66
|
+
rescue InvoicingApi::ApiError => e
|
67
|
+
puts "Error when calling InvoicesApi->invoices_get_with_http_info: #{e}"
|
68
|
+
end
|
69
|
+
```
|
70
|
+
|
71
|
+
### Parameters
|
72
|
+
|
73
|
+
| Name | Type | Description | Notes |
|
74
|
+
| ---- | ---- | ----------- | ----- |
|
75
|
+
| **number** | **String** | A user-friendly reference number assigned to the invoice. | [optional] |
|
76
|
+
| **status** | **String** | Payment status of the invoice. | [optional] |
|
77
|
+
| **sent_on_from** | **Time** | Minimum value to filter invoices by sent on date. | [optional] |
|
78
|
+
| **sent_on_to** | **Time** | Maximum value to filter invoices by sent on date. | [optional] |
|
79
|
+
| **limit** | **Integer** | The limit of the number of results returned. The number of records returned may be smaller than the limit. | [optional][default to 100] |
|
80
|
+
| **offset** | **Integer** | The number of items to skip in the results. | [optional][default to 0] |
|
81
|
+
| **sort_field** | **String** | If a sortField is requested, pagination will be done after sorting. Default sorting is by number. | [optional][default to 'sentOn'] |
|
82
|
+
| **sort_direction** | **String** | Sort Given Field depending on the desired direction. Default sorting is descending. | [optional][default to 'DESC'] |
|
83
|
+
|
84
|
+
### Return type
|
85
|
+
|
86
|
+
[**PaginatedInvoices**](PaginatedInvoices.md)
|
87
|
+
|
88
|
+
### Authorization
|
89
|
+
|
90
|
+
[OAuth2](../README.md#OAuth2)
|
91
|
+
|
92
|
+
### HTTP request headers
|
93
|
+
|
94
|
+
- **Content-Type**: Not defined
|
95
|
+
- **Accept**: application/json
|
96
|
+
|
97
|
+
|
98
|
+
## invoices_invoice_id_generate_pdf_post
|
99
|
+
|
100
|
+
> File invoices_invoice_id_generate_pdf_post(invoice_id)
|
101
|
+
|
102
|
+
Generate invoice details as PDF.
|
103
|
+
|
104
|
+
Generate invoice details as PDF.
|
105
|
+
|
106
|
+
### Examples
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
require 'time'
|
110
|
+
require 'pnap_invoicing_api'
|
111
|
+
# setup authorization
|
112
|
+
InvoicingApi.configure do |config|
|
113
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
114
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
115
|
+
end
|
116
|
+
|
117
|
+
api_instance = InvoicingApi::InvoicesApi.new
|
118
|
+
invoice_id = '5fa54d1e91867c03a0a7b4a4' # String | The unique resource identifier of the Invoice.
|
119
|
+
|
120
|
+
begin
|
121
|
+
# Generate invoice details as PDF.
|
122
|
+
result = api_instance.invoices_invoice_id_generate_pdf_post(invoice_id)
|
123
|
+
p result
|
124
|
+
rescue InvoicingApi::ApiError => e
|
125
|
+
puts "Error when calling InvoicesApi->invoices_invoice_id_generate_pdf_post: #{e}"
|
126
|
+
end
|
127
|
+
```
|
128
|
+
|
129
|
+
#### Using the invoices_invoice_id_generate_pdf_post_with_http_info variant
|
130
|
+
|
131
|
+
This returns an Array which contains the response data, status code and headers.
|
132
|
+
|
133
|
+
> <Array(File, Integer, Hash)> invoices_invoice_id_generate_pdf_post_with_http_info(invoice_id)
|
134
|
+
|
135
|
+
```ruby
|
136
|
+
begin
|
137
|
+
# Generate invoice details as PDF.
|
138
|
+
data, status_code, headers = api_instance.invoices_invoice_id_generate_pdf_post_with_http_info(invoice_id)
|
139
|
+
p status_code # => 2xx
|
140
|
+
p headers # => { ... }
|
141
|
+
p data # => File
|
142
|
+
rescue InvoicingApi::ApiError => e
|
143
|
+
puts "Error when calling InvoicesApi->invoices_invoice_id_generate_pdf_post_with_http_info: #{e}"
|
144
|
+
end
|
145
|
+
```
|
146
|
+
|
147
|
+
### Parameters
|
148
|
+
|
149
|
+
| Name | Type | Description | Notes |
|
150
|
+
| ---- | ---- | ----------- | ----- |
|
151
|
+
| **invoice_id** | **String** | The unique resource identifier of the Invoice. | |
|
152
|
+
|
153
|
+
### Return type
|
154
|
+
|
155
|
+
**File**
|
156
|
+
|
157
|
+
### Authorization
|
158
|
+
|
159
|
+
[OAuth2](../README.md#OAuth2)
|
160
|
+
|
161
|
+
### HTTP request headers
|
162
|
+
|
163
|
+
- **Content-Type**: Not defined
|
164
|
+
- **Accept**: application/pdf, application/json
|
165
|
+
|
166
|
+
|
167
|
+
## invoices_invoice_id_get
|
168
|
+
|
169
|
+
> <Invoice> invoices_invoice_id_get(invoice_id)
|
170
|
+
|
171
|
+
Get invoice details.
|
172
|
+
|
173
|
+
Get invoice details.
|
174
|
+
|
175
|
+
### Examples
|
176
|
+
|
177
|
+
```ruby
|
178
|
+
require 'time'
|
179
|
+
require 'pnap_invoicing_api'
|
180
|
+
# setup authorization
|
181
|
+
InvoicingApi.configure do |config|
|
182
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
183
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
184
|
+
end
|
185
|
+
|
186
|
+
api_instance = InvoicingApi::InvoicesApi.new
|
187
|
+
invoice_id = '5fa54d1e91867c03a0a7b4a4' # String | The unique resource identifier of the Invoice.
|
188
|
+
|
189
|
+
begin
|
190
|
+
# Get invoice details.
|
191
|
+
result = api_instance.invoices_invoice_id_get(invoice_id)
|
192
|
+
p result
|
193
|
+
rescue InvoicingApi::ApiError => e
|
194
|
+
puts "Error when calling InvoicesApi->invoices_invoice_id_get: #{e}"
|
195
|
+
end
|
196
|
+
```
|
197
|
+
|
198
|
+
#### Using the invoices_invoice_id_get_with_http_info variant
|
199
|
+
|
200
|
+
This returns an Array which contains the response data, status code and headers.
|
201
|
+
|
202
|
+
> <Array(<Invoice>, Integer, Hash)> invoices_invoice_id_get_with_http_info(invoice_id)
|
203
|
+
|
204
|
+
```ruby
|
205
|
+
begin
|
206
|
+
# Get invoice details.
|
207
|
+
data, status_code, headers = api_instance.invoices_invoice_id_get_with_http_info(invoice_id)
|
208
|
+
p status_code # => 2xx
|
209
|
+
p headers # => { ... }
|
210
|
+
p data # => <Invoice>
|
211
|
+
rescue InvoicingApi::ApiError => e
|
212
|
+
puts "Error when calling InvoicesApi->invoices_invoice_id_get_with_http_info: #{e}"
|
213
|
+
end
|
214
|
+
```
|
215
|
+
|
216
|
+
### Parameters
|
217
|
+
|
218
|
+
| Name | Type | Description | Notes |
|
219
|
+
| ---- | ---- | ----------- | ----- |
|
220
|
+
| **invoice_id** | **String** | The unique resource identifier of the Invoice. | |
|
221
|
+
|
222
|
+
### Return type
|
223
|
+
|
224
|
+
[**Invoice**](Invoice.md)
|
225
|
+
|
226
|
+
### Authorization
|
227
|
+
|
228
|
+
[OAuth2](../README.md#OAuth2)
|
229
|
+
|
230
|
+
### HTTP request headers
|
231
|
+
|
232
|
+
- **Content-Type**: Not defined
|
233
|
+
- **Accept**: application/json
|
234
|
+
|
235
|
+
|
236
|
+
## invoices_invoice_id_pay_post
|
237
|
+
|
238
|
+
> Object invoices_invoice_id_pay_post(invoice_id, opts)
|
239
|
+
|
240
|
+
Pay an invoice.
|
241
|
+
|
242
|
+
Manually pay an invoice.
|
243
|
+
|
244
|
+
### Examples
|
245
|
+
|
246
|
+
```ruby
|
247
|
+
require 'time'
|
248
|
+
require 'pnap_invoicing_api'
|
249
|
+
# setup authorization
|
250
|
+
InvoicingApi.configure do |config|
|
251
|
+
# Configure OAuth2 access token for authorization: OAuth2
|
252
|
+
config.access_token = 'YOUR ACCESS TOKEN'
|
253
|
+
end
|
254
|
+
|
255
|
+
api_instance = InvoicingApi::InvoicesApi.new
|
256
|
+
invoice_id = '5fa54d1e91867c03a0a7b4a4' # String | The unique resource identifier of the Invoice.
|
257
|
+
opts = {
|
258
|
+
body: { ... } # Object |
|
259
|
+
}
|
260
|
+
|
261
|
+
begin
|
262
|
+
# Pay an invoice.
|
263
|
+
result = api_instance.invoices_invoice_id_pay_post(invoice_id, opts)
|
264
|
+
p result
|
265
|
+
rescue InvoicingApi::ApiError => e
|
266
|
+
puts "Error when calling InvoicesApi->invoices_invoice_id_pay_post: #{e}"
|
267
|
+
end
|
268
|
+
```
|
269
|
+
|
270
|
+
#### Using the invoices_invoice_id_pay_post_with_http_info variant
|
271
|
+
|
272
|
+
This returns an Array which contains the response data, status code and headers.
|
273
|
+
|
274
|
+
> <Array(Object, Integer, Hash)> invoices_invoice_id_pay_post_with_http_info(invoice_id, opts)
|
275
|
+
|
276
|
+
```ruby
|
277
|
+
begin
|
278
|
+
# Pay an invoice.
|
279
|
+
data, status_code, headers = api_instance.invoices_invoice_id_pay_post_with_http_info(invoice_id, opts)
|
280
|
+
p status_code # => 2xx
|
281
|
+
p headers # => { ... }
|
282
|
+
p data # => Object
|
283
|
+
rescue InvoicingApi::ApiError => e
|
284
|
+
puts "Error when calling InvoicesApi->invoices_invoice_id_pay_post_with_http_info: #{e}"
|
285
|
+
end
|
286
|
+
```
|
287
|
+
|
288
|
+
### Parameters
|
289
|
+
|
290
|
+
| Name | Type | Description | Notes |
|
291
|
+
| ---- | ---- | ----------- | ----- |
|
292
|
+
| **invoice_id** | **String** | The unique resource identifier of the Invoice. | |
|
293
|
+
| **body** | **Object** | | [optional] |
|
294
|
+
|
295
|
+
### Return type
|
296
|
+
|
297
|
+
**Object**
|
298
|
+
|
299
|
+
### Authorization
|
300
|
+
|
301
|
+
[OAuth2](../README.md#OAuth2)
|
302
|
+
|
303
|
+
### HTTP request headers
|
304
|
+
|
305
|
+
- **Content-Type**: application/json
|
306
|
+
- **Accept**: application/json
|
307
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# InvoicingApi::PaginatedInvoices
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **results** | [**Array<Invoice>**](Invoice.md) | | |
|
8
|
+
| **limit** | **Integer** | Maximum number of items in the page (actual returned length can be less). | |
|
9
|
+
| **offset** | **Integer** | The number of returned items skipped. | |
|
10
|
+
| **total** | **Integer** | The total number of records available for retrieval. | |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'pnap_invoicing_api'
|
16
|
+
|
17
|
+
instance = InvoicingApi::PaginatedInvoices.new(
|
18
|
+
results: null,
|
19
|
+
limit: 5,
|
20
|
+
offset: 25,
|
21
|
+
total: 400
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# InvoicingApi::PaginatedResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **limit** | **Integer** | Maximum number of items in the page (actual returned length can be less). | |
|
8
|
+
| **offset** | **Integer** | The number of returned items skipped. | |
|
9
|
+
| **total** | **Integer** | The total number of records available for retrieval. | |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'pnap_invoicing_api'
|
15
|
+
|
16
|
+
instance = InvoicingApi::PaginatedResponse.new(
|
17
|
+
limit: 5,
|
18
|
+
offset: 25,
|
19
|
+
total: 400
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|