UltracartClient::ItemApi
All URIs are relative to https://secure.ultracart.com/rest/v2
Method | HTTP request | Description |
---|---|---|
delete_item | DELETE /item/items/merchant_item_oid | Delete an item |
get_item | GET /item/items/merchant_item_oid | Retrieve an item |
get_item_by_merchant_item_id | GET /item/items/merchant_item_id/merchant_item_id | Retrieve an item by item id |
get_items | GET /item/items | Retrieve items |
get_pricing_tiers | GET /item/pricing_tiers | Retrieve pricing tiers |
insert_item | POST /item/items | Create an item |
update_item | PUT /item/items/merchant_item_oid | Update an item |
update_items | PUT /item/items/batch | Update multiple items |
upload_temporary_multimedia | POST /item/temp_multimedia | Upload an image to the temporary multimedia. |
delete_item
delete_item(merchant_item_oid)
Delete an item
Delete an item on the UltraCart account.
Example
# load the gem
require 'ultracart_api'
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
api_instance = UltracartClient::ItemApi.new_using_api_key(simple_key, false, false)
merchant_item_oid = 56 # Integer | The item oid to delete.
begin
#Delete an item
api_instance.delete_item(merchant_item_oid)
rescue UltracartClient::ApiError => e
puts "Exception when calling ItemApi->delete_item: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
merchant_item_oid | Integer | The item oid to delete. |
Return type
nil (empty response body)
Authorization
ultraCartOauth, ultraCartSimpleApiKey
HTTP request headers
- Content-Type: application/json
- Accept: application/json
get_item
ItemResponse get_item(merchant_item_oid, opts)
Retrieve an item
Retrieves a single item using the specified item oid.
Example
# load the gem
require 'ultracart_api'
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
api_instance = UltracartClient::ItemApi.new_using_api_key(simple_key, false, false)
merchant_item_oid = 56 # Integer | The item oid to retrieve.
opts = {
_expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
_placeholders: true # BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
}
begin
#Retrieve an item
result = api_instance.get_item(merchant_item_oid, opts)
p result
rescue UltracartClient::ApiError => e
puts "Exception when calling ItemApi->get_item: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
merchant_item_oid | Integer | The item oid to retrieve. | |
_expand | String | The object expansion to perform on the result. See documentation for examples | [optional] |
_placeholders | BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
Return type
Authorization
ultraCartOauth, ultraCartSimpleApiKey
HTTP request headers
- Content-Type: application/json
- Accept: application/json
get_item_by_merchant_item_id
ItemResponse get_item_by_merchant_item_id(merchant_item_id, opts)
Retrieve an item by item id
Retrieves a single item using the specified item id.
Example
# load the gem
require 'ultracart_api'
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
api_instance = UltracartClient::ItemApi.new_using_api_key(simple_key, false, false)
merchant_item_id = 'merchant_item_id_example' # String | The item id to retrieve.
opts = {
_expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
_placeholders: true # BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
}
begin
#Retrieve an item by item id
result = api_instance.get_item_by_merchant_item_id(merchant_item_id, opts)
p result
rescue UltracartClient::ApiError => e
puts "Exception when calling ItemApi->get_item_by_merchant_item_id: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
merchant_item_id | String | The item id to retrieve. | |
_expand | String | The object expansion to perform on the result. See documentation for examples | [optional] |
_placeholders | BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
Return type
Authorization
ultraCartOauth, ultraCartSimpleApiKey
HTTP request headers
- Content-Type: application/json
- Accept: application/json
get_items
ItemsResponse get_items(opts)
Retrieve items
Retrieves a group of items from the account. If no parameters are specified, all items will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.
Example
# load the gem
require 'ultracart_api'
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
api_instance = UltracartClient::ItemApi.new_using_api_key(simple_key, false, false)
opts = {
parent_category_id: 56, # Integer | The parent category object id to retrieve items for. Unspecified means all items on the account. 0 = root
parent_category_path: 'parent_category_path_example', # String | The parent category path to retrieve items for. Unspecified means all items on the account. / = root
_limit: 100, # Integer | The maximum number of records to return on this one API call. (Default 100, Max 2000)
_offset: 0, # Integer | Pagination of the record set. Offset is a zero based index.
_since: '_since_example', # String | Fetch items that have been created/modified since this date/time.
_sort: '_sort_example', # String | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
_expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
_placeholders: true # BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
}
begin
#Retrieve items
result = api_instance.get_items(opts)
p result
rescue UltracartClient::ApiError => e
puts "Exception when calling ItemApi->get_items: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
parent_category_id | Integer | The parent category object id to retrieve items for. Unspecified means all items on the account. 0 = root | [optional] |
parent_category_path | String | The parent category path to retrieve items for. Unspecified means all items on the account. / = root | [optional] |
_limit | Integer | The maximum number of records to return on this one API call. (Default 100, Max 2000) | [optional] [default to 100] |
_offset | Integer | Pagination of the record set. Offset is a zero based index. | [optional] [default to 0] |
_since | String | Fetch items that have been created/modified since this date/time. | [optional] |
_sort | String | The sort order of the items. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. | [optional] |
_expand | String | The object expansion to perform on the result. See documentation for examples | [optional] |
_placeholders | BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
Return type
Authorization
ultraCartOauth, ultraCartSimpleApiKey
HTTP request headers
- Content-Type: application/json
- Accept: application/json
get_pricing_tiers
PricingTiersResponse get_pricing_tiers(opts)
Retrieve pricing tiers
Retrieves the pricing tiers
Example
# load the gem
require 'ultracart_api'
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
api_instance = UltracartClient::ItemApi.new_using_api_key(simple_key, false, false)
opts = {
_expand: '_expand_example' # String | The object expansion to perform on the result. See documentation for examples
}
begin
#Retrieve pricing tiers
result = api_instance.get_pricing_tiers(opts)
p result
rescue UltracartClient::ApiError => e
puts "Exception when calling ItemApi->get_pricing_tiers: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
_expand | String | The object expansion to perform on the result. See documentation for examples | [optional] |
Return type
Authorization
ultraCartOauth, ultraCartSimpleApiKey
HTTP request headers
- Content-Type: application/json
- Accept: application/json
insert_item
ItemResponse insert_item(item, opts)
Create an item
Create a new item on the UltraCart account.
Example
# load the gem
require 'ultracart_api'
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
api_instance = UltracartClient::ItemApi.new_using_api_key(simple_key, false, false)
item = UltracartClient::Item.new # Item | Item to create
opts = {
_expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
_placeholders: true # BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
}
begin
#Create an item
result = api_instance.insert_item(item, opts)
p result
rescue UltracartClient::ApiError => e
puts "Exception when calling ItemApi->insert_item: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
item | Item | Item to create | |
_expand | String | The object expansion to perform on the result. See documentation for examples | [optional] |
_placeholders | BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
Return type
Authorization
ultraCartOauth, ultraCartSimpleApiKey
HTTP request headers
- Content-Type: application/json; charset=UTF-8
- Accept: application/json
update_item
ItemResponse update_item(item, merchant_item_oid, opts)
Update an item
Update a new item on the UltraCart account.
Example
# load the gem
require 'ultracart_api'
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
api_instance = UltracartClient::ItemApi.new_using_api_key(simple_key, false, false)
item = UltracartClient::Item.new # Item | Item to update
merchant_item_oid = 56 # Integer | The item oid to update.
opts = {
_expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
_placeholders: true # BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
}
begin
#Update an item
result = api_instance.update_item(item, merchant_item_oid, opts)
p result
rescue UltracartClient::ApiError => e
puts "Exception when calling ItemApi->update_item: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
item | Item | Item to update | |
merchant_item_oid | Integer | The item oid to update. | |
_expand | String | The object expansion to perform on the result. See documentation for examples | [optional] |
_placeholders | BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
Return type
Authorization
ultraCartOauth, ultraCartSimpleApiKey
HTTP request headers
- Content-Type: application/json; charset=UTF-8
- Accept: application/json
update_items
ItemsResponse update_items(items_request, opts)
Update multiple items
Update multiple item on the UltraCart account.
Example
# load the gem
require 'ultracart_api'
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
api_instance = UltracartClient::ItemApi.new_using_api_key(simple_key, false, false)
items_request = UltracartClient::ItemsRequest.new # ItemsRequest | Items to update (synchronous maximum 20 / asynchronous maximum 100)
opts = {
_expand: '_expand_example', # String | The object expansion to perform on the result. See documentation for examples
_placeholders: true, # BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API.
_async: true # BOOLEAN | True if the operation should be run async. No result returned
}
begin
#Update multiple items
result = api_instance.update_items(items_request, opts)
p result
rescue UltracartClient::ApiError => e
puts "Exception when calling ItemApi->update_items: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
items_request | ItemsRequest | Items to update (synchronous maximum 20 / asynchronous maximum 100) | |
_expand | String | The object expansion to perform on the result. See documentation for examples | [optional] |
_placeholders | BOOLEAN | Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. | [optional] |
_async | BOOLEAN | True if the operation should be run async. No result returned | [optional] |
Return type
Authorization
ultraCartOauth, ultraCartSimpleApiKey
HTTP request headers
- Content-Type: application/json; charset=UTF-8
- Accept: application/json
upload_temporary_multimedia
TempMultimediaResponse upload_temporary_multimedia(file)
Upload an image to the temporary multimedia.
Uploads an image and returns back meta information about the image as well as the identifier needed for the item update.
Example
# load the gem
require 'ultracart_api'
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
api_instance = UltracartClient::ItemApi.new_using_api_key(simple_key, false, false)
file = File.new('/path/to/file.txt') # File | File to upload
begin
#Upload an image to the temporary multimedia.
result = api_instance.upload_temporary_multimedia(file)
p result
rescue UltracartClient::ApiError => e
puts "Exception when calling ItemApi->upload_temporary_multimedia: #{e}"
end
Parameters
Name | Type | Description | Notes |
---|---|---|---|
file | File | File to upload |
Return type
Authorization
ultraCartOauth, ultraCartSimpleApiKey
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json