devdraft 1.0.0 → 1.0.2
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 +4 -4
- data/README.md +138 -1073
- data/devdraft_ai_sdk.gemspec +5 -5
- data/example.rb +129 -0
- data/git_push.sh +1 -1
- data/lib/devdraft/api_error.rb +1 -1
- data/lib/devdraft/configuration.rb +1 -1
- data/lib/devdraft/version.rb +2 -2
- metadata +6 -5
data/README.md
CHANGED
@@ -1,1120 +1,185 @@
|
|
1
|
-
#
|
1
|
+
# Devdraft Ruby SDK
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods.
|
6
|
-
|
7
|
-
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
|
-
|
9
|
-
- API version: 1.0.0
|
10
|
-
- Package version: 1.0.0
|
11
|
-
- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen
|
3
|
+
A Ruby client library for the Devdraft Payment & Business Management API.
|
12
4
|
|
13
5
|
## Installation
|
14
6
|
|
15
|
-
|
7
|
+
Add this line to your application's Gemfile:
|
16
8
|
|
17
|
-
|
18
|
-
|
19
|
-
```shell
|
20
|
-
gem build devdraft_ai_sdk.gemspec
|
9
|
+
```ruby
|
10
|
+
gem 'devdraft', '~> 1.0.1'
|
21
11
|
```
|
22
12
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
gem install ./devdraft_ai_sdk-1.0.0.gem
|
13
|
+
And then execute:
|
14
|
+
```bash
|
15
|
+
$ bundle install
|
27
16
|
```
|
28
|
-
(for development, run `gem install --dev ./devdraft_ai_sdk-1.0.0.gem` to install the development dependencies)
|
29
|
-
|
30
|
-
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
31
|
-
|
32
|
-
Finally add this to the Gemfile:
|
33
|
-
|
34
|
-
gem 'devdraft_ai_sdk', '~> 1.0.0'
|
35
|
-
|
36
|
-
### Install from Git
|
37
17
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
### Include the Ruby code directly
|
43
|
-
|
44
|
-
Include the Ruby code directly using `-I` as follows:
|
45
|
-
|
46
|
-
```shell
|
47
|
-
ruby -Ilib script.rb
|
18
|
+
Or install it yourself as:
|
19
|
+
```bash
|
20
|
+
$ gem install devdraft
|
48
21
|
```
|
49
22
|
|
50
|
-
##
|
51
|
-
|
52
|
-
Please follow the [installation](#installation) procedure and then run the following code:
|
53
|
-
```ruby
|
54
|
-
# Load the gem
|
55
|
-
require 'devdraft_ai_sdk'
|
56
|
-
|
57
|
-
api_instance = DevDraftAI::APIHealthApi.new
|
58
|
-
|
59
|
-
begin
|
60
|
-
#Authenticated health check endpoint
|
61
|
-
result = api_instance.health_controller_check_v0
|
62
|
-
p result
|
63
|
-
rescue DevDraftAI::ApiError => e
|
64
|
-
puts "Exception when calling APIHealthApi->health_controller_check_v0: #{e}"
|
65
|
-
end
|
66
|
-
|
67
|
-
api_instance = DevDraftAI::APIHealthApi.new
|
68
|
-
|
69
|
-
begin
|
70
|
-
#Public health check endpoint
|
71
|
-
result = api_instance.health_controller_public_health_check_v0
|
72
|
-
p result
|
73
|
-
rescue DevDraftAI::ApiError => e
|
74
|
-
puts "Exception when calling APIHealthApi->health_controller_public_health_check_v0: #{e}"
|
75
|
-
end
|
76
|
-
# Setup authorization
|
77
|
-
DevDraftAI.configure do |config|
|
78
|
-
# Configure API key authorization: x-client-key
|
79
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
80
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
81
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
82
|
-
|
83
|
-
# Configure API key authorization: x-client-secret
|
84
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
85
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
86
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
87
|
-
end
|
88
|
-
|
89
|
-
api_instance = DevDraftAI::AppBalancesApi.new
|
90
|
-
|
91
|
-
begin
|
92
|
-
#Get all stablecoin balances for an app
|
93
|
-
result = api_instance.balance_controller_get_all_balances
|
94
|
-
p result
|
95
|
-
rescue DevDraftAI::ApiError => e
|
96
|
-
puts "Exception when calling AppBalancesApi->balance_controller_get_all_balances: #{e}"
|
97
|
-
end
|
98
|
-
# Setup authorization
|
99
|
-
DevDraftAI.configure do |config|
|
100
|
-
# Configure API key authorization: x-client-key
|
101
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
102
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
103
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
104
|
-
|
105
|
-
# Configure API key authorization: x-client-secret
|
106
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
107
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
108
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
109
|
-
end
|
110
|
-
|
111
|
-
api_instance = DevDraftAI::AppBalancesApi.new
|
112
|
-
|
113
|
-
begin
|
114
|
-
#Get EURC balance for an app
|
115
|
-
result = api_instance.balance_controller_get_eurc_balance
|
116
|
-
p result
|
117
|
-
rescue DevDraftAI::ApiError => e
|
118
|
-
puts "Exception when calling AppBalancesApi->balance_controller_get_eurc_balance: #{e}"
|
119
|
-
end
|
120
|
-
# Setup authorization
|
121
|
-
DevDraftAI.configure do |config|
|
122
|
-
# Configure API key authorization: x-client-key
|
123
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
124
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
125
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
126
|
-
|
127
|
-
# Configure API key authorization: x-client-secret
|
128
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
129
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
130
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
131
|
-
end
|
132
|
-
|
133
|
-
api_instance = DevDraftAI::AppBalancesApi.new
|
134
|
-
|
135
|
-
begin
|
136
|
-
#Get USDC balance for an app
|
137
|
-
result = api_instance.balance_controller_get_usdc_balance
|
138
|
-
p result
|
139
|
-
rescue DevDraftAI::ApiError => e
|
140
|
-
puts "Exception when calling AppBalancesApi->balance_controller_get_usdc_balance: #{e}"
|
141
|
-
end
|
142
|
-
# Setup authorization
|
143
|
-
DevDraftAI.configure do |config|
|
144
|
-
# Configure API key authorization: x-client-key
|
145
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
146
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
147
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
148
|
-
|
149
|
-
# Configure API key authorization: x-client-secret
|
150
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
151
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
152
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
153
|
-
end
|
154
|
-
|
155
|
-
api_instance = DevDraftAI::CustomersApi.new
|
156
|
-
body = DevDraftAI::CreateCustomerDto.new # CreateCustomerDto | Customer creation data
|
157
|
-
|
158
|
-
|
159
|
-
begin
|
160
|
-
#Create a new customer
|
161
|
-
api_instance.customer_controller_create(body)
|
162
|
-
rescue DevDraftAI::ApiError => e
|
163
|
-
puts "Exception when calling CustomersApi->customer_controller_create: #{e}"
|
164
|
-
end
|
165
|
-
# Setup authorization
|
166
|
-
DevDraftAI.configure do |config|
|
167
|
-
# Configure API key authorization: x-client-key
|
168
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
169
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
170
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
171
|
-
|
172
|
-
# Configure API key authorization: x-client-secret
|
173
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
174
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
175
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
176
|
-
end
|
177
|
-
|
178
|
-
api_instance = DevDraftAI::CustomersApi.new
|
179
|
-
opts = {
|
180
|
-
status: 'status_example', # String | Filter by customer status
|
181
|
-
name: 'name_example', # String | Filter by customer name
|
182
|
-
email: 'email_example', # String | Filter by customer email
|
183
|
-
take: DevDraftAI::BigDecimal.new, # BigDecimal | Number of records to take
|
184
|
-
skip: DevDraftAI::BigDecimal.new # BigDecimal | Number of records to skip
|
185
|
-
}
|
186
|
-
|
187
|
-
begin
|
188
|
-
#Get all customers with filters
|
189
|
-
api_instance.customer_controller_find_all(opts)
|
190
|
-
rescue DevDraftAI::ApiError => e
|
191
|
-
puts "Exception when calling CustomersApi->customer_controller_find_all: #{e}"
|
192
|
-
end
|
193
|
-
# Setup authorization
|
194
|
-
DevDraftAI.configure do |config|
|
195
|
-
# Configure API key authorization: x-client-key
|
196
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
197
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
198
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
199
|
-
|
200
|
-
# Configure API key authorization: x-client-secret
|
201
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
202
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
203
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
204
|
-
end
|
205
|
-
|
206
|
-
api_instance = DevDraftAI::CustomersApi.new
|
207
|
-
id = 'id_example' # String |
|
208
|
-
|
209
|
-
|
210
|
-
begin
|
211
|
-
#Get a customer by ID
|
212
|
-
api_instance.customer_controller_find_one(id)
|
213
|
-
rescue DevDraftAI::ApiError => e
|
214
|
-
puts "Exception when calling CustomersApi->customer_controller_find_one: #{e}"
|
215
|
-
end
|
216
|
-
# Setup authorization
|
217
|
-
DevDraftAI.configure do |config|
|
218
|
-
# Configure API key authorization: x-client-key
|
219
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
220
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
221
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
222
|
-
|
223
|
-
# Configure API key authorization: x-client-secret
|
224
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
225
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
226
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
227
|
-
end
|
228
|
-
|
229
|
-
api_instance = DevDraftAI::CustomersApi.new
|
230
|
-
body = DevDraftAI::UpdateCustomerDto.new # UpdateCustomerDto | Customer update data
|
231
|
-
id = 'id_example' # String |
|
232
|
-
|
233
|
-
|
234
|
-
begin
|
235
|
-
#Update a customer
|
236
|
-
api_instance.customer_controller_update(body, id)
|
237
|
-
rescue DevDraftAI::ApiError => e
|
238
|
-
puts "Exception when calling CustomersApi->customer_controller_update: #{e}"
|
239
|
-
end
|
240
|
-
# Setup authorization
|
241
|
-
DevDraftAI.configure do |config|
|
242
|
-
# Configure API key authorization: x-client-key
|
243
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
244
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
245
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
246
|
-
|
247
|
-
# Configure API key authorization: x-client-secret
|
248
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
249
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
250
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
251
|
-
end
|
252
|
-
|
253
|
-
api_instance = DevDraftAI::ExchangeRatesApi.new
|
254
|
-
|
255
|
-
begin
|
256
|
-
#Get EUR to USD exchange rate
|
257
|
-
result = api_instance.exchange_rate_controller_get_eurto_usd_rate
|
258
|
-
p result
|
259
|
-
rescue DevDraftAI::ApiError => e
|
260
|
-
puts "Exception when calling ExchangeRatesApi->exchange_rate_controller_get_eurto_usd_rate: #{e}"
|
261
|
-
end
|
262
|
-
# Setup authorization
|
263
|
-
DevDraftAI.configure do |config|
|
264
|
-
# Configure API key authorization: x-client-key
|
265
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
266
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
267
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
268
|
-
|
269
|
-
# Configure API key authorization: x-client-secret
|
270
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
271
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
272
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
273
|
-
end
|
274
|
-
|
275
|
-
api_instance = DevDraftAI::ExchangeRatesApi.new
|
276
|
-
from = 'from_example' # String | Source currency code (e.g., usd)
|
277
|
-
to = 'to_example' # String | Target currency code (e.g., eur)
|
278
|
-
|
279
|
-
|
280
|
-
begin
|
281
|
-
#Get exchange rate between specified currencies
|
282
|
-
result = api_instance.exchange_rate_controller_get_exchange_rate(from, to)
|
283
|
-
p result
|
284
|
-
rescue DevDraftAI::ApiError => e
|
285
|
-
puts "Exception when calling ExchangeRatesApi->exchange_rate_controller_get_exchange_rate: #{e}"
|
286
|
-
end
|
287
|
-
# Setup authorization
|
288
|
-
DevDraftAI.configure do |config|
|
289
|
-
# Configure API key authorization: x-client-key
|
290
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
291
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
292
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
293
|
-
|
294
|
-
# Configure API key authorization: x-client-secret
|
295
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
296
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
297
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
298
|
-
end
|
299
|
-
|
300
|
-
api_instance = DevDraftAI::ExchangeRatesApi.new
|
301
|
-
|
302
|
-
begin
|
303
|
-
#Get USD to EUR exchange rate
|
304
|
-
result = api_instance.exchange_rate_controller_get_usdto_eur_rate
|
305
|
-
p result
|
306
|
-
rescue DevDraftAI::ApiError => e
|
307
|
-
puts "Exception when calling ExchangeRatesApi->exchange_rate_controller_get_usdto_eur_rate: #{e}"
|
308
|
-
end
|
309
|
-
# Setup authorization
|
310
|
-
DevDraftAI.configure do |config|
|
311
|
-
# Configure API key authorization: x-client-key
|
312
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
313
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
314
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
315
|
-
|
316
|
-
# Configure API key authorization: x-client-secret
|
317
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
318
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
319
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
320
|
-
end
|
321
|
-
|
322
|
-
api_instance = DevDraftAI::InvoicesApi.new
|
323
|
-
body = DevDraftAI::CreateInvoiceDto.new # CreateInvoiceDto |
|
324
|
-
|
325
|
-
|
326
|
-
begin
|
327
|
-
#Create a new invoice
|
328
|
-
api_instance.invoice_controller_create(body)
|
329
|
-
rescue DevDraftAI::ApiError => e
|
330
|
-
puts "Exception when calling InvoicesApi->invoice_controller_create: #{e}"
|
331
|
-
end
|
332
|
-
# Setup authorization
|
333
|
-
DevDraftAI.configure do |config|
|
334
|
-
# Configure API key authorization: x-client-key
|
335
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
336
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
337
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
338
|
-
|
339
|
-
# Configure API key authorization: x-client-secret
|
340
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
341
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
342
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
343
|
-
end
|
344
|
-
|
345
|
-
api_instance = DevDraftAI::InvoicesApi.new
|
346
|
-
opts = {
|
347
|
-
skip: DevDraftAI::BigDecimal.new, # BigDecimal | Number of records to skip
|
348
|
-
take: DevDraftAI::BigDecimal.new # BigDecimal | Number of records to take
|
349
|
-
}
|
350
|
-
|
351
|
-
begin
|
352
|
-
#Get all invoices
|
353
|
-
api_instance.invoice_controller_find_all(opts)
|
354
|
-
rescue DevDraftAI::ApiError => e
|
355
|
-
puts "Exception when calling InvoicesApi->invoice_controller_find_all: #{e}"
|
356
|
-
end
|
357
|
-
# Setup authorization
|
358
|
-
DevDraftAI.configure do |config|
|
359
|
-
# Configure API key authorization: x-client-key
|
360
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
361
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
362
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
363
|
-
|
364
|
-
# Configure API key authorization: x-client-secret
|
365
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
366
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
367
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
368
|
-
end
|
369
|
-
|
370
|
-
api_instance = DevDraftAI::InvoicesApi.new
|
371
|
-
id = 'id_example' # String | Invoice ID
|
372
|
-
|
373
|
-
|
374
|
-
begin
|
375
|
-
#Get an invoice by ID
|
376
|
-
api_instance.invoice_controller_find_one(id)
|
377
|
-
rescue DevDraftAI::ApiError => e
|
378
|
-
puts "Exception when calling InvoicesApi->invoice_controller_find_one: #{e}"
|
379
|
-
end
|
380
|
-
# Setup authorization
|
381
|
-
DevDraftAI.configure do |config|
|
382
|
-
# Configure API key authorization: x-client-key
|
383
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
384
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
385
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
386
|
-
|
387
|
-
# Configure API key authorization: x-client-secret
|
388
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
389
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
390
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
391
|
-
end
|
392
|
-
|
393
|
-
api_instance = DevDraftAI::InvoicesApi.new
|
394
|
-
body = DevDraftAI::CreateInvoiceDto.new # CreateInvoiceDto |
|
395
|
-
id = 'id_example' # String | Invoice ID
|
396
|
-
|
397
|
-
|
398
|
-
begin
|
399
|
-
#Update an invoice
|
400
|
-
api_instance.invoice_controller_update(body, id)
|
401
|
-
rescue DevDraftAI::ApiError => e
|
402
|
-
puts "Exception when calling InvoicesApi->invoice_controller_update: #{e}"
|
403
|
-
end
|
404
|
-
|
405
|
-
api_instance = DevDraftAI::LiquidationAddressesApi.new
|
406
|
-
body = DevDraftAI::CreateLiquidationAddressDto.new # CreateLiquidationAddressDto |
|
407
|
-
customer_id = 'customer_id_example' # String | Unique identifier for the customer
|
408
|
-
|
409
|
-
|
410
|
-
begin
|
411
|
-
#Create a new liquidation address for a customer
|
412
|
-
result = api_instance.liquidation_address_controller_create_liquidation_address(body, customer_id)
|
413
|
-
p result
|
414
|
-
rescue DevDraftAI::ApiError => e
|
415
|
-
puts "Exception when calling LiquidationAddressesApi->liquidation_address_controller_create_liquidation_address: #{e}"
|
416
|
-
end
|
417
|
-
|
418
|
-
api_instance = DevDraftAI::LiquidationAddressesApi.new
|
419
|
-
customer_id = 'customer_id_example' # String | Unique identifier for the customer
|
420
|
-
liquidation_address_id = 'liquidation_address_id_example' # String | Unique identifier for the liquidation address
|
421
|
-
|
422
|
-
|
423
|
-
begin
|
424
|
-
#Get a specific liquidation address
|
425
|
-
result = api_instance.liquidation_address_controller_get_liquidation_address(customer_id, liquidation_address_id)
|
426
|
-
p result
|
427
|
-
rescue DevDraftAI::ApiError => e
|
428
|
-
puts "Exception when calling LiquidationAddressesApi->liquidation_address_controller_get_liquidation_address: #{e}"
|
429
|
-
end
|
430
|
-
|
431
|
-
api_instance = DevDraftAI::LiquidationAddressesApi.new
|
432
|
-
customer_id = 'customer_id_example' # String | Unique identifier for the customer
|
433
|
-
|
434
|
-
|
435
|
-
begin
|
436
|
-
#Get all liquidation addresses for a customer
|
437
|
-
result = api_instance.liquidation_address_controller_get_liquidation_addresses(customer_id)
|
438
|
-
p result
|
439
|
-
rescue DevDraftAI::ApiError => e
|
440
|
-
puts "Exception when calling LiquidationAddressesApi->liquidation_address_controller_get_liquidation_addresses: #{e}"
|
441
|
-
end
|
442
|
-
# Setup authorization
|
443
|
-
DevDraftAI.configure do |config|
|
444
|
-
# Configure API key authorization: x-client-key
|
445
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
446
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
447
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
448
|
-
|
449
|
-
# Configure API key authorization: x-client-secret
|
450
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
451
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
452
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
453
|
-
end
|
454
|
-
|
455
|
-
api_instance = DevDraftAI::PaymentIntentsApi.new
|
456
|
-
body = DevDraftAI::CreateBankPaymentIntentDto.new # CreateBankPaymentIntentDto | Bank payment intent creation data
|
457
|
-
idempotency_key = 'idempotency_key_example' # String | Unique UUID v4 for idempotent requests. Prevents duplicate payments.
|
458
|
-
|
459
|
-
|
460
|
-
begin
|
461
|
-
#Create a bank payment intent
|
462
|
-
api_instance.payment_intent_controller_create_bank_payment_intent(body, idempotency_key)
|
463
|
-
rescue DevDraftAI::ApiError => e
|
464
|
-
puts "Exception when calling PaymentIntentsApi->payment_intent_controller_create_bank_payment_intent: #{e}"
|
465
|
-
end
|
466
|
-
# Setup authorization
|
467
|
-
DevDraftAI.configure do |config|
|
468
|
-
# Configure API key authorization: x-client-key
|
469
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
470
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
471
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
472
|
-
|
473
|
-
# Configure API key authorization: x-client-secret
|
474
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
475
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
476
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
477
|
-
end
|
478
|
-
|
479
|
-
api_instance = DevDraftAI::PaymentIntentsApi.new
|
480
|
-
body = DevDraftAI::CreateStablePaymentIntentDto.new # CreateStablePaymentIntentDto | Stable payment intent creation data
|
481
|
-
idempotency_key = 'idempotency_key_example' # String | Unique UUID v4 for idempotent requests. Prevents duplicate payments.
|
482
|
-
|
483
|
-
|
484
|
-
begin
|
485
|
-
#Create a stable payment intent
|
486
|
-
api_instance.payment_intent_controller_create_stable_payment_intent(body, idempotency_key)
|
487
|
-
rescue DevDraftAI::ApiError => e
|
488
|
-
puts "Exception when calling PaymentIntentsApi->payment_intent_controller_create_stable_payment_intent: #{e}"
|
489
|
-
end
|
490
|
-
# Setup authorization
|
491
|
-
DevDraftAI.configure do |config|
|
492
|
-
# Configure API key authorization: x-client-key
|
493
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
494
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
495
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
496
|
-
|
497
|
-
# Configure API key authorization: x-client-secret
|
498
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
499
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
500
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
501
|
-
end
|
502
|
-
|
503
|
-
api_instance = DevDraftAI::PaymentLinksApi.new
|
504
|
-
body = DevDraftAI::CreatePaymentLinkDto.new # CreatePaymentLinkDto | Payment link creation data
|
505
|
-
|
506
|
-
|
507
|
-
begin
|
508
|
-
#Create a new payment link
|
509
|
-
api_instance.payment_links_controller_create(body)
|
510
|
-
rescue DevDraftAI::ApiError => e
|
511
|
-
puts "Exception when calling PaymentLinksApi->payment_links_controller_create: #{e}"
|
512
|
-
end
|
513
|
-
# Setup authorization
|
514
|
-
DevDraftAI.configure do |config|
|
515
|
-
# Configure API key authorization: x-client-key
|
516
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
517
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
518
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
519
|
-
|
520
|
-
# Configure API key authorization: x-client-secret
|
521
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
522
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
523
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
524
|
-
end
|
525
|
-
|
526
|
-
api_instance = DevDraftAI::PaymentLinksApi.new
|
527
|
-
opts = {
|
528
|
-
skip: 'skip_example', # String | Number of records to skip (must be non-negative)
|
529
|
-
take: 'take_example' # String | Number of records to take (must be positive)
|
530
|
-
}
|
531
|
-
|
532
|
-
begin
|
533
|
-
#Get all payment links
|
534
|
-
api_instance.payment_links_controller_find_all(opts)
|
535
|
-
rescue DevDraftAI::ApiError => e
|
536
|
-
puts "Exception when calling PaymentLinksApi->payment_links_controller_find_all: #{e}"
|
537
|
-
end
|
538
|
-
# Setup authorization
|
539
|
-
DevDraftAI.configure do |config|
|
540
|
-
# Configure API key authorization: x-client-key
|
541
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
542
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
543
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
544
|
-
|
545
|
-
# Configure API key authorization: x-client-secret
|
546
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
547
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
548
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
549
|
-
end
|
550
|
-
|
551
|
-
api_instance = DevDraftAI::PaymentLinksApi.new
|
552
|
-
id = 'id_example' # String | Payment Link ID
|
553
|
-
|
554
|
-
|
555
|
-
begin
|
556
|
-
#Get a payment link by ID
|
557
|
-
api_instance.payment_links_controller_find_one(id)
|
558
|
-
rescue DevDraftAI::ApiError => e
|
559
|
-
puts "Exception when calling PaymentLinksApi->payment_links_controller_find_one: #{e}"
|
560
|
-
end
|
561
|
-
# Setup authorization
|
562
|
-
DevDraftAI.configure do |config|
|
563
|
-
# Configure API key authorization: x-client-key
|
564
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
565
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
566
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
567
|
-
|
568
|
-
# Configure API key authorization: x-client-secret
|
569
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
570
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
571
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
572
|
-
end
|
573
|
-
|
574
|
-
api_instance = DevDraftAI::PaymentLinksApi.new
|
575
|
-
body = DevDraftAI::UpdatePaymentLinkDto.new # UpdatePaymentLinkDto |
|
576
|
-
id = 'id_example' # String | Payment Link ID
|
577
|
-
|
578
|
-
|
579
|
-
begin
|
580
|
-
#Update a payment link
|
581
|
-
api_instance.payment_links_controller_update(body, id)
|
582
|
-
rescue DevDraftAI::ApiError => e
|
583
|
-
puts "Exception when calling PaymentLinksApi->payment_links_controller_update: #{e}"
|
584
|
-
end
|
585
|
-
# Setup authorization
|
586
|
-
DevDraftAI.configure do |config|
|
587
|
-
# Configure API key authorization: x-client-key
|
588
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
589
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
590
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
591
|
-
|
592
|
-
# Configure API key authorization: x-client-secret
|
593
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
594
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
595
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
596
|
-
end
|
597
|
-
|
598
|
-
api_instance = DevDraftAI::ProductsApi.new
|
599
|
-
name = 'name_example' # String |
|
600
|
-
description = 'description_example' # String |
|
601
|
-
price = DevDraftAI::BigDecimal.new # BigDecimal |
|
602
|
-
currency = 'currency_example' # String |
|
603
|
-
type = 'type_example' # String |
|
604
|
-
weight = DevDraftAI::BigDecimal.new # BigDecimal |
|
605
|
-
unit = 'unit_example' # String |
|
606
|
-
quantity = DevDraftAI::BigDecimal.new # BigDecimal |
|
607
|
-
stock_count = DevDraftAI::BigDecimal.new # BigDecimal |
|
608
|
-
status = 'status_example' # String |
|
609
|
-
product_type = 'product_type_example' # String |
|
610
|
-
images = ['images_example'] # Array<String> |
|
611
|
-
|
612
|
-
|
613
|
-
begin
|
614
|
-
#Create a new product
|
615
|
-
api_instance.product_controller_create(name, description, price, currency, type, weight, unit, quantity, stock_count, status, product_type, images)
|
616
|
-
rescue DevDraftAI::ApiError => e
|
617
|
-
puts "Exception when calling ProductsApi->product_controller_create: #{e}"
|
618
|
-
end
|
619
|
-
# Setup authorization
|
620
|
-
DevDraftAI.configure do |config|
|
621
|
-
# Configure API key authorization: x-client-key
|
622
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
623
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
624
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
625
|
-
|
626
|
-
# Configure API key authorization: x-client-secret
|
627
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
628
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
629
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
630
|
-
end
|
631
|
-
|
632
|
-
api_instance = DevDraftAI::ProductsApi.new
|
633
|
-
opts = {
|
634
|
-
skip: DevDraftAI::BigDecimal.new, # BigDecimal | Number of records to skip
|
635
|
-
take: DevDraftAI::BigDecimal.new # BigDecimal | Number of records to take
|
636
|
-
}
|
637
|
-
|
638
|
-
begin
|
639
|
-
#Get all products
|
640
|
-
api_instance.product_controller_find_all(opts)
|
641
|
-
rescue DevDraftAI::ApiError => e
|
642
|
-
puts "Exception when calling ProductsApi->product_controller_find_all: #{e}"
|
643
|
-
end
|
644
|
-
# Setup authorization
|
645
|
-
DevDraftAI.configure do |config|
|
646
|
-
# Configure API key authorization: x-client-key
|
647
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
648
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
649
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
650
|
-
|
651
|
-
# Configure API key authorization: x-client-secret
|
652
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
653
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
654
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
655
|
-
end
|
656
|
-
|
657
|
-
api_instance = DevDraftAI::ProductsApi.new
|
658
|
-
id = 'id_example' # String | Product ID
|
659
|
-
|
660
|
-
|
661
|
-
begin
|
662
|
-
#Get a product by ID
|
663
|
-
api_instance.product_controller_find_one(id)
|
664
|
-
rescue DevDraftAI::ApiError => e
|
665
|
-
puts "Exception when calling ProductsApi->product_controller_find_one: #{e}"
|
666
|
-
end
|
667
|
-
# Setup authorization
|
668
|
-
DevDraftAI.configure do |config|
|
669
|
-
# Configure API key authorization: x-client-key
|
670
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
671
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
672
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
673
|
-
|
674
|
-
# Configure API key authorization: x-client-secret
|
675
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
676
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
677
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
678
|
-
end
|
679
|
-
|
680
|
-
api_instance = DevDraftAI::ProductsApi.new
|
681
|
-
id = 'id_example' # String | Product ID
|
682
|
-
|
683
|
-
|
684
|
-
begin
|
685
|
-
#Delete a product
|
686
|
-
api_instance.product_controller_remove(id)
|
687
|
-
rescue DevDraftAI::ApiError => e
|
688
|
-
puts "Exception when calling ProductsApi->product_controller_remove: #{e}"
|
689
|
-
end
|
690
|
-
# Setup authorization
|
691
|
-
DevDraftAI.configure do |config|
|
692
|
-
# Configure API key authorization: x-client-key
|
693
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
694
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
695
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
696
|
-
|
697
|
-
# Configure API key authorization: x-client-secret
|
698
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
699
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
700
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
701
|
-
end
|
702
|
-
|
703
|
-
api_instance = DevDraftAI::ProductsApi.new
|
704
|
-
name = 'name_example' # String |
|
705
|
-
description = 'description_example' # String |
|
706
|
-
price = DevDraftAI::BigDecimal.new # BigDecimal |
|
707
|
-
currency = 'currency_example' # String |
|
708
|
-
type = 'type_example' # String |
|
709
|
-
weight = DevDraftAI::BigDecimal.new # BigDecimal |
|
710
|
-
unit = 'unit_example' # String |
|
711
|
-
quantity = DevDraftAI::BigDecimal.new # BigDecimal |
|
712
|
-
stock_count = DevDraftAI::BigDecimal.new # BigDecimal |
|
713
|
-
status = 'status_example' # String |
|
714
|
-
product_type = 'product_type_example' # String |
|
715
|
-
images = ['images_example'] # Array<String> |
|
716
|
-
id = 'id_example' # String | Product ID
|
717
|
-
|
718
|
-
|
719
|
-
begin
|
720
|
-
#Update a product
|
721
|
-
api_instance.product_controller_update(name, description, price, currency, type, weight, unit, quantity, stock_count, status, product_type, images, id)
|
722
|
-
rescue DevDraftAI::ApiError => e
|
723
|
-
puts "Exception when calling ProductsApi->product_controller_update: #{e}"
|
724
|
-
end
|
725
|
-
# Setup authorization
|
726
|
-
DevDraftAI.configure do |config|
|
727
|
-
# Configure API key authorization: x-client-key
|
728
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
729
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
730
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
731
|
-
|
732
|
-
# Configure API key authorization: x-client-secret
|
733
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
734
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
735
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
736
|
-
end
|
737
|
-
|
738
|
-
api_instance = DevDraftAI::ProductsApi.new
|
739
|
-
id = 'id_example' # String | Product ID
|
740
|
-
|
741
|
-
|
742
|
-
begin
|
743
|
-
#Upload images for a product
|
744
|
-
api_instance.product_controller_upload_image(id)
|
745
|
-
rescue DevDraftAI::ApiError => e
|
746
|
-
puts "Exception when calling ProductsApi->product_controller_upload_image: #{e}"
|
747
|
-
end
|
748
|
-
# Setup authorization
|
749
|
-
DevDraftAI.configure do |config|
|
750
|
-
# Configure API key authorization: x-client-key
|
751
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
752
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
753
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
754
|
-
|
755
|
-
# Configure API key authorization: x-client-secret
|
756
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
757
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
758
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
759
|
-
end
|
760
|
-
|
761
|
-
api_instance = DevDraftAI::TaxesApi.new
|
762
|
-
body = DevDraftAI::CreateTaxInput.new # CreateTaxInput |
|
763
|
-
|
764
|
-
|
765
|
-
begin
|
766
|
-
#Create a new tax
|
767
|
-
api_instance.tax_controller_create(body)
|
768
|
-
rescue DevDraftAI::ApiError => e
|
769
|
-
puts "Exception when calling TaxesApi->tax_controller_create: #{e}"
|
770
|
-
end
|
771
|
-
# Setup authorization
|
772
|
-
DevDraftAI.configure do |config|
|
773
|
-
# Configure API key authorization: x-client-key
|
774
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
775
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
776
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
777
|
-
|
778
|
-
# Configure API key authorization: x-client-secret
|
779
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
780
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
781
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
782
|
-
end
|
783
|
-
|
784
|
-
api_instance = DevDraftAI::TaxesApi.new
|
785
|
-
opts = {
|
786
|
-
skip: 'skip_example', # String | Number of records to skip
|
787
|
-
take: 'take_example' # String | Number of records to take
|
788
|
-
}
|
789
|
-
|
790
|
-
begin
|
791
|
-
#Get all taxes
|
792
|
-
api_instance.tax_controller_find_all(opts)
|
793
|
-
rescue DevDraftAI::ApiError => e
|
794
|
-
puts "Exception when calling TaxesApi->tax_controller_find_all: #{e}"
|
795
|
-
end
|
796
|
-
# Setup authorization
|
797
|
-
DevDraftAI.configure do |config|
|
798
|
-
# Configure API key authorization: x-client-key
|
799
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
800
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
801
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
802
|
-
|
803
|
-
# Configure API key authorization: x-client-secret
|
804
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
805
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
806
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
807
|
-
end
|
23
|
+
## Usage
|
808
24
|
|
809
|
-
|
810
|
-
id = 'id_example' # String | Tax ID
|
25
|
+
### Basic Setup
|
811
26
|
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
#
|
824
|
-
#config.
|
825
|
-
|
826
|
-
#
|
827
|
-
config.
|
828
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
829
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
830
|
-
end
|
831
|
-
|
832
|
-
api_instance = DevDraftAI::TaxesApi.new
|
833
|
-
id = 'id_example' # String | Tax ID
|
834
|
-
|
835
|
-
|
836
|
-
begin
|
837
|
-
#Delete a tax
|
838
|
-
api_instance.tax_controller_remove(id)
|
839
|
-
rescue DevDraftAI::ApiError => e
|
840
|
-
puts "Exception when calling TaxesApi->tax_controller_remove: #{e}"
|
841
|
-
end
|
842
|
-
# Setup authorization
|
843
|
-
DevDraftAI.configure do |config|
|
844
|
-
# Configure API key authorization: x-client-key
|
845
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
846
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
847
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
848
|
-
|
849
|
-
# Configure API key authorization: x-client-secret
|
850
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
851
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
852
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
853
|
-
end
|
854
|
-
|
855
|
-
api_instance = DevDraftAI::TaxesApi.new
|
856
|
-
body = DevDraftAI::UpdateTaxInput.new # UpdateTaxInput |
|
857
|
-
id = 'id_example' # String | Tax ID
|
858
|
-
|
859
|
-
|
860
|
-
begin
|
861
|
-
#Update a tax
|
862
|
-
api_instance.tax_controller_update(body, id)
|
863
|
-
rescue DevDraftAI::ApiError => e
|
864
|
-
puts "Exception when calling TaxesApi->tax_controller_update: #{e}"
|
865
|
-
end
|
866
|
-
|
867
|
-
api_instance = DevDraftAI::TestPaymentsApi.new
|
868
|
-
body = DevDraftAI::PaymentRequestDto.new # PaymentRequestDto |
|
869
|
-
idempotency_key = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | Unique key to ensure the request is idempotent. If a request with the same key is sent multiple times, only the first will be processed, and subsequent requests will return the same response.
|
870
|
-
|
871
|
-
|
872
|
-
begin
|
873
|
-
#Process a test payment
|
874
|
-
result = api_instance.test_payment_controller_create_payment_v0(body, idempotency_key)
|
875
|
-
p result
|
876
|
-
rescue DevDraftAI::ApiError => e
|
877
|
-
puts "Exception when calling TestPaymentsApi->test_payment_controller_create_payment_v0: #{e}"
|
878
|
-
end
|
879
|
-
|
880
|
-
api_instance = DevDraftAI::TestPaymentsApi.new
|
881
|
-
id = 'id_example' # String | Payment ID
|
882
|
-
|
883
|
-
|
884
|
-
begin
|
885
|
-
#Get payment details by ID
|
886
|
-
result = api_instance.test_payment_controller_get_payment_v0(id)
|
887
|
-
p result
|
888
|
-
rescue DevDraftAI::ApiError => e
|
889
|
-
puts "Exception when calling TestPaymentsApi->test_payment_controller_get_payment_v0: #{e}"
|
890
|
-
end
|
891
|
-
|
892
|
-
api_instance = DevDraftAI::TestPaymentsApi.new
|
893
|
-
id = 'id_example' # String | Payment ID to refund
|
894
|
-
idempotency_key = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | Unique key to ensure the refund request is idempotent. If a request with the same key is sent multiple times, only the first will be processed, and subsequent requests will return the same response.
|
895
|
-
|
896
|
-
|
897
|
-
begin
|
898
|
-
#Refund a payment
|
899
|
-
result = api_instance.test_payment_controller_refund_payment_v0(id, idempotency_key)
|
900
|
-
p result
|
901
|
-
rescue DevDraftAI::ApiError => e
|
902
|
-
puts "Exception when calling TestPaymentsApi->test_payment_controller_refund_payment_v0: #{e}"
|
903
|
-
end
|
904
|
-
# Setup authorization
|
905
|
-
DevDraftAI.configure do |config|
|
906
|
-
# Configure API key authorization: x-client-key
|
907
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
908
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
909
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
910
|
-
|
911
|
-
# Configure API key authorization: x-client-secret
|
912
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
913
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
914
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
915
|
-
end
|
916
|
-
|
917
|
-
api_instance = DevDraftAI::TransfersApi.new
|
918
|
-
body = DevDraftAI::CreateDirectBankTransferDto.new # CreateDirectBankTransferDto |
|
919
|
-
|
920
|
-
|
921
|
-
begin
|
922
|
-
#Create a direct bank transfer
|
923
|
-
api_instance.transfer_controller_create_direct_bank_transfer(body)
|
924
|
-
rescue DevDraftAI::ApiError => e
|
925
|
-
puts "Exception when calling TransfersApi->transfer_controller_create_direct_bank_transfer: #{e}"
|
926
|
-
end
|
927
|
-
# Setup authorization
|
928
|
-
DevDraftAI.configure do |config|
|
929
|
-
# Configure API key authorization: x-client-key
|
930
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
931
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
932
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
933
|
-
|
934
|
-
# Configure API key authorization: x-client-secret
|
935
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
936
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
937
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
27
|
+
```ruby
|
28
|
+
require 'devdraft'
|
29
|
+
|
30
|
+
# Configure the SDK
|
31
|
+
Devdraft.configure do |config|
|
32
|
+
# Set your authentication headers (required for authenticated endpoints)
|
33
|
+
config.default_headers = {
|
34
|
+
'x-client-key' => 'YOUR_CLIENT_KEY',
|
35
|
+
'x-secret-key' => 'YOUR_SECRET_KEY'
|
36
|
+
}
|
37
|
+
|
38
|
+
# Optional: Set a custom base URL if needed
|
39
|
+
# config.base_url = 'https://api.devdraft.com'
|
40
|
+
|
41
|
+
# Optional: Enable debug logging
|
42
|
+
config.debugging = true
|
938
43
|
end
|
44
|
+
```
|
939
45
|
|
940
|
-
|
941
|
-
body = DevDraftAI::CreateDirectWalletTransferDto.new # CreateDirectWalletTransferDto |
|
942
|
-
|
46
|
+
You can generate your client key and secret key from the [Devdraft Console](https://console.devdraft.ai) under App Settings.
|
943
47
|
|
944
|
-
|
945
|
-
#Create a direct wallet transfer
|
946
|
-
api_instance.transfer_controller_create_direct_wallet_transfer(body)
|
947
|
-
rescue DevDraftAI::ApiError => e
|
948
|
-
puts "Exception when calling TransfersApi->transfer_controller_create_direct_wallet_transfer: #{e}"
|
949
|
-
end
|
950
|
-
# Setup authorization
|
951
|
-
DevDraftAI.configure do |config|
|
952
|
-
# Configure API key authorization: x-client-key
|
953
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
954
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
955
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
48
|
+
### Examples
|
956
49
|
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
50
|
+
#### Basic Setup
|
51
|
+
```ruby
|
52
|
+
require 'devdraft'
|
53
|
+
|
54
|
+
# Configure the SDK
|
55
|
+
Devdraft.configure do |config|
|
56
|
+
# Set your authentication headers (required for authenticated endpoints)
|
57
|
+
config.default_headers = {
|
58
|
+
'x-client-key' => 'YOUR_CLIENT_KEY',
|
59
|
+
'x-secret-key' => 'YOUR_SECRET_KEY'
|
60
|
+
}
|
61
|
+
|
62
|
+
# Optional: Set a custom base URL if needed
|
63
|
+
# config.base_url = 'https://api.devdraft.com'
|
64
|
+
|
65
|
+
# Optional: Enable debug logging
|
66
|
+
config.debugging = true
|
961
67
|
end
|
68
|
+
```
|
962
69
|
|
963
|
-
|
964
|
-
body = DevDraftAI::CreateStablecoinConversionDto.new # CreateStablecoinConversionDto |
|
965
|
-
|
966
|
-
|
967
|
-
begin
|
968
|
-
#Create a stablecoin conversion
|
969
|
-
api_instance.transfer_controller_create_stablecoin_conversion(body)
|
970
|
-
rescue DevDraftAI::ApiError => e
|
971
|
-
puts "Exception when calling TransfersApi->transfer_controller_create_stablecoin_conversion: #{e}"
|
972
|
-
end
|
973
|
-
# Setup authorization
|
974
|
-
DevDraftAI.configure do |config|
|
975
|
-
# Configure API key authorization: x-client-key
|
976
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
977
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
978
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
70
|
+
You can generate your client key and secret key from the [Devdraft Console](https://console.devdraft.ai) under App Settings.
|
979
71
|
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
984
|
-
end
|
72
|
+
#### Create a Customer
|
73
|
+
```ruby
|
74
|
+
api_instance = Devdraft::CustomersApi.new
|
985
75
|
|
986
|
-
|
76
|
+
# Create a new customer
|
77
|
+
customer_data = Devdraft::CreateCustomerDto.new(
|
78
|
+
email: 'customer@example.com',
|
79
|
+
name: 'John Doe',
|
80
|
+
status: 'active'
|
81
|
+
)
|
987
82
|
|
988
83
|
begin
|
989
|
-
|
990
|
-
|
991
|
-
rescue
|
992
|
-
puts "
|
84
|
+
result = api_instance.customer_controller_create(customer_data)
|
85
|
+
puts "Customer created: #{result.inspect}"
|
86
|
+
rescue Devdraft::ApiError => e
|
87
|
+
puts "Error creating customer: #{e.response_body}"
|
993
88
|
end
|
994
|
-
|
995
|
-
DevDraftAI.configure do |config|
|
996
|
-
# Configure API key authorization: x-client-key
|
997
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
998
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
999
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
89
|
+
```
|
1000
90
|
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
91
|
+
#### Create a Payment Link
|
92
|
+
```ruby
|
93
|
+
api_instance = Devdraft::PaymentLinksApi.new
|
94
|
+
|
95
|
+
# Create a payment link for a product
|
96
|
+
payment_link = Devdraft::CreatePaymentLinkDto.new(
|
97
|
+
amount: 99.99,
|
98
|
+
currency: 'USD',
|
99
|
+
description: 'Premium Subscription',
|
100
|
+
expires_at: (Time.now + 7.days).iso8601, # Expires in 7 days
|
101
|
+
products: [
|
102
|
+
Devdraft::PaymentLinkProductDto.new(
|
103
|
+
name: 'Premium Plan',
|
104
|
+
quantity: 1,
|
105
|
+
price: 99.99
|
106
|
+
)
|
107
|
+
]
|
108
|
+
)
|
109
|
+
|
110
|
+
begin
|
111
|
+
result = api_instance.payment_links_controller_create(payment_link)
|
112
|
+
puts "Payment link created: #{result.inspect}"
|
113
|
+
rescue Devdraft::ApiError => e
|
114
|
+
puts "Error creating payment link: #{e.response_body}"
|
1005
115
|
end
|
116
|
+
```
|
1006
117
|
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
118
|
+
#### Check Balance
|
119
|
+
```ruby
|
120
|
+
api_instance = Devdraft::AppBalancesApi.new
|
1010
121
|
|
1011
122
|
begin
|
1012
|
-
#
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
123
|
+
# Get all balances
|
124
|
+
balances = api_instance.balance_controller_get_all_balances
|
125
|
+
puts "All balances: #{balances.inspect}"
|
126
|
+
|
127
|
+
# Get specific currency balance
|
128
|
+
usdc_balance = api_instance.balance_controller_get_usdc_balance
|
129
|
+
puts "USDC balance: #{usdc_balance.inspect}"
|
130
|
+
rescue Devdraft::ApiError => e
|
131
|
+
puts "Error checking balance: #{e.response_body}"
|
1017
132
|
end
|
1018
|
-
|
1019
|
-
DevDraftAI.configure do |config|
|
1020
|
-
# Configure API key authorization: x-client-key
|
1021
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
1022
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1023
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
133
|
+
```
|
1024
134
|
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
1029
|
-
end
|
135
|
+
#### Create a Webhook
|
136
|
+
```ruby
|
137
|
+
api_instance = Devdraft::WebhooksApi.new
|
1030
138
|
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
139
|
+
webhook = Devdraft::CreateWebhookDto.new(
|
140
|
+
url: 'https://your-domain.com/webhooks',
|
141
|
+
events: ['payment.created', 'payment.completed'],
|
142
|
+
description: 'Payment notifications'
|
143
|
+
)
|
1036
144
|
|
1037
145
|
begin
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
puts "Exception when calling WebhooksApi->webhook_controller_find_all: #{e}"
|
146
|
+
result = api_instance.webhook_controller_create(webhook)
|
147
|
+
puts "Webhook created: #{result.inspect}"
|
148
|
+
rescue Devdraft::ApiError => e
|
149
|
+
puts "Error creating webhook: #{e.response_body}"
|
1043
150
|
end
|
1044
|
-
|
1045
|
-
DevDraftAI.configure do |config|
|
1046
|
-
# Configure API key authorization: x-client-key
|
1047
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
1048
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1049
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
1050
|
-
|
1051
|
-
# Configure API key authorization: x-client-secret
|
1052
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
1053
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1054
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
1055
|
-
end
|
1056
|
-
|
1057
|
-
api_instance = DevDraftAI::WebhooksApi.new
|
1058
|
-
id = 'id_example' # String | Webhook ID
|
1059
|
-
|
151
|
+
```
|
1060
152
|
|
1061
|
-
|
1062
|
-
#Get a webhook by id
|
1063
|
-
result = api_instance.webhook_controller_find_one(id)
|
1064
|
-
p result
|
1065
|
-
rescue DevDraftAI::ApiError => e
|
1066
|
-
puts "Exception when calling WebhooksApi->webhook_controller_find_one: #{e}"
|
1067
|
-
end
|
1068
|
-
# Setup authorization
|
1069
|
-
DevDraftAI.configure do |config|
|
1070
|
-
# Configure API key authorization: x-client-key
|
1071
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
1072
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1073
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
153
|
+
### Available APIs
|
1074
154
|
|
1075
|
-
|
1076
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
1077
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1078
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
1079
|
-
end
|
155
|
+
The SDK provides access to the following APIs:
|
1080
156
|
|
1081
|
-
|
1082
|
-
|
157
|
+
- `APIHealthApi`: Health check endpoints
|
158
|
+
- `AppBalancesApi`: Balance management
|
159
|
+
- `CustomersApi`: Customer management
|
160
|
+
- `ExchangeRatesApi`: Exchange rate information
|
161
|
+
- `InvoicesApi`: Invoice management
|
162
|
+
- `LiquidationAddressesApi`: Liquidation address management
|
163
|
+
- `PaymentIntentsApi`: Payment intent management
|
164
|
+
- `PaymentLinksApi`: Payment link management
|
165
|
+
- `ProductsApi`: Product management
|
166
|
+
- `TaxesApi`: Tax management
|
167
|
+
- `TestPaymentsApi`: Test payment endpoints
|
168
|
+
- `TransfersApi`: Transfer management
|
169
|
+
- `WalletsApi`: Wallet management
|
170
|
+
- `WebhooksApi`: Webhook management
|
1083
171
|
|
172
|
+
## Development
|
1084
173
|
|
1085
|
-
|
1086
|
-
#Delete a webhook
|
1087
|
-
result = api_instance.webhook_controller_remove(id)
|
1088
|
-
p result
|
1089
|
-
rescue DevDraftAI::ApiError => e
|
1090
|
-
puts "Exception when calling WebhooksApi->webhook_controller_remove: #{e}"
|
1091
|
-
end
|
1092
|
-
# Setup authorization
|
1093
|
-
DevDraftAI.configure do |config|
|
1094
|
-
# Configure API key authorization: x-client-key
|
1095
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
1096
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1097
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
174
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
|
1098
175
|
|
1099
|
-
|
1100
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
1101
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1102
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
1103
|
-
end
|
176
|
+
## Contributing
|
1104
177
|
|
1105
|
-
|
1106
|
-
body = DevDraftAI::UpdateWebhookDto.new # UpdateWebhookDto | Webhook update details
|
1107
|
-
id = 'id_example' # String | Webhook ID
|
178
|
+
Bug reports and pull requests are welcome on GitHub.
|
1108
179
|
|
180
|
+
## License
|
1109
181
|
|
1110
|
-
|
1111
|
-
#Update a webhook
|
1112
|
-
result = api_instance.webhook_controller_update(body, id)
|
1113
|
-
p result
|
1114
|
-
rescue DevDraftAI::ApiError => e
|
1115
|
-
puts "Exception when calling WebhooksApi->webhook_controller_update: #{e}"
|
1116
|
-
end
|
1117
|
-
```
|
182
|
+
The gem is available as open source under the terms of the [Unlicense](http://unlicense.org/).
|
1118
183
|
|
1119
184
|
## Documentation for API Endpoints
|
1120
185
|
|