Language

2Checkout Documentation

Create

The Twocheckout_Product class provides methods to create, retrieve, update and delete products and will return an Array or JSON response depending on your format specification.

Method

create

Use to create a product.

Arguments

  • Array containing create_product parameters in key => value pairs. Parameters -> API Create Product

Returns

Returns an Array or JSON depending on your format specification.

Example Usage:

Twocheckout::username('APIuser1817037');
Twocheckout::password('APIpass1817037');

$args = array(
    'name' => 'Example Product',
    'price' => 1.00,
    'description' => 'This is an example description'
);

$result = Twocheckout_Product::create($args);

Example Response:

Array
(
    [assigned_product_id] => 445
    [product_id] => 4838125968
    [response_code] => OK
    [response_message] => Product successfully created
)