devdraft 1.0.1 → 1.0.3
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 +160 -191
- data/Rakefile +2 -0
- data/devdraft-1.0.0.gem +0 -0
- data/{devdraft_ai_sdk.gemspec → devdraft.gemspec} +15 -11
- data/docs/APIHealthApi.md +82 -30
- data/docs/AggregatedBalanceResponse.md +19 -6
- data/docs/AllBalancesResponse.md +19 -6
- data/docs/AppBalancesApi.md +125 -65
- data/docs/BridgeFiatPaymentRail.md +15 -0
- data/docs/BridgePaymentRail.md +12 -3
- data/docs/CreateBankPaymentIntentDto.md +49 -21
- data/docs/CreateCustomerDto.md +25 -9
- data/docs/CreateDirectBankTransferDto.md +29 -11
- data/docs/CreateDirectWalletTransferDto.md +21 -7
- data/docs/CreateExternalBankTransferDto.md +40 -0
- data/docs/CreateExternalStablecoinTransferDto.md +28 -0
- data/docs/CreateInvoiceDto.md +45 -19
- data/docs/CreateLiquidationAddressDto.md +43 -18
- data/docs/CreatePaymentLinkDto.md +53 -28
- data/docs/CreateStablePaymentIntentDto.md +43 -18
- data/docs/CreateStablecoinConversionDto.md +23 -8
- data/docs/CreateTaxDto.md +26 -0
- data/docs/CreateWebhookDto.md +23 -8
- data/docs/CustomerStatus.md +12 -3
- data/docs/CustomerType.md +15 -0
- data/docs/CustomersApi.md +187 -114
- data/docs/DestinationCurrency.md +12 -3
- data/docs/ExchangeRateResponseDto.md +25 -9
- data/docs/ExchangeRatesApi.md +130 -72
- data/docs/FiatCurrency.md +12 -3
- data/docs/HealthResponseDto.md +25 -9
- data/docs/InvoiceProductDto.md +17 -5
- data/docs/InvoicesApi.md +177 -104
- data/docs/LiquidationAddressResponseDto.md +41 -17
- data/docs/LiquidationAddressesApi.md +115 -61
- data/docs/PaymentIntentsApi.md +93 -57
- data/docs/PaymentLinkProductDto.md +17 -5
- data/docs/PaymentLinksApi.md +175 -102
- data/docs/PaymentRequestDto.md +21 -7
- data/docs/PaymentResponseDto.md +23 -8
- data/docs/ProductsApi.md +307 -194
- data/docs/PublicHealthResponseDto.md +19 -6
- data/docs/RefundResponseDto.md +23 -8
- data/docs/StableCoinCurrency.md +12 -3
- data/docs/TaxControllerCreate201Response.md +30 -0
- data/docs/TaxControllerDeleteWithoutId400Response.md +22 -0
- data/docs/TaxControllerUpdateWithoutId400Response.md +22 -0
- data/docs/TaxesApi.md +374 -122
- data/docs/TestPaymentsApi.md +150 -60
- data/docs/TransfersApi.md +274 -72
- data/docs/UpdateCustomerDto.md +25 -9
- data/docs/UpdateTaxDto.md +26 -0
- data/docs/UpdateWebhookDto.md +23 -8
- data/docs/WalletsApi.md +44 -24
- data/docs/WebhookResponseDto.md +29 -11
- data/docs/WebhooksApi.md +225 -134
- data/git_push.sh +41 -28
- data/lib/devdraft/api/api_health_api.rb +32 -16
- data/lib/devdraft/api/app_balances_api.rb +45 -22
- data/lib/devdraft/api/customers_api.rb +124 -71
- data/lib/devdraft/api/exchange_rates_api.rb +49 -26
- data/lib/devdraft/api/invoices_api.rb +89 -53
- data/lib/devdraft/api/liquidation_addresses_api.rb +70 -44
- data/lib/devdraft/api/payment_intents_api.rb +62 -40
- data/lib/devdraft/api/payment_links_api.rb +85 -49
- data/lib/devdraft/api/products_api.rb +214 -216
- data/lib/devdraft/api/taxes_api.rb +257 -66
- data/lib/devdraft/api/test_payments_api.rb +70 -44
- data/lib/devdraft/api/transfers_api.rb +206 -46
- data/lib/devdraft/api/wallets_api.rb +18 -9
- data/lib/devdraft/api/webhooks_api.rb +109 -66
- data/lib/devdraft/api_client.rb +76 -71
- data/lib/devdraft/api_error.rb +5 -4
- data/lib/devdraft/api_model_base.rb +88 -0
- data/lib/devdraft/configuration.rb +121 -18
- data/lib/devdraft/models/aggregated_balance_response.rb +68 -101
- data/lib/devdraft/models/all_balances_response.rb +76 -99
- data/lib/devdraft/models/bridge_fiat_payment_rail.rb +45 -0
- data/lib/devdraft/models/bridge_payment_rail.rb +36 -24
- data/lib/devdraft/models/create_bank_payment_intent_dto.rb +191 -114
- data/lib/devdraft/models/create_customer_dto.rb +123 -113
- data/lib/devdraft/models/create_direct_bank_transfer_dto.rb +105 -104
- data/lib/devdraft/models/create_direct_wallet_transfer_dto.rb +89 -100
- data/lib/devdraft/models/create_external_bank_transfer_dto.rb +505 -0
- data/lib/devdraft/models/create_external_stablecoin_transfer_dto.rb +266 -0
- data/lib/devdraft/models/create_invoice_dto.rb +151 -121
- data/lib/devdraft/models/create_liquidation_address_dto.rb +195 -115
- data/lib/devdraft/models/create_payment_link_dto.rb +192 -214
- data/lib/devdraft/models/create_stable_payment_intent_dto.rb +324 -111
- data/lib/devdraft/models/create_stablecoin_conversion_dto.rb +102 -101
- data/lib/devdraft/models/create_tax_dto.rb +281 -0
- data/lib/devdraft/models/create_webhook_dto.rb +104 -101
- data/lib/devdraft/models/customer_status.rb +23 -10
- data/lib/devdraft/models/customer_type.rb +45 -0
- data/lib/devdraft/models/destination_currency.rb +27 -15
- data/lib/devdraft/models/exchange_rate_response_dto.rb +103 -102
- data/lib/devdraft/models/fiat_currency.rb +22 -10
- data/lib/devdraft/models/health_response_dto.rb +99 -106
- data/lib/devdraft/models/invoice_product_dto.rb +63 -98
- data/lib/devdraft/models/liquidation_address_response_dto.rb +147 -110
- data/lib/devdraft/models/payment_link_product_dto.rb +70 -98
- data/lib/devdraft/models/payment_request_dto.rb +77 -100
- data/lib/devdraft/models/payment_response_dto.rb +102 -101
- data/lib/devdraft/models/public_health_response_dto.rb +68 -101
- data/lib/devdraft/models/refund_response_dto.rb +102 -101
- data/lib/devdraft/models/stable_coin_currency.rb +21 -9
- data/lib/devdraft/models/tax_controller_create201_response.rb +201 -0
- data/lib/devdraft/models/tax_controller_delete_without_id400_response.rb +165 -0
- data/lib/devdraft/models/tax_controller_update_without_id400_response.rb +165 -0
- data/lib/devdraft/models/update_customer_dto.rb +117 -113
- data/lib/devdraft/models/update_tax_dto.rb +256 -0
- data/lib/devdraft/models/update_webhook_dto.rb +70 -101
- data/lib/devdraft/models/webhook_response_dto.rb +140 -103
- data/lib/devdraft/version.rb +6 -5
- data/lib/devdraft.rb +18 -27
- data/spec/api/api_health_api_spec.rb +10 -9
- data/spec/api/app_balances_api_spec.rb +11 -10
- data/spec/api/customers_api_spec.rb +25 -24
- data/spec/api/exchange_rates_api_spec.rb +11 -10
- data/spec/api/invoices_api_spec.rb +16 -15
- data/spec/api/liquidation_addresses_api_spec.rb +13 -12
- data/spec/api/payment_intents_api_spec.rb +12 -11
- data/spec/api/payment_links_api_spec.rb +14 -13
- data/spec/api/products_api_spec.rb +41 -40
- data/spec/api/taxes_api_spec.rb +51 -21
- data/spec/api/test_payments_api_spec.rb +14 -13
- data/spec/api/transfers_api_spec.rb +36 -13
- data/spec/api/wallets_api_spec.rb +9 -8
- data/spec/api/webhooks_api_spec.rb +20 -19
- data/spec/models/aggregated_balance_response_spec.rb +15 -19
- data/spec/models/all_balances_response_spec.rb +14 -18
- data/spec/models/bridge_fiat_payment_rail_spec.rb +30 -0
- data/spec/models/bridge_payment_rail_spec.rb +11 -15
- data/spec/models/create_bank_payment_intent_dto_spec.rb +29 -33
- data/spec/models/create_customer_dto_spec.rb +17 -25
- data/spec/models/create_direct_bank_transfer_dto_spec.rb +19 -23
- data/spec/models/create_direct_wallet_transfer_dto_spec.rb +15 -19
- data/spec/models/create_external_bank_transfer_dto_spec.rb +102 -0
- data/spec/models/create_external_stablecoin_transfer_dto_spec.rb +66 -0
- data/spec/models/create_invoice_dto_spec.rb +31 -35
- data/spec/models/create_liquidation_address_dto_spec.rb +28 -32
- data/spec/models/create_payment_link_dto_spec.rb +34 -76
- data/spec/models/create_stable_payment_intent_dto_spec.rb +26 -30
- data/spec/models/create_stablecoin_conversion_dto_spec.rb +16 -20
- data/spec/models/create_tax_dto_spec.rb +60 -0
- data/spec/models/create_webhook_dto_spec.rb +16 -20
- data/spec/models/customer_status_spec.rb +11 -15
- data/spec/models/customer_type_spec.rb +30 -0
- data/spec/models/destination_currency_spec.rb +11 -15
- data/spec/models/exchange_rate_response_dto_spec.rb +17 -21
- data/spec/models/fiat_currency_spec.rb +11 -15
- data/spec/models/health_response_dto_spec.rb +19 -23
- data/spec/models/invoice_product_dto_spec.rb +13 -17
- data/spec/models/liquidation_address_response_dto_spec.rb +25 -29
- data/spec/models/payment_link_product_dto_spec.rb +13 -17
- data/spec/models/payment_request_dto_spec.rb +15 -19
- data/spec/models/payment_response_dto_spec.rb +16 -20
- data/spec/models/public_health_response_dto_spec.rb +15 -19
- data/spec/models/refund_response_dto_spec.rb +16 -20
- data/spec/models/stable_coin_currency_spec.rb +11 -15
- data/spec/models/tax_controller_create201_response_spec.rb +72 -0
- data/spec/models/tax_controller_delete_without_id400_response_spec.rb +48 -0
- data/spec/models/tax_controller_update_without_id400_response_spec.rb +48 -0
- data/spec/models/update_customer_dto_spec.rb +17 -25
- data/spec/models/update_tax_dto_spec.rb +60 -0
- data/spec/models/update_webhook_dto_spec.rb +16 -20
- data/spec/models/webhook_response_dto_spec.rb +19 -23
- data/spec/spec_helper.rb +5 -4
- metadata +49 -116
- data/docs/AllOfAllBalancesResponseEurc.md +0 -9
- data/docs/AllOfAllBalancesResponseUsdc.md +0 -9
- data/docs/AllOfCreateBankPaymentIntentDtoDestinationCurrency.md +0 -6
- data/docs/AllOfCreateBankPaymentIntentDtoDestinationNetwork.md +0 -6
- data/docs/AllOfCreateBankPaymentIntentDtoSourceCurrency.md +0 -6
- data/docs/AllOfCreateBankPaymentIntentDtoSourcePaymentRail.md +0 -6
- data/docs/AllOfCreateCustomerDtoStatus.md +0 -6
- data/docs/AllOfCreateLiquidationAddressDtoDestinationCurrency.md +0 -6
- data/docs/AllOfCreateLiquidationAddressDtoDestinationPaymentRail.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoDestinationCurrency.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoDestinationNetwork.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoSourceCurrency.md +0 -6
- data/docs/AllOfCreateStablePaymentIntentDtoSourceNetwork.md +0 -6
- data/docs/AllOfUpdateCustomerDtoStatus.md +0 -6
- data/docs/CreateProductDto.md +0 -18
- data/docs/CreateTaxInput.md +0 -6
- data/docs/UpdatePaymentLinkDto.md +0 -6
- data/docs/UpdatePreferenceInput.md +0 -6
- data/docs/UpdateProductDto.md +0 -18
- data/docs/UpdateTaxInput.md +0 -6
- data/example.rb +0 -94
- data/lib/devdraft/models/all_of_all_balances_response_eurc.rb +0 -283
- data/lib/devdraft/models/all_of_all_balances_response_usdc.rb +0 -283
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_destination_network.rb +0 -202
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_bank_payment_intent_dto_source_payment_rail.rb +0 -202
- data/lib/devdraft/models/all_of_create_customer_dto_status.rb +0 -202
- data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_liquidation_address_dto_destination_payment_rail.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_destination_network.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_currency.rb +0 -202
- data/lib/devdraft/models/all_of_create_stable_payment_intent_dto_source_network.rb +0 -202
- data/lib/devdraft/models/all_of_update_customer_dto_status.rb +0 -202
- data/lib/devdraft/models/create_product_dto.rb +0 -370
- data/lib/devdraft/models/create_tax_input.rb +0 -197
- data/lib/devdraft/models/update_payment_link_dto.rb +0 -197
- data/lib/devdraft/models/update_preference_input.rb +0 -197
- data/lib/devdraft/models/update_product_dto.rb +0 -355
- data/lib/devdraft/models/update_tax_input.rb +0 -197
- data/spec/api_client_spec.rb +0 -225
- data/spec/base_object_spec.rb +0 -109
- data/spec/configuration_spec.rb +0 -41
- data/spec/models/all_of_all_balances_response_eurc_spec.rb +0 -56
- data/spec/models/all_of_all_balances_response_usdc_spec.rb +0 -56
- data/spec/models/all_of_create_bank_payment_intent_dto_destination_currency_spec.rb +0 -34
- data/spec/models/all_of_create_bank_payment_intent_dto_destination_network_spec.rb +0 -34
- data/spec/models/all_of_create_bank_payment_intent_dto_source_currency_spec.rb +0 -34
- data/spec/models/all_of_create_bank_payment_intent_dto_source_payment_rail_spec.rb +0 -34
- data/spec/models/all_of_create_customer_dto_status_spec.rb +0 -34
- data/spec/models/all_of_create_liquidation_address_dto_destination_currency_spec.rb +0 -34
- data/spec/models/all_of_create_liquidation_address_dto_destination_payment_rail_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_destination_currency_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_destination_network_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_source_currency_spec.rb +0 -34
- data/spec/models/all_of_create_stable_payment_intent_dto_source_network_spec.rb +0 -34
- data/spec/models/all_of_update_customer_dto_status_spec.rb +0 -34
- data/spec/models/create_product_dto_spec.rb +0 -110
- data/spec/models/create_tax_input_spec.rb +0 -34
- data/spec/models/update_payment_link_dto_spec.rb +0 -34
- data/spec/models/update_preference_input_spec.rb +0 -34
- data/spec/models/update_product_dto_spec.rb +0 -110
- data/spec/models/update_tax_input_spec.rb +0 -34
data/docs/ProductsApi.md
CHANGED
|
@@ -1,79 +1,101 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Devdraft::ProductsApi
|
|
2
2
|
|
|
3
3
|
All URIs are relative to *https://api.devdraft.ai*
|
|
4
4
|
|
|
5
|
-
Method | HTTP request | Description
|
|
6
|
-
|
|
7
|
-
[**product_controller_create**](ProductsApi.md#product_controller_create) | **POST** /api/v0/products | Create a new product
|
|
8
|
-
[**product_controller_find_all**](ProductsApi.md#product_controller_find_all) | **GET** /api/v0/products | Get all products
|
|
9
|
-
[**product_controller_find_one**](ProductsApi.md#product_controller_find_one) | **GET** /api/v0/products/{id} | Get a product by ID
|
|
10
|
-
[**product_controller_remove**](ProductsApi.md#product_controller_remove) | **DELETE** /api/v0/products/{id} | Delete a product
|
|
11
|
-
[**product_controller_update**](ProductsApi.md#product_controller_update) | **PUT** /api/v0/products/{id} | Update a product
|
|
12
|
-
[**product_controller_upload_image**](ProductsApi.md#product_controller_upload_image) | **POST** /api/v0/products/{id}/images | Upload images for a product
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**product_controller_create**](ProductsApi.md#product_controller_create) | **POST** /api/v0/products | Create a new product |
|
|
8
|
+
| [**product_controller_find_all**](ProductsApi.md#product_controller_find_all) | **GET** /api/v0/products | Get all products |
|
|
9
|
+
| [**product_controller_find_one**](ProductsApi.md#product_controller_find_one) | **GET** /api/v0/products/{id} | Get a product by ID |
|
|
10
|
+
| [**product_controller_remove**](ProductsApi.md#product_controller_remove) | **DELETE** /api/v0/products/{id} | Delete a product |
|
|
11
|
+
| [**product_controller_update**](ProductsApi.md#product_controller_update) | **PUT** /api/v0/products/{id} | Update a product |
|
|
12
|
+
| [**product_controller_upload_image**](ProductsApi.md#product_controller_upload_image) | **POST** /api/v0/products/{id}/images | Upload images for a product |
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
|
|
15
|
+
## product_controller_create
|
|
16
|
+
|
|
17
|
+
> product_controller_create(name, description, price, opts)
|
|
16
18
|
|
|
17
19
|
Create a new product
|
|
18
20
|
|
|
19
21
|
Creates a new product with optional image uploads. This endpoint allows you to create products with detailed information and multiple images. ## Use Cases - Add new products to your catalog - Create products with multiple images - Set up product pricing and descriptions ## Supported Image Formats - JPEG/JPG - PNG - WebP - Maximum 10 images per product - Maximum file size: 5MB per image ## Example Request (multipart/form-data) ``` name: \"Premium Widget\" description: \"High-quality widget for all your needs\" price: \"99.99\" images: [file1.jpg, file2.jpg] // Optional, up to 10 images ``` ## Required Fields - `name`: Product name - `price`: Product price (decimal number) ## Optional Fields - `description`: Detailed product description - `images`: Product images (up to 10 files)
|
|
20
22
|
|
|
21
|
-
###
|
|
23
|
+
### Examples
|
|
24
|
+
|
|
22
25
|
```ruby
|
|
23
|
-
|
|
24
|
-
require '
|
|
26
|
+
require 'time'
|
|
27
|
+
require 'devdraft'
|
|
25
28
|
# setup authorization
|
|
26
|
-
|
|
29
|
+
Devdraft.configure do |config|
|
|
30
|
+
# Configure API key authorization: x-client-secret
|
|
31
|
+
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
|
32
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
33
|
+
# config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
34
|
+
|
|
27
35
|
# Configure API key authorization: x-client-key
|
|
28
36
|
config.api_key['x-client-key'] = 'YOUR API KEY'
|
|
29
37
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
30
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
38
|
+
# config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
39
|
+
end
|
|
31
40
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
api_instance = Devdraft::ProductsApi.new
|
|
42
|
+
name = 'name_example' # String | Product name as it will appear to customers. Should be clear and descriptive.
|
|
43
|
+
description = 'description_example' # String | Detailed description of the product. Supports markdown formatting for rich text display.
|
|
44
|
+
price = 8.14 # Float | Product price in the specified currency. Must be greater than 0.
|
|
45
|
+
opts = {
|
|
46
|
+
currency: 'USD', # String | Currency code for the price. Defaults to USD if not specified.
|
|
47
|
+
type: 'type_example', # String | Product type
|
|
48
|
+
weight: 8.14, # Float | Weight of the product
|
|
49
|
+
unit: 'unit_example', # String | Unit of measurement
|
|
50
|
+
quantity: 8.14, # Float | Quantity available
|
|
51
|
+
stock_count: 8.14, # Float | Stock count
|
|
52
|
+
status: 'status_example', # String | Product status
|
|
53
|
+
product_type: 'product_type_example', # String | Product type
|
|
54
|
+
images: ['inner_example'] # Array<String> | Array of image URLs
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
begin
|
|
58
|
+
# Create a new product
|
|
59
|
+
api_instance.product_controller_create(name, description, price, opts)
|
|
60
|
+
rescue Devdraft::ApiError => e
|
|
61
|
+
puts "Error when calling ProductsApi->product_controller_create: #{e}"
|
|
36
62
|
end
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### Using the product_controller_create_with_http_info variant
|
|
37
66
|
|
|
38
|
-
|
|
39
|
-
name = 'name_example' # String |
|
|
40
|
-
description = 'description_example' # String |
|
|
41
|
-
price = DevDraftAI::BigDecimal.new # BigDecimal |
|
|
42
|
-
currency = 'currency_example' # String |
|
|
43
|
-
type = 'type_example' # String |
|
|
44
|
-
weight = DevDraftAI::BigDecimal.new # BigDecimal |
|
|
45
|
-
unit = 'unit_example' # String |
|
|
46
|
-
quantity = DevDraftAI::BigDecimal.new # BigDecimal |
|
|
47
|
-
stock_count = DevDraftAI::BigDecimal.new # BigDecimal |
|
|
48
|
-
status = 'status_example' # String |
|
|
49
|
-
product_type = 'product_type_example' # String |
|
|
50
|
-
images = ['images_example'] # Array<String> |
|
|
67
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
51
68
|
|
|
69
|
+
> <Array(nil, Integer, Hash)> product_controller_create_with_http_info(name, description, price, opts)
|
|
52
70
|
|
|
71
|
+
```ruby
|
|
53
72
|
begin
|
|
54
|
-
#Create a new product
|
|
55
|
-
api_instance.
|
|
56
|
-
|
|
57
|
-
|
|
73
|
+
# Create a new product
|
|
74
|
+
data, status_code, headers = api_instance.product_controller_create_with_http_info(name, description, price, opts)
|
|
75
|
+
p status_code # => 2xx
|
|
76
|
+
p headers # => { ... }
|
|
77
|
+
p data # => nil
|
|
78
|
+
rescue Devdraft::ApiError => e
|
|
79
|
+
puts "Error when calling ProductsApi->product_controller_create_with_http_info: #{e}"
|
|
58
80
|
end
|
|
59
81
|
```
|
|
60
82
|
|
|
61
83
|
### Parameters
|
|
62
84
|
|
|
63
|
-
Name | Type | Description
|
|
64
|
-
|
|
65
|
-
**name** | **String
|
|
66
|
-
**description** | **String
|
|
67
|
-
**price** | **
|
|
68
|
-
**currency** | **String
|
|
69
|
-
**type** | **String
|
|
70
|
-
**weight** | **
|
|
71
|
-
**unit** | **String
|
|
72
|
-
**quantity** | **
|
|
73
|
-
**stock_count** | **
|
|
74
|
-
**status** | **String
|
|
75
|
-
**product_type** | **String
|
|
76
|
-
**images** | [**Array<String>**](String.md)|
|
|
85
|
+
| Name | Type | Description | Notes |
|
|
86
|
+
| ---- | ---- | ----------- | ----- |
|
|
87
|
+
| **name** | **String** | Product name as it will appear to customers. Should be clear and descriptive. | |
|
|
88
|
+
| **description** | **String** | Detailed description of the product. Supports markdown formatting for rich text display. | |
|
|
89
|
+
| **price** | **Float** | Product price in the specified currency. Must be greater than 0. | |
|
|
90
|
+
| **currency** | **String** | Currency code for the price. Defaults to USD if not specified. | [optional][default to 'USD'] |
|
|
91
|
+
| **type** | **String** | Product type | [optional] |
|
|
92
|
+
| **weight** | **Float** | Weight of the product | [optional] |
|
|
93
|
+
| **unit** | **String** | Unit of measurement | [optional] |
|
|
94
|
+
| **quantity** | **Float** | Quantity available | [optional] |
|
|
95
|
+
| **stock_count** | **Float** | Stock count | [optional] |
|
|
96
|
+
| **status** | **String** | Product status | [optional] |
|
|
97
|
+
| **product_type** | **String** | Product type | [optional] |
|
|
98
|
+
| **images** | [**Array<String>**](String.md) | Array of image URLs | [optional] |
|
|
77
99
|
|
|
78
100
|
### Return type
|
|
79
101
|
|
|
@@ -81,59 +103,78 @@ nil (empty response body)
|
|
|
81
103
|
|
|
82
104
|
### Authorization
|
|
83
105
|
|
|
84
|
-
[x-client-
|
|
106
|
+
[x-client-secret](../README.md#x-client-secret), [x-client-key](../README.md#x-client-key)
|
|
85
107
|
|
|
86
108
|
### HTTP request headers
|
|
87
109
|
|
|
88
|
-
|
|
89
|
-
|
|
110
|
+
- **Content-Type**: multipart/form-data
|
|
111
|
+
- **Accept**: Not defined
|
|
90
112
|
|
|
91
113
|
|
|
114
|
+
## product_controller_find_all
|
|
92
115
|
|
|
93
|
-
# **product_controller_find_all**
|
|
94
116
|
> product_controller_find_all(opts)
|
|
95
117
|
|
|
96
118
|
Get all products
|
|
97
119
|
|
|
98
120
|
Retrieves a list of products with pagination. This endpoint allows you to fetch products with optional pagination. ## Use Cases - List all products - Browse product catalog - Implement product search ## Query Parameters - `skip`: Number of records to skip (default: 0) - `take`: Number of records to take (default: 10) ## Example Response ```json { \"data\": [ { \"id\": \"prod_123456\", \"name\": \"Premium Widget\", \"description\": \"High-quality widget for all your needs\", \"price\": \"99.99\", \"images\": [ \"https://storage.example.com/images/file1.jpg\", \"https://storage.example.com/images/file2.jpg\" ], \"createdAt\": \"2024-03-20T10:00:00Z\" } ], \"total\": 100, \"skip\": 0, \"take\": 10 } ```
|
|
99
121
|
|
|
100
|
-
###
|
|
122
|
+
### Examples
|
|
123
|
+
|
|
101
124
|
```ruby
|
|
102
|
-
|
|
103
|
-
require '
|
|
125
|
+
require 'time'
|
|
126
|
+
require 'devdraft'
|
|
104
127
|
# setup authorization
|
|
105
|
-
|
|
106
|
-
# Configure API key authorization: x-client-key
|
|
107
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
|
108
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
109
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
110
|
-
|
|
128
|
+
Devdraft.configure do |config|
|
|
111
129
|
# Configure API key authorization: x-client-secret
|
|
112
130
|
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
|
113
131
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
114
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
132
|
+
# config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
133
|
+
|
|
134
|
+
# Configure API key authorization: x-client-key
|
|
135
|
+
config.api_key['x-client-key'] = 'YOUR API KEY'
|
|
136
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
137
|
+
# config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
115
138
|
end
|
|
116
139
|
|
|
117
|
-
api_instance =
|
|
118
|
-
opts = {
|
|
119
|
-
skip:
|
|
120
|
-
take:
|
|
140
|
+
api_instance = Devdraft::ProductsApi.new
|
|
141
|
+
opts = {
|
|
142
|
+
skip: 8.14, # Float | Number of records to skip
|
|
143
|
+
take: 8.14 # Float | Number of records to take
|
|
121
144
|
}
|
|
122
145
|
|
|
123
146
|
begin
|
|
124
|
-
#Get all products
|
|
147
|
+
# Get all products
|
|
125
148
|
api_instance.product_controller_find_all(opts)
|
|
126
|
-
rescue
|
|
127
|
-
puts "
|
|
149
|
+
rescue Devdraft::ApiError => e
|
|
150
|
+
puts "Error when calling ProductsApi->product_controller_find_all: #{e}"
|
|
151
|
+
end
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### Using the product_controller_find_all_with_http_info variant
|
|
155
|
+
|
|
156
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
157
|
+
|
|
158
|
+
> <Array(nil, Integer, Hash)> product_controller_find_all_with_http_info(opts)
|
|
159
|
+
|
|
160
|
+
```ruby
|
|
161
|
+
begin
|
|
162
|
+
# Get all products
|
|
163
|
+
data, status_code, headers = api_instance.product_controller_find_all_with_http_info(opts)
|
|
164
|
+
p status_code # => 2xx
|
|
165
|
+
p headers # => { ... }
|
|
166
|
+
p data # => nil
|
|
167
|
+
rescue Devdraft::ApiError => e
|
|
168
|
+
puts "Error when calling ProductsApi->product_controller_find_all_with_http_info: #{e}"
|
|
128
169
|
end
|
|
129
170
|
```
|
|
130
171
|
|
|
131
172
|
### Parameters
|
|
132
173
|
|
|
133
|
-
Name | Type | Description
|
|
134
|
-
|
|
135
|
-
**skip** | **
|
|
136
|
-
**take** | **
|
|
174
|
+
| Name | Type | Description | Notes |
|
|
175
|
+
| ---- | ---- | ----------- | ----- |
|
|
176
|
+
| **skip** | **Float** | Number of records to skip | [optional] |
|
|
177
|
+
| **take** | **Float** | Number of records to take | [optional] |
|
|
137
178
|
|
|
138
179
|
### Return type
|
|
139
180
|
|
|
@@ -141,56 +182,74 @@ nil (empty response body)
|
|
|
141
182
|
|
|
142
183
|
### Authorization
|
|
143
184
|
|
|
144
|
-
[x-client-
|
|
185
|
+
[x-client-secret](../README.md#x-client-secret), [x-client-key](../README.md#x-client-key)
|
|
145
186
|
|
|
146
187
|
### HTTP request headers
|
|
147
188
|
|
|
148
|
-
|
|
149
|
-
|
|
189
|
+
- **Content-Type**: Not defined
|
|
190
|
+
- **Accept**: Not defined
|
|
150
191
|
|
|
151
192
|
|
|
193
|
+
## product_controller_find_one
|
|
152
194
|
|
|
153
|
-
# **product_controller_find_one**
|
|
154
195
|
> product_controller_find_one(id)
|
|
155
196
|
|
|
156
197
|
Get a product by ID
|
|
157
198
|
|
|
158
199
|
Retrieves detailed information about a specific product. This endpoint allows you to fetch complete product details including all images. ## Use Cases - View product details - Display product information - Check product availability ## Example Response ```json { \"id\": \"prod_123456\", \"name\": \"Premium Widget\", \"description\": \"High-quality widget for all your needs\", \"price\": \"99.99\", \"images\": [ \"https://storage.example.com/images/file1.jpg\", \"https://storage.example.com/images/file2.jpg\" ], \"createdAt\": \"2024-03-20T10:00:00Z\", \"updatedAt\": \"2024-03-20T10:00:00Z\" } ```
|
|
159
200
|
|
|
160
|
-
###
|
|
201
|
+
### Examples
|
|
202
|
+
|
|
161
203
|
```ruby
|
|
162
|
-
|
|
163
|
-
require '
|
|
204
|
+
require 'time'
|
|
205
|
+
require 'devdraft'
|
|
164
206
|
# setup authorization
|
|
165
|
-
|
|
166
|
-
# Configure API key authorization: x-client-key
|
|
167
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
|
168
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
169
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
170
|
-
|
|
207
|
+
Devdraft.configure do |config|
|
|
171
208
|
# Configure API key authorization: x-client-secret
|
|
172
209
|
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
|
173
210
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
174
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
211
|
+
# config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
212
|
+
|
|
213
|
+
# Configure API key authorization: x-client-key
|
|
214
|
+
config.api_key['x-client-key'] = 'YOUR API KEY'
|
|
215
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
216
|
+
# config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
175
217
|
end
|
|
176
218
|
|
|
177
|
-
api_instance =
|
|
219
|
+
api_instance = Devdraft::ProductsApi.new
|
|
178
220
|
id = 'id_example' # String | Product ID
|
|
179
221
|
|
|
180
|
-
|
|
181
222
|
begin
|
|
182
|
-
#Get a product by ID
|
|
223
|
+
# Get a product by ID
|
|
183
224
|
api_instance.product_controller_find_one(id)
|
|
184
|
-
rescue
|
|
185
|
-
puts "
|
|
225
|
+
rescue Devdraft::ApiError => e
|
|
226
|
+
puts "Error when calling ProductsApi->product_controller_find_one: #{e}"
|
|
227
|
+
end
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
#### Using the product_controller_find_one_with_http_info variant
|
|
231
|
+
|
|
232
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
233
|
+
|
|
234
|
+
> <Array(nil, Integer, Hash)> product_controller_find_one_with_http_info(id)
|
|
235
|
+
|
|
236
|
+
```ruby
|
|
237
|
+
begin
|
|
238
|
+
# Get a product by ID
|
|
239
|
+
data, status_code, headers = api_instance.product_controller_find_one_with_http_info(id)
|
|
240
|
+
p status_code # => 2xx
|
|
241
|
+
p headers # => { ... }
|
|
242
|
+
p data # => nil
|
|
243
|
+
rescue Devdraft::ApiError => e
|
|
244
|
+
puts "Error when calling ProductsApi->product_controller_find_one_with_http_info: #{e}"
|
|
186
245
|
end
|
|
187
246
|
```
|
|
188
247
|
|
|
189
248
|
### Parameters
|
|
190
249
|
|
|
191
|
-
Name | Type | Description
|
|
192
|
-
|
|
193
|
-
**id** | **String
|
|
250
|
+
| Name | Type | Description | Notes |
|
|
251
|
+
| ---- | ---- | ----------- | ----- |
|
|
252
|
+
| **id** | **String** | Product ID | |
|
|
194
253
|
|
|
195
254
|
### Return type
|
|
196
255
|
|
|
@@ -198,56 +257,74 @@ nil (empty response body)
|
|
|
198
257
|
|
|
199
258
|
### Authorization
|
|
200
259
|
|
|
201
|
-
[x-client-
|
|
260
|
+
[x-client-secret](../README.md#x-client-secret), [x-client-key](../README.md#x-client-key)
|
|
202
261
|
|
|
203
262
|
### HTTP request headers
|
|
204
263
|
|
|
205
|
-
|
|
206
|
-
|
|
264
|
+
- **Content-Type**: Not defined
|
|
265
|
+
- **Accept**: Not defined
|
|
207
266
|
|
|
208
267
|
|
|
268
|
+
## product_controller_remove
|
|
209
269
|
|
|
210
|
-
# **product_controller_remove**
|
|
211
270
|
> product_controller_remove(id)
|
|
212
271
|
|
|
213
272
|
Delete a product
|
|
214
273
|
|
|
215
274
|
Deletes a product and its associated images. This endpoint allows you to remove a product and all its associated data. ## Use Cases - Remove discontinued products - Clean up product catalog - Delete test products ## Notes - This action cannot be undone - All product images will be deleted - Associated data will be removed
|
|
216
275
|
|
|
217
|
-
###
|
|
276
|
+
### Examples
|
|
277
|
+
|
|
218
278
|
```ruby
|
|
219
|
-
|
|
220
|
-
require '
|
|
279
|
+
require 'time'
|
|
280
|
+
require 'devdraft'
|
|
221
281
|
# setup authorization
|
|
222
|
-
|
|
223
|
-
# Configure API key authorization: x-client-key
|
|
224
|
-
config.api_key['x-client-key'] = '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-key'] = 'Bearer'
|
|
227
|
-
|
|
282
|
+
Devdraft.configure do |config|
|
|
228
283
|
# Configure API key authorization: x-client-secret
|
|
229
284
|
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
|
230
285
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
231
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
286
|
+
# config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
287
|
+
|
|
288
|
+
# Configure API key authorization: x-client-key
|
|
289
|
+
config.api_key['x-client-key'] = 'YOUR API KEY'
|
|
290
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
291
|
+
# config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
232
292
|
end
|
|
233
293
|
|
|
234
|
-
api_instance =
|
|
294
|
+
api_instance = Devdraft::ProductsApi.new
|
|
235
295
|
id = 'id_example' # String | Product ID
|
|
236
296
|
|
|
237
|
-
|
|
238
297
|
begin
|
|
239
|
-
#Delete a product
|
|
298
|
+
# Delete a product
|
|
240
299
|
api_instance.product_controller_remove(id)
|
|
241
|
-
rescue
|
|
242
|
-
puts "
|
|
300
|
+
rescue Devdraft::ApiError => e
|
|
301
|
+
puts "Error when calling ProductsApi->product_controller_remove: #{e}"
|
|
302
|
+
end
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
#### Using the product_controller_remove_with_http_info variant
|
|
306
|
+
|
|
307
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
308
|
+
|
|
309
|
+
> <Array(nil, Integer, Hash)> product_controller_remove_with_http_info(id)
|
|
310
|
+
|
|
311
|
+
```ruby
|
|
312
|
+
begin
|
|
313
|
+
# Delete a product
|
|
314
|
+
data, status_code, headers = api_instance.product_controller_remove_with_http_info(id)
|
|
315
|
+
p status_code # => 2xx
|
|
316
|
+
p headers # => { ... }
|
|
317
|
+
p data # => nil
|
|
318
|
+
rescue Devdraft::ApiError => e
|
|
319
|
+
puts "Error when calling ProductsApi->product_controller_remove_with_http_info: #{e}"
|
|
243
320
|
end
|
|
244
321
|
```
|
|
245
322
|
|
|
246
323
|
### Parameters
|
|
247
324
|
|
|
248
|
-
Name | Type | Description
|
|
249
|
-
|
|
250
|
-
**id** | **String
|
|
325
|
+
| Name | Type | Description | Notes |
|
|
326
|
+
| ---- | ---- | ----------- | ----- |
|
|
327
|
+
| **id** | **String** | Product ID | |
|
|
251
328
|
|
|
252
329
|
### Return type
|
|
253
330
|
|
|
@@ -255,80 +332,100 @@ nil (empty response body)
|
|
|
255
332
|
|
|
256
333
|
### Authorization
|
|
257
334
|
|
|
258
|
-
[x-client-
|
|
335
|
+
[x-client-secret](../README.md#x-client-secret), [x-client-key](../README.md#x-client-key)
|
|
259
336
|
|
|
260
337
|
### HTTP request headers
|
|
261
338
|
|
|
262
|
-
|
|
263
|
-
|
|
339
|
+
- **Content-Type**: Not defined
|
|
340
|
+
- **Accept**: Not defined
|
|
264
341
|
|
|
265
342
|
|
|
343
|
+
## product_controller_update
|
|
266
344
|
|
|
267
|
-
|
|
268
|
-
> product_controller_update(namedescriptionpricecurrencytypeweightunitquantitystock_countstatusproduct_typeimagesid)
|
|
345
|
+
> product_controller_update(id, opts)
|
|
269
346
|
|
|
270
347
|
Update a product
|
|
271
348
|
|
|
272
349
|
Updates an existing product's information and optionally adds new images. This endpoint allows you to modify product details and manage product images. ## Use Cases - Update product information - Change product pricing - Modify product images - Update product description ## Example Request (multipart/form-data) ``` name: \"Updated Premium Widget\" description: \"Updated description\" price: \"129.99\" images: [file1.jpg, file2.jpg] // Optional, up to 10 images ``` ## Notes - Only include fields that need to be updated - New images will replace existing images - Maximum 10 images per product - Images are automatically optimized
|
|
273
350
|
|
|
274
|
-
###
|
|
351
|
+
### Examples
|
|
352
|
+
|
|
275
353
|
```ruby
|
|
276
|
-
|
|
277
|
-
require '
|
|
354
|
+
require 'time'
|
|
355
|
+
require 'devdraft'
|
|
278
356
|
# setup authorization
|
|
279
|
-
|
|
280
|
-
# Configure API key authorization: x-client-key
|
|
281
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
|
282
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
283
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
284
|
-
|
|
357
|
+
Devdraft.configure do |config|
|
|
285
358
|
# Configure API key authorization: x-client-secret
|
|
286
359
|
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
|
287
360
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
288
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
361
|
+
# config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
362
|
+
|
|
363
|
+
# Configure API key authorization: x-client-key
|
|
364
|
+
config.api_key['x-client-key'] = 'YOUR API KEY'
|
|
365
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
366
|
+
# config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
289
367
|
end
|
|
290
368
|
|
|
291
|
-
api_instance =
|
|
292
|
-
name = 'name_example' # String |
|
|
293
|
-
description = 'description_example' # String |
|
|
294
|
-
price = DevDraftAI::BigDecimal.new # BigDecimal |
|
|
295
|
-
currency = 'currency_example' # String |
|
|
296
|
-
type = 'type_example' # String |
|
|
297
|
-
weight = DevDraftAI::BigDecimal.new # BigDecimal |
|
|
298
|
-
unit = 'unit_example' # String |
|
|
299
|
-
quantity = DevDraftAI::BigDecimal.new # BigDecimal |
|
|
300
|
-
stock_count = DevDraftAI::BigDecimal.new # BigDecimal |
|
|
301
|
-
status = 'status_example' # String |
|
|
302
|
-
product_type = 'product_type_example' # String |
|
|
303
|
-
images = ['images_example'] # Array<String> |
|
|
369
|
+
api_instance = Devdraft::ProductsApi.new
|
|
304
370
|
id = 'id_example' # String | Product ID
|
|
371
|
+
opts = {
|
|
372
|
+
name: 'name_example', # String | Product name as it will appear to customers. Should be clear and descriptive.
|
|
373
|
+
description: 'description_example', # String | Detailed description of the product. Supports markdown formatting for rich text display.
|
|
374
|
+
price: 8.14, # Float | Product price in the specified currency. Must be greater than 0.
|
|
375
|
+
currency: 'USD', # String | Currency code for the price. Defaults to USD if not specified.
|
|
376
|
+
type: 'type_example', # String | Product type
|
|
377
|
+
weight: 8.14, # Float | Weight of the product
|
|
378
|
+
unit: 'unit_example', # String | Unit of measurement
|
|
379
|
+
quantity: 8.14, # Float | Quantity available
|
|
380
|
+
stock_count: 8.14, # Float | Stock count
|
|
381
|
+
status: 'status_example', # String | Product status
|
|
382
|
+
product_type: 'product_type_example', # String | Product type
|
|
383
|
+
images: ['inner_example'] # Array<String> | Array of image URLs
|
|
384
|
+
}
|
|
305
385
|
|
|
386
|
+
begin
|
|
387
|
+
# Update a product
|
|
388
|
+
api_instance.product_controller_update(id, opts)
|
|
389
|
+
rescue Devdraft::ApiError => e
|
|
390
|
+
puts "Error when calling ProductsApi->product_controller_update: #{e}"
|
|
391
|
+
end
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
#### Using the product_controller_update_with_http_info variant
|
|
395
|
+
|
|
396
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
306
397
|
|
|
398
|
+
> <Array(nil, Integer, Hash)> product_controller_update_with_http_info(id, opts)
|
|
399
|
+
|
|
400
|
+
```ruby
|
|
307
401
|
begin
|
|
308
|
-
#Update a product
|
|
309
|
-
api_instance.
|
|
310
|
-
|
|
311
|
-
|
|
402
|
+
# Update a product
|
|
403
|
+
data, status_code, headers = api_instance.product_controller_update_with_http_info(id, opts)
|
|
404
|
+
p status_code # => 2xx
|
|
405
|
+
p headers # => { ... }
|
|
406
|
+
p data # => nil
|
|
407
|
+
rescue Devdraft::ApiError => e
|
|
408
|
+
puts "Error when calling ProductsApi->product_controller_update_with_http_info: #{e}"
|
|
312
409
|
end
|
|
313
410
|
```
|
|
314
411
|
|
|
315
412
|
### Parameters
|
|
316
413
|
|
|
317
|
-
Name | Type | Description
|
|
318
|
-
|
|
319
|
-
**
|
|
320
|
-
**
|
|
321
|
-
**
|
|
322
|
-
**
|
|
323
|
-
**
|
|
324
|
-
**
|
|
325
|
-
**
|
|
326
|
-
**
|
|
327
|
-
**
|
|
328
|
-
**
|
|
329
|
-
**
|
|
330
|
-
**
|
|
331
|
-
**
|
|
414
|
+
| Name | Type | Description | Notes |
|
|
415
|
+
| ---- | ---- | ----------- | ----- |
|
|
416
|
+
| **id** | **String** | Product ID | |
|
|
417
|
+
| **name** | **String** | Product name as it will appear to customers. Should be clear and descriptive. | [optional] |
|
|
418
|
+
| **description** | **String** | Detailed description of the product. Supports markdown formatting for rich text display. | [optional] |
|
|
419
|
+
| **price** | **Float** | Product price in the specified currency. Must be greater than 0. | [optional] |
|
|
420
|
+
| **currency** | **String** | Currency code for the price. Defaults to USD if not specified. | [optional][default to 'USD'] |
|
|
421
|
+
| **type** | **String** | Product type | [optional] |
|
|
422
|
+
| **weight** | **Float** | Weight of the product | [optional] |
|
|
423
|
+
| **unit** | **String** | Unit of measurement | [optional] |
|
|
424
|
+
| **quantity** | **Float** | Quantity available | [optional] |
|
|
425
|
+
| **stock_count** | **Float** | Stock count | [optional] |
|
|
426
|
+
| **status** | **String** | Product status | [optional] |
|
|
427
|
+
| **product_type** | **String** | Product type | [optional] |
|
|
428
|
+
| **images** | [**Array<String>**](String.md) | Array of image URLs | [optional] |
|
|
332
429
|
|
|
333
430
|
### Return type
|
|
334
431
|
|
|
@@ -336,56 +433,74 @@ nil (empty response body)
|
|
|
336
433
|
|
|
337
434
|
### Authorization
|
|
338
435
|
|
|
339
|
-
[x-client-
|
|
436
|
+
[x-client-secret](../README.md#x-client-secret), [x-client-key](../README.md#x-client-key)
|
|
340
437
|
|
|
341
438
|
### HTTP request headers
|
|
342
439
|
|
|
343
|
-
|
|
344
|
-
|
|
440
|
+
- **Content-Type**: multipart/form-data
|
|
441
|
+
- **Accept**: Not defined
|
|
345
442
|
|
|
346
443
|
|
|
444
|
+
## product_controller_upload_image
|
|
347
445
|
|
|
348
|
-
# **product_controller_upload_image**
|
|
349
446
|
> product_controller_upload_image(id)
|
|
350
447
|
|
|
351
448
|
Upload images for a product
|
|
352
449
|
|
|
353
450
|
Adds new images to an existing product. This endpoint allows you to upload additional images for a product that already exists. ## Use Cases - Add more product images - Update product gallery - Enhance product presentation ## Supported Image Formats - JPEG/JPG - PNG - WebP - Maximum 10 images per upload - Maximum file size: 5MB per image ## Example Request (multipart/form-data) ``` images: [file1.jpg, file2.jpg] // Up to 10 images ``` ## Notes - Images are appended to existing product images - Total images per product cannot exceed 10 - Images are automatically optimized and resized
|
|
354
451
|
|
|
355
|
-
###
|
|
452
|
+
### Examples
|
|
453
|
+
|
|
356
454
|
```ruby
|
|
357
|
-
|
|
358
|
-
require '
|
|
455
|
+
require 'time'
|
|
456
|
+
require 'devdraft'
|
|
359
457
|
# setup authorization
|
|
360
|
-
|
|
361
|
-
# Configure API key authorization: x-client-key
|
|
362
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
|
363
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
364
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
365
|
-
|
|
458
|
+
Devdraft.configure do |config|
|
|
366
459
|
# Configure API key authorization: x-client-secret
|
|
367
460
|
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
|
368
461
|
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
369
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
462
|
+
# config.api_key_prefix['x-client-secret'] = 'Bearer'
|
|
463
|
+
|
|
464
|
+
# Configure API key authorization: x-client-key
|
|
465
|
+
config.api_key['x-client-key'] = 'YOUR API KEY'
|
|
466
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
467
|
+
# config.api_key_prefix['x-client-key'] = 'Bearer'
|
|
370
468
|
end
|
|
371
469
|
|
|
372
|
-
api_instance =
|
|
470
|
+
api_instance = Devdraft::ProductsApi.new
|
|
373
471
|
id = 'id_example' # String | Product ID
|
|
374
472
|
|
|
375
|
-
|
|
376
473
|
begin
|
|
377
|
-
#Upload images for a product
|
|
474
|
+
# Upload images for a product
|
|
378
475
|
api_instance.product_controller_upload_image(id)
|
|
379
|
-
rescue
|
|
380
|
-
puts "
|
|
476
|
+
rescue Devdraft::ApiError => e
|
|
477
|
+
puts "Error when calling ProductsApi->product_controller_upload_image: #{e}"
|
|
478
|
+
end
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
#### Using the product_controller_upload_image_with_http_info variant
|
|
482
|
+
|
|
483
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
484
|
+
|
|
485
|
+
> <Array(nil, Integer, Hash)> product_controller_upload_image_with_http_info(id)
|
|
486
|
+
|
|
487
|
+
```ruby
|
|
488
|
+
begin
|
|
489
|
+
# Upload images for a product
|
|
490
|
+
data, status_code, headers = api_instance.product_controller_upload_image_with_http_info(id)
|
|
491
|
+
p status_code # => 2xx
|
|
492
|
+
p headers # => { ... }
|
|
493
|
+
p data # => nil
|
|
494
|
+
rescue Devdraft::ApiError => e
|
|
495
|
+
puts "Error when calling ProductsApi->product_controller_upload_image_with_http_info: #{e}"
|
|
381
496
|
end
|
|
382
497
|
```
|
|
383
498
|
|
|
384
499
|
### Parameters
|
|
385
500
|
|
|
386
|
-
Name | Type | Description
|
|
387
|
-
|
|
388
|
-
**id** | **String
|
|
501
|
+
| Name | Type | Description | Notes |
|
|
502
|
+
| ---- | ---- | ----------- | ----- |
|
|
503
|
+
| **id** | **String** | Product ID | |
|
|
389
504
|
|
|
390
505
|
### Return type
|
|
391
506
|
|
|
@@ -393,12 +508,10 @@ nil (empty response body)
|
|
|
393
508
|
|
|
394
509
|
### Authorization
|
|
395
510
|
|
|
396
|
-
[x-client-
|
|
511
|
+
[x-client-secret](../README.md#x-client-secret), [x-client-key](../README.md#x-client-key)
|
|
397
512
|
|
|
398
513
|
### HTTP request headers
|
|
399
514
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
515
|
+
- **Content-Type**: Not defined
|
|
516
|
+
- **Accept**: Not defined
|
|
404
517
|
|