Language

2Checkout Documentation

Update

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

Method

update

Use to update and existing coupon.

Arguments

  • hash Parameters

Returns

Returns updated Coupon object.

Example Usage:

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

coupon = Twocheckout::Coupon.find(:coupon_code => '7EBHKS2')
coupon = coupon.update(:date_expire => '2020-01-01')

Example Response:

#{
    "coupon_code"=>"7EBHKS2",
    "date_expire"=>"2020-01-01",
    "minimum_purchase"=>"1.00",
    "percentage_off"=>nil,
    "product"=>[
        {
            "product_id"=>nil,
            "product_url"=>"https://www.2checkout.com/api/products/detail_product?product_id="
        }
    ],
    "type"=>"shipping",
    "value_off"=>nil
}