order_cloud

Introduction

OrderCloud gem is an SDK for OrderCloud's API written in Ruby. All of the methods for the most part are a 1:1 reflection of the API. This guide will cover how to install and get started with OrderCloud Ruby gem. OrderCloud - the Ruby gem for the OrderCloud

Acknowledgment

This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0
  • Package version: 0.0.4
  • Build date: 2016-09-27T14:37:05.237-05:00
  • Build package: class io.swagger.codegen.languages.RubyClientCodegen

For more information, please visit http://public.four51.com/

Requirements

  • Ruby >= 2.3.0

Installation

Add this line to your Gemfile:

gem 'order_cloud', '~> 0.0.4'

Or run this in your terminal:

gem install order_cloud

Configuration

You will need to provide the ClientID which identifies the Organization or Buyer Company you will be interacting with. The ClientID can be found in the application tab of your Dashboard. Check out this guide for more information. Once you have the ClientID you can configure it with the following function.

# Load the gem
require 'order_cloud'

# Setup authorization
OrderCloud.configure do |config|
  config.client_id = 'MY_CLIENT_ID'
  config.scopes= ['MY_SCOPE']
end

Authentication

OrderCloud::ApiAuth::('username', 'password')

Impersonation

user_instance = OrderCloud::UserApi.new
impersonation_token = user_instance.get_access_token(buyer_id, user_id, { :claims => ['YOUR_CLAIM'] })

OrderCloud::ApiAuth::start_impersonate(impersonation_token)
puts 'Impersonation status: #{ OrderCloud::Configuration.default.impersonating?}'

OrderCloud::ApiAuth::stop_impersonate
puts 'Impersonation status: #{ OrderCloud::Configuration.default.impersonating?}'

Example

api_instance = OrderCloud::ProductApi.new

begin
  result = api_instance.list
  p result
rescue OrderCloud::ApiError => e
  puts "Exception when calling ProductApi->list: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.ordercloud.io/v1

