Language

2Checkout Documentation

Delete Product

The delete_product call is used to delete a product.

URL: https://www.2checkout.com/api/products/delete_product

HTTP Method: POST


Input Parameters

Parameter Description
product_id 2CO system product ID to delete. Required.

Data Returned

Parameter Description
response_code Tells the user whether or not the operation was successful.
response_message Tells the user why the operation was or was not successful.

Example API Call

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

$args = array(
    'product_id' => 4838125968
);

$result = Twocheckout_Product::delete($args);
Twocheckout::API.credentials = { :username => 'APIuser1817037', :password => 'APIpass1817037' }

product = Twocheckout::Product.find({:product_id => 4839045783})
response = product.delete!
args = {
    product_id: 4691409938
};

tco.products.delete(args, function (error, data) {
    if (error) {
        console.log(error);
    } else {
        console.log(data.response_code);
    }
});
twocheckout.Api.credentials({'username':'APIuser1817037', 'password':'APIpass1817037'})

params = {
    'product_id': 4774467881
    }

product = twocheckout.Product.find(params)

result = product.delete();
var ServiceObject = new ProductService();
var ArgsObject = new ProductDeleteServiceOptions();
ArgsObject.product_id = product_id;

var result = ServiceObject.Delete(ArgsObject);
Product product = TwocheckoutProduct.retrieve(product_id);
TwocheckoutResponse result = product.delete();
curl -X POST https://www.2checkout.com/api/products/delete_product \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'product_id=4136649378'

Example Successful Response

    {
       "response_code" : "OK",
       "response_message" : "Product successfully deleted."
    }

 


Common Error Codes

Code Description
PARAMETER_MISSING Required parameter missing:
PARAMETER_INVALID Invalid value for parameter:
RECORD_NOT_FOUND Unable to find record.
FORBIDDEN Access denied to product.