(inventory)
- create_commerce_inventory - Create an inventory
- get_commerce_inventory - Retrieve an inventory
- list_commerce_inventories - List all inventories
- patch_commerce_inventory - Update an inventory
- remove_commerce_inventory - Remove an inventory
- update_commerce_inventory - Update an inventory
Create an inventory
require 'unified_ruby_sdk'
s = ::UnifiedRubySDK::UnifiedTo.new
s.config_security(
::UnifiedRubySDK::Shared::Security.new(
jwt: "<YOUR_API_KEY_HERE>",
)
)
res = s.inventory.create_commerce_inventory(connection_id="<id>", commerce_inventory=::UnifiedRubySDK::Shared::CommerceInventory.new(
available: 5165.08,
), fields_=[
"<value>",
])
if ! res.commerce_inventory.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
connection_id |
::String | ✔️ | ID of the connection |
commerce_inventory |
T.nilable(::UnifiedRubySDK::Shared::CommerceInventory) | ➖ | N/A |
fields_ |
T::Array<::String> | ➖ | Comma-delimited fields to return |
T.nilable(::UnifiedRubySDK::Operations::CreateCommerceInventoryResponse)
Retrieve an inventory
require 'unified_ruby_sdk'
s = ::UnifiedRubySDK::UnifiedTo.new
s.config_security(
::UnifiedRubySDK::Shared::Security.new(
jwt: "<YOUR_API_KEY_HERE>",
)
)
res = s.inventory.get_commerce_inventory(connection_id="<id>", id="<id>", fields_=[
"<value>",
])
if ! res.commerce_inventory.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
connection_id |
::String | ✔️ | ID of the connection |
id |
::String | ✔️ | ID of the Inventory |
fields_ |
T::Array<::String> | ➖ | Comma-delimited fields to return |
T.nilable(::UnifiedRubySDK::Operations::GetCommerceInventoryResponse)
List all inventories
require 'unified_ruby_sdk'
s = ::UnifiedRubySDK::UnifiedTo.new
s.config_security(
::UnifiedRubySDK::Shared::Security.new(
jwt: "<YOUR_API_KEY_HERE>",
)
)
req = ::UnifiedRubySDK::Operations::ListCommerceInventoriesRequest.new(
connection_id: "<id>",
)
res = s.inventory.list_commerce_inventories(req)
if ! res.commerce_inventories.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::UnifiedRubySDK::Operations::ListCommerceInventoriesRequest | ✔️ | The request object to use for the request. |
T.nilable(::UnifiedRubySDK::Operations::ListCommerceInventoriesResponse)
Update an inventory
require 'unified_ruby_sdk'
s = ::UnifiedRubySDK::UnifiedTo.new
s.config_security(
::UnifiedRubySDK::Shared::Security.new(
jwt: "<YOUR_API_KEY_HERE>",
)
)
res = s.inventory.patch_commerce_inventory(connection_id="<id>", id="<id>", commerce_inventory=::UnifiedRubySDK::Shared::CommerceInventory.new(
available: 615.23,
), fields_=[
"<value>",
])
if ! res.commerce_inventory.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
connection_id |
::String | ✔️ | ID of the connection |
id |
::String | ✔️ | ID of the Inventory |
commerce_inventory |
T.nilable(::UnifiedRubySDK::Shared::CommerceInventory) | ➖ | N/A |
fields_ |
T::Array<::String> | ➖ | Comma-delimited fields to return |
T.nilable(::UnifiedRubySDK::Operations::PatchCommerceInventoryResponse)
Remove an inventory
require 'unified_ruby_sdk'
s = ::UnifiedRubySDK::UnifiedTo.new
s.config_security(
::UnifiedRubySDK::Shared::Security.new(
jwt: "<YOUR_API_KEY_HERE>",
)
)
res = s.inventory.remove_commerce_inventory(connection_id="<id>", id="<id>")
if res.status_code == 200
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
connection_id |
::String | ✔️ | ID of the connection |
id |
::String | ✔️ | ID of the Inventory |
T.nilable(::UnifiedRubySDK::Operations::RemoveCommerceInventoryResponse)
Update an inventory
require 'unified_ruby_sdk'
s = ::UnifiedRubySDK::UnifiedTo.new
s.config_security(
::UnifiedRubySDK::Shared::Security.new(
jwt: "<YOUR_API_KEY_HERE>",
)
)
res = s.inventory.update_commerce_inventory(connection_id="<id>", id="<id>", commerce_inventory=::UnifiedRubySDK::Shared::CommerceInventory.new(
available: 9360.02,
), fields_=[
"<value>",
])
if ! res.commerce_inventory.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
connection_id |
::String | ✔️ | ID of the connection |
id |
::String | ✔️ | ID of the Inventory |
commerce_inventory |
T.nilable(::UnifiedRubySDK::Shared::CommerceInventory) | ➖ | N/A |
fields_ |
T::Array<::String> | ➖ | Comma-delimited fields to return |
T.nilable(::UnifiedRubySDK::Operations::UpdateCommerceInventoryResponse)