Skip to content

Product_Find

Jacob McConnell edited this page Jun 10, 2014 · 2 revisions

You must specify your API username and password using the Twocheckout::API.credentials method before calling a method in this class.

##Method

###find

Use to retrieve a product.

####Arguments

  • hash Parameters
  • Hash containing list_products parameters or just a product_id. Parameters -> API List Products

####Returns

Returns a Product object.

####Example Usage:

Twocheckout::API.credentials = { :username => 'APIuser1817037', :password => 'APIpass1817037' }

product = Twocheckout::Product.find({:product_id => 4839045783})

####Example Response:

#{
    "approved_url"=>nil,
    "assigned_product_id"=>"450",
    "categories"=>[
        
    ],
    "commission"=>0,
    "commission_amount"=>nil,
    "commission_type"=>nil,
    "description"=>nil,
    "duration"=>nil,
    "handling"=>nil,
    "images"=>[
        
    ],
    "long_description"=>nil,
    "name"=>"test product",
    "options"=>[
        
    ],
    "pending_url"=>nil,
    "price"=>"1.00",
    "product_id"=>"4839045783",
    "recurrence"=>nil,
    "recurrence_p"=>nil,
    "recurring"=>"0",
    "startup_fee"=>nil,
    "tangible"=>"0",
    "vendor_id"=>"1817037",
    "vendor_product_id"=>"",
    "weight"=>nil
}
Clone this wiki locally