Class Method HTTP request Description
OrderCloud::AddressApi create POST /buyers/buyerID/addresses
OrderCloud::AddressApi delete DELETE /buyers/buyerID/addresses/addressID
OrderCloud::AddressApi delete_assignment DELETE /buyers/buyerID/addresses/addressID/assignments
OrderCloud::AddressApi get GET /buyers/buyerID/addresses/addressID
OrderCloud::AddressApi list GET /buyers/buyerID/addresses
OrderCloud::AddressApi list_assignments GET /buyers/buyerID/addresses/assignments
OrderCloud::AddressApi patch PATCH /buyers/buyerID/addresses/addressID
OrderCloud::AddressApi save_assignment POST /buyers/buyerID/addresses/assignments
OrderCloud::AddressApi update PUT /buyers/buyerID/addresses/addressID
OrderCloud::AdminAddressApi create POST /addresses
OrderCloud::AdminAddressApi delete DELETE /addresses/addressID
OrderCloud::AdminAddressApi get GET /addresses/addressID
OrderCloud::AdminAddressApi list GET /addresses
OrderCloud::AdminAddressApi patch PATCH /addresses/addressID
OrderCloud::AdminAddressApi update PUT /addresses/addressID
OrderCloud::AdminUserApi create POST /adminusers
OrderCloud::AdminUserApi delete DELETE /adminusers/userID
OrderCloud::AdminUserApi get GET /adminusers/userID
OrderCloud::AdminUserApi list GET /adminusers
OrderCloud::AdminUserApi patch PATCH /adminusers/userID
OrderCloud::AdminUserApi update PUT /adminusers/userID
OrderCloud::ApprovalRuleApi create POST /buyers/buyerID/approvalrules
OrderCloud::ApprovalRuleApi delete DELETE /buyers/buyerID/approvalrules/approvalRuleID
OrderCloud::ApprovalRuleApi get GET /buyers/buyerID/approvalrules/approvalRuleID
OrderCloud::ApprovalRuleApi list GET /buyers/buyerID/approvalrules
OrderCloud::ApprovalRuleApi patch PATCH /buyers/buyerID/approvalrules/approvalRuleID
OrderCloud::ApprovalRuleApi update PUT /buyers/buyerID/approvalrules/approvalRuleID
OrderCloud::BuyerApi create POST /buyers
OrderCloud::BuyerApi delete DELETE /buyers/buyerID
OrderCloud::BuyerApi get GET /buyers/buyerID
OrderCloud::BuyerApi list GET /buyers
OrderCloud::BuyerApi patch PATCH /buyers/buyerID
OrderCloud::BuyerApi update PUT /buyers/buyerID
OrderCloud::CategoryApi create POST /buyers/buyerID/categories
OrderCloud::CategoryApi delete DELETE /buyers/buyerID/categories/categoryID
OrderCloud::CategoryApi delete_assignment DELETE /buyers/buyerID/categories/categoryID/assignments
OrderCloud::CategoryApi delete_product_assignment DELETE /buyers/buyerID/categories/categoryID/productassignments/productID
OrderCloud::CategoryApi get GET /buyers/buyerID/categories/categoryID
OrderCloud::CategoryApi list GET /buyers/buyerID/categories
OrderCloud::CategoryApi list_assignments GET /buyers/buyerID/categories/assignments
OrderCloud::CategoryApi list_product_assignments GET /buyers/buyerID/categories/productassignments
OrderCloud::CategoryApi patch PATCH /buyers/buyerID/categories/categoryID
OrderCloud::CategoryApi save_assignment POST /buyers/buyerID/categories/assignments
OrderCloud::CategoryApi save_product_assignment POST /buyers/buyerID/categories/productassignments
OrderCloud::CategoryApi update PUT /buyers/buyerID/categories/categoryID
OrderCloud::CostCenterApi create POST /buyers/buyerID/costcenters
OrderCloud::CostCenterApi delete DELETE /buyers/buyerID/costcenters/costCenterID
OrderCloud::CostCenterApi delete_assignment DELETE /buyers/buyerID/costcenters/costCenterID/assignments
OrderCloud::CostCenterApi get GET /buyers/buyerID/costcenters/costCenterID
OrderCloud::CostCenterApi list GET /buyers/buyerID/costcenters
OrderCloud::CostCenterApi list_assignments GET /buyers/buyerID/costcenters/assignments
OrderCloud::CostCenterApi patch PATCH /buyers/buyerID/costcenters/costCenterID
OrderCloud::CostCenterApi save_assignment POST /buyers/buyerID/costcenters/assignments
OrderCloud::CostCenterApi update PUT /buyers/buyerID/costcenters/costCenterID
OrderCloud::CreditCardApi create POST /buyers/buyerID/creditcards
OrderCloud::CreditCardApi delete DELETE /buyers/buyerID/creditcards/creditCardID
OrderCloud::CreditCardApi delete_assignment DELETE /buyers/buyerID/creditcards/creditCardID/assignments
OrderCloud::CreditCardApi get GET /buyers/buyerID/creditcards/creditCardID
OrderCloud::CreditCardApi list GET /buyers/buyerID/creditcards
OrderCloud::CreditCardApi list_assignments GET /buyers/buyerID/creditcards/assignments
OrderCloud::CreditCardApi patch PATCH /buyers/buyerID/creditcards/creditCardID
OrderCloud::CreditCardApi save_assignment POST /buyers/buyerID/creditcards/assignments
OrderCloud::CreditCardApi update PUT /buyers/buyerID/creditcards/creditCardID
OrderCloud::EmailTemplateApi get GET /buyers/buyerID/emailtemplates/emailTemplateType
OrderCloud::EmailTemplateApi patch PATCH /buyers/buyerID/emailtemplates/emailTemplateType
OrderCloud::EmailTemplateApi reset_to_default DELETE /buyers/buyerID/emailtemplates/emailTemplateType
OrderCloud::EmailTemplateApi update PUT /buyers/buyerID/emailtemplates/emailTemplateType
OrderCloud::FileApi get GET /files/fileID
OrderCloud::FileApi list GET /files
OrderCloud::FileApi post_file_data POST /files
OrderCloud::LineItemApi create POST /buyers/buyerID/orders/orderID/lineitems
OrderCloud::LineItemApi delete DELETE /buyers/buyerID/orders/orderID/lineitems/lineItemID
OrderCloud::LineItemApi get GET /buyers/buyerID/orders/orderID/lineitems/lineItemID
OrderCloud::LineItemApi list GET /buyers/buyerID/orders/orderID/lineitems
OrderCloud::LineItemApi patch PATCH /buyers/buyerID/orders/orderID/lineitems/lineItemID
OrderCloud::LineItemApi patch_shipping_address PATCH /buyers/buyerID/orders/orderID/lineitems/lineItemID/shipto
OrderCloud::LineItemApi set_shipping_address PUT /buyers/buyerID/orders/orderID/lineitems/lineItemID/shipto
OrderCloud::LineItemApi update PUT /buyers/buyerID/orders/orderID/lineitems/lineItemID
OrderCloud::MeApi create_address POST /me/addresses
OrderCloud::MeApi create_credit_card POST /me/creditcards
OrderCloud::MeApi delete_address DELETE /me/addresses/addressID
OrderCloud::MeApi delete_credit_card DELETE /me/creditcards/creditcardID
OrderCloud::MeApi get GET /me
OrderCloud::MeApi get_address GET /me/addresses/addressID
OrderCloud::MeApi get_credit_card GET /me/creditcards/creditcardID
OrderCloud::MeApi get_order GET /me/orders/orderID
OrderCloud::MeApi get_product GET /me/products/productID
OrderCloud::MeApi get_promotion GET /me/promotions/promotionID
OrderCloud::MeApi get_spec GET /me/products/productID/specs/specID
OrderCloud::MeApi list_addresses GET /me/addresses
OrderCloud::MeApi list_categories GET /me/categories
OrderCloud::MeApi list_cost_centers GET /me/costcenters
OrderCloud::MeApi list_credit_cards GET /me/creditcards
OrderCloud::MeApi list_incoming_orders GET /me/orders/incoming
OrderCloud::MeApi list_outgoing_orders GET /me/orders/outgoing
OrderCloud::MeApi list_products GET /me/products
OrderCloud::MeApi list_promotions GET /me/promotions
OrderCloud::MeApi list_specs GET /me/products/productID/specs
OrderCloud::MeApi list_user_groups GET /me/usergroups
OrderCloud::MeApi patch PATCH /me
OrderCloud::MeApi patch_address PATCH /me/addresses/addressID
OrderCloud::MeApi patch_credit_card PATCH /me/creditcards/creditcardID
OrderCloud::MeApi update PUT /me
OrderCloud::MeApi update_address PUT /me/addresses/addressID
OrderCloud::MeApi update_credit_card PUT /me/creditcards/creditcardID
OrderCloud::OrderApi add_promotion POST /buyers/buyerID/orders/orderID/promotions/promoCode
OrderCloud::OrderApi approve POST /buyers/buyerID/orders/orderID/approve
OrderCloud::OrderApi cancel POST /buyers/buyerID/orders/orderID/cancel
OrderCloud::OrderApi create POST /buyers/buyerID/orders
OrderCloud::OrderApi decline POST /buyers/buyerID/orders/orderID/decline
OrderCloud::OrderApi delete DELETE /buyers/buyerID/orders/orderID
OrderCloud::OrderApi get GET /buyers/buyerID/orders/orderID
OrderCloud::OrderApi list_approvals GET /buyers/buyerID/orders/orderID/approvals
OrderCloud::OrderApi list_eligible_approvers GET /buyers/buyerID/orders/orderID/eligibleapprovers
OrderCloud::OrderApi list_incoming GET /orders/incoming
OrderCloud::OrderApi list_outgoing GET /orders/outgoing
OrderCloud::OrderApi list_promotions GET /buyers/buyerID/orders/orderID/promotions
OrderCloud::OrderApi patch PATCH /buyers/buyerID/orders/orderID
OrderCloud::OrderApi patch_billing_address PATCH /buyers/buyerID/orders/orderID/billto
OrderCloud::OrderApi patch_shipping_address PATCH /buyers/buyerID/orders/orderID/shipto
OrderCloud::OrderApi remove_promotion DELETE /buyers/buyerID/orders/orderID/promotions/promoCode
OrderCloud::OrderApi set_billing_address PUT /buyers/buyerID/orders/orderID/billto
OrderCloud::OrderApi set_shipping_address PUT /buyers/buyerID/orders/orderID/shipto
OrderCloud::OrderApi ship POST /buyers/buyerID/orders/orderID/ship
OrderCloud::OrderApi submit POST /buyers/buyerID/orders/orderID/submit
OrderCloud::OrderApi transfer_temp_user_order PUT /buyers/buyerID/orders
OrderCloud::OrderApi update PUT /buyers/buyerID/orders/orderID
OrderCloud::PasswordResetApi reset_password PUT /password/reset/verificationCode
OrderCloud::PasswordResetApi send_verification_code POST /password/reset
OrderCloud::PaymentApi create POST /buyers/buyerID/orders/orderID/payments
OrderCloud::PaymentApi create_transaction POST /buyers/buyerID/orders/orderID/payments/paymentID/transactions
OrderCloud::PaymentApi delete DELETE /buyers/buyerID/orders/orderID/payments/paymentID
OrderCloud::PaymentApi delete_transaction DELETE /buyers/buyerID/orders/orderID/payments/paymentID/transactions/transactionID
OrderCloud::PaymentApi get GET /buyers/buyerID/orders/orderID/payments/paymentID
OrderCloud::PaymentApi list GET /buyers/buyerID/orders/orderID/payments
OrderCloud::PaymentApi patch PATCH /buyers/buyerID/orders/orderID/payments/paymentID
OrderCloud::PaymentApi patch_transaction PATCH /buyers/buyerID/orders/orderID/payments/paymentID/transactions/transactionID
OrderCloud::PaymentApi update PUT /buyers/buyerID/orders/orderID/payments/paymentID
OrderCloud::PaymentApi update_transaction PUT /buyers/buyerID/orders/orderID/payments/paymentID/transactions/transactionID
OrderCloud::PriceScheduleApi create POST /priceschedules
OrderCloud::PriceScheduleApi delete DELETE /priceschedules/priceScheduleID
OrderCloud::PriceScheduleApi delete_price_break DELETE /priceschedules/priceScheduleID/PriceBreaks
OrderCloud::PriceScheduleApi get GET /priceschedules/priceScheduleID
OrderCloud::PriceScheduleApi list GET /priceschedules
OrderCloud::PriceScheduleApi patch PATCH /priceschedules/priceScheduleID
OrderCloud::PriceScheduleApi save_price_break POST /priceschedules/priceScheduleID/PriceBreaks
OrderCloud::PriceScheduleApi update PUT /priceschedules/priceScheduleID
OrderCloud::ProductApi create POST /products
OrderCloud::ProductApi delete DELETE /products/productID
OrderCloud::ProductApi delete_assignment DELETE /products/productID/assignments/buyerID
OrderCloud::ProductApi generate_variants POST /products/productID/variants/generate
OrderCloud::ProductApi get GET /products/productID
OrderCloud::ProductApi get_inventory GET /products/productID/inventory
OrderCloud::ProductApi get_variant GET /products/productID/variants/variantID
OrderCloud::ProductApi get_variant_inventory GET /products/productID/variants/inventory/variantID
OrderCloud::ProductApi list GET /products
OrderCloud::ProductApi list_assignments GET /products/assignments
OrderCloud::ProductApi list_inventory GET /products/inventory
OrderCloud::ProductApi list_variant_inventory GET /products/productID/variants/inventory
OrderCloud::ProductApi list_variants GET /products/productID/variants
OrderCloud::ProductApi patch PATCH /products/productID
OrderCloud::ProductApi patch_variant PATCH /products/productID/variants/variantID
OrderCloud::ProductApi save_assignment POST /products/assignments
OrderCloud::ProductApi update PUT /products/productID
OrderCloud::ProductApi update_inventory PUT /products/productID/inventory/inventory
OrderCloud::ProductApi update_variant PUT /products/productID/variants/variantID
OrderCloud::ProductApi update_variant_inventory PUT /products/productID/variants/inventory/variantID/inventory
OrderCloud::PromotionApi create POST /promotions
OrderCloud::PromotionApi delete DELETE /promotions/promotionID
OrderCloud::PromotionApi delete_assignment DELETE /promotions/promotionID/assignments
OrderCloud::PromotionApi get GET /promotions/promotionID
OrderCloud::PromotionApi list GET /promotions
OrderCloud::PromotionApi list_assignments GET /promotions/assignments
OrderCloud::PromotionApi patch PATCH /promotions/promotionID
OrderCloud::PromotionApi save_assignment POST /promotions/assignments
OrderCloud::PromotionApi update PUT /promotions/promotionID
OrderCloud::SecurityProfileApi delete_assignment DELETE /SecurityProfiles/securityProfileID/assignments
OrderCloud::SecurityProfileApi get GET /SecurityProfiles/securityProfileID
OrderCloud::SecurityProfileApi list GET /SecurityProfiles
OrderCloud::SecurityProfileApi list_assignments GET /SecurityProfiles/assignments
OrderCloud::SecurityProfileApi save_assignment POST /SecurityProfiles/assignments
OrderCloud::ShipmentApi create POST /buyers/buyerID/shipments
OrderCloud::ShipmentApi delete DELETE /buyers/buyerID/shipments/shipmentID
OrderCloud::ShipmentApi delete_item DELETE /buyers/buyerID/shipments/shipmentID/items/orderID/lineItemID
OrderCloud::ShipmentApi get GET /buyers/buyerID/shipments/shipmentID
OrderCloud::ShipmentApi list GET /buyers/buyerID/shipments
OrderCloud::ShipmentApi patch PATCH /buyers/buyerID/shipments/shipmentID
OrderCloud::ShipmentApi save_item POST /buyers/buyerID/shipments/shipmentID/items
OrderCloud::ShipmentApi update PUT /buyers/buyerID/shipments/shipmentID
OrderCloud::SpecApi create POST /specs
OrderCloud::SpecApi create_option POST /specs/specID/options
OrderCloud::SpecApi delete DELETE /specs/specID
OrderCloud::SpecApi delete_option DELETE /specs/specID/options/optionID
OrderCloud::SpecApi delete_product_assignment DELETE /specs/specID/productassignments/productID
OrderCloud::SpecApi get GET /specs/specID
OrderCloud::SpecApi get_option GET /specs/specID/options/optionID
OrderCloud::SpecApi list GET /specs
OrderCloud::SpecApi list_options GET /specs/specID/options
OrderCloud::SpecApi list_product_assignments GET /specs/productassignments
OrderCloud::SpecApi patch PATCH /specs/specID
OrderCloud::SpecApi patch_option PATCH /specs/specID/options/optionID
OrderCloud::SpecApi save_product_assignment POST /specs/productassignments
OrderCloud::SpecApi update PUT /specs/specID
OrderCloud::SpecApi update_option PUT /specs/specID/options/optionID
OrderCloud::SpendingAccountApi create POST /buyers/buyerID/spendingaccounts
OrderCloud::SpendingAccountApi delete DELETE /buyers/buyerID/spendingaccounts/spendingAccountID
OrderCloud::SpendingAccountApi delete_assignment DELETE /buyers/buyerID/spendingaccounts/spendingAccountID/assignments
OrderCloud::SpendingAccountApi get GET /buyers/buyerID/spendingaccounts/spendingAccountID
OrderCloud::SpendingAccountApi list GET /buyers/buyerID/spendingaccounts
OrderCloud::SpendingAccountApi list_assignments GET /buyers/buyerID/spendingaccounts/assignments
OrderCloud::SpendingAccountApi patch PATCH /buyers/buyerID/spendingaccounts/spendingAccountID
OrderCloud::SpendingAccountApi save_assignment POST /buyers/buyerID/spendingaccounts/assignments
OrderCloud::SpendingAccountApi update PUT /buyers/buyerID/spendingaccounts/spendingAccountID
OrderCloud::UserApi create POST /buyers/buyerID/users
OrderCloud::UserApi delete DELETE /buyers/buyerID/users/userID
OrderCloud::UserApi get GET /buyers/buyerID/users/userID
OrderCloud::UserApi get_access_token POST /buyers/buyerID/users/userID/accesstoken
OrderCloud::UserApi list GET /buyers/buyerID/users
OrderCloud::UserApi patch PATCH /buyers/buyerID/users/userID
OrderCloud::UserApi update PUT /buyers/buyerID/users/userID
OrderCloud::UserGroupApi create POST /buyers/buyerID/usergroups
OrderCloud::UserGroupApi delete DELETE /buyers/buyerID/usergroups/userGroupID
OrderCloud::UserGroupApi delete_user_assignment DELETE /buyers/buyerID/usergroups/userGroupID/assignments/userID
OrderCloud::UserGroupApi get GET /buyers/buyerID/usergroups/userGroupID
OrderCloud::UserGroupApi list GET /buyers/buyerID/usergroups
OrderCloud::UserGroupApi list_user_assignments GET /buyers/buyerID/usergroups/assignments
OrderCloud::UserGroupApi patch PATCH /buyers/buyerID/usergroups/userGroupID
OrderCloud::UserGroupApi save_user_assignment POST /buyers/buyerID/usergroups/assignments
OrderCloud::UserGroupApi update PUT /buyers/buyerID/usergroups/userGroupID

Documentation for Models

Documentation for Authorization

oauth2

  • Type: OAuth
  • Flow: password
  • Authorization URL:
  • Scopes:
    • AddressAdmin:
    • AddressReader:
    • ApprovalRuleAdmin:
    • ApprovalRuleReader:
    • BuyerAdmin:
    • BuyerReader:
    • BuyerUserAdmin:
    • BuyerUserReader:
    • CategoryAdmin:
    • CategoryReader:
    • CostCenterAdmin:
    • CostCenterReader:
    • CreditCardAdmin:
    • CreditCardReader:
    • DevCenter:
    • DevCenterImpersonate:
    • DevCenterPasswordReset:
    • EmailTemplateAdmin:
    • EmailTemplateReader:
    • FullAccess:
    • GrantForAnyRole:
    • InventoryAdmin:
    • MeAddressAdmin:
    • MeAdmin:
    • MeCreditCardAdmin:
    • MeXpAdmin:
    • OrderAdmin:
    • OrderReader:
    • OverrideShipping:
    • OverrideTax:
    • OverrideUnitPrice:
    • PermissionAdmin:
    • PriceScheduleAdmin:
    • PriceScheduleReader:
    • ProductAdmin:
    • ProductAssignmentAdmin:
    • ProductReader:
    • PromotionAdmin:
    • PromotionReader:
    • SpendingAccountAdmin:
    • SpendingAccountReader:
    • UnsubmittedOrderReader:
    • UserGroupAdmin:
    • UserGroupReader: