Skip to main content

Detail Product

Overview

The detail_product call is used to retrieve the details for a single product.

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

HTTP Method: GET


Input Parameters

Parameter Description
product_id ID of product to retrieve details for. Required.

Data Returned

 

product

Parameter Description
product_id System Product ID.
name Product Name
vendor_product_id Merchant Assigned Product ID.
description Product Short Description.
long_description Product Long Description.
price Product Price.
tangible Tangible=1, Intangible=0.
weight Product Weight.
handling Product Handling Fee.
recurrence Product Recurrence.
startup_fee Recurring Startup Fee.
duration Product Duration.
assigned_product_id 2CO Assigned Product ID.
pending_url Product Pending URL.
approved_url Product Approved URL.
commission Affiliate commision.
commission_type Affiliate commision type.

 

images

Parameter Description
image_number Image number.
image_id Image ID.

 

options

Parameter Description
option_value_id Product option value.
option_id Product option ID.
option_name Product option name.
vendor_id Merchant ID (2Checkout Account Number) of user.
option_value_surcharge Option value surcharge.
option_value_name Option value name.

 

categories

Parameter Description
category_id Category ID
name Category name.
parent_id Category parent ID.
description Category description.
parent_name Category parent name.

Example API Call

curl -G https://www.2checkout.com/api/products/detail_product \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'product_id=4635212971'

Example Successful Response

 {
       "product" : {
          "approved_url" : null,
          "assigned_product_id" : "2559",
          "categories" : [],
          "commission" : 0,
          "commission_amount" : null,
          "commission_type" : null,
          "description" : "An API created product",
          "duration" : null,
          "handling" : null,
          "images" : [],
          "long_description" : null,
          "name" : "API product",
          "options" : [
             {
                "option_id" : "4023756741",
                "option_name" : "extra benefit",
                "option_values" : [
                   {
                      "option_value_id" : "4023756744",
                      "option_value_name" : "full life coverage",
                      "option_value_surcharge" : "1.00"
                   },
                   {
                      "option_value_id" : "4023756747",
                      "option_value_name" : "half life coverage",
                      "option_value_surcharge" : "0.50"
                   },
                   {
                      "option_value_id" : "4023756750",
                      "option_value_name" : "extra lives coverage",
                      "option_value_surcharge" : "2.00"
                   }
                ]
             },
             {
                "option_id" : "4688355343",
                "option_name" : "decibels",
                "option_values" : [
                   {
                      "option_value_id" : "4688355346",
                      "option_value_name" : "150dB",
                      "option_value_surcharge" : "11.00"
                   },
                   {
                      "option_value_id" : "4688441332",
                      "option_value_name" : "200dB",
                      "option_value_surcharge" : "22.00"
                   },
                   {
                      "option_value_id" : "4688441335",
                      "option_value_name" : "250dB",
                      "option_value_surcharge" : "33.00"
                   }
                ]
             }
          ],
          "pending_url" : null,
          "price" : "10.00",
          "product_id" : "4635212971",
          "recurrence" : null,
          "recurrence_p" : null,
          "recurring" : "0",
          "startup_fee" : null,
          "tangible" : "0",
          "vendor_id" : "606917",
          "vendor_product_id" : "",
          "weight" : null
       },
       "response_code" : "OK",
       "response_message" : "Product detail information retrieved successfully"
    }

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.

List Products

Overview

The list_products call is used to retrieve list of all products in the account.

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

HTTP Method: GET

Input Parameters

 

Parameter Description
assigned_product_id Filter list results on 2CO ID. Optional.
vendor_product_id Filter list results on product ID. Optional.
name Filter list results on product name. Optional.
cur_page The page number to retrieve. First page = 1. Optional.
pagesize Total rows per page. Possible values are 1-100. If pagesize not specified, default of 20 items per page will be assigned internally. Optional.
sort_col The name of the column to sort on. Possibile values are product_id, name, description, option_id, price, vendor_product_id, assigned_product_id, tangible, weight, handling, description, long_description, pending_url, approved_url, startup_fee, recurrence, duration, category_id, commission_amount and commission_type. (case insensitive) Optional.
sort_dir The direction of the sort process. (‘ASC’ or ‘DESC’) (case insensitive) Optional.

Data Returned

 

page_info

Parameter Description
first_page Link to the first product page.
previous_page Link to the previous product page.
next_page Link to the next product page.
last_page Link to the last product page.
first First product ID in page.
last Last product ID in page.
total_entries Total number of products.
current_page Current product page.
pages_in_set Number of pages in set.
entries_per_page Product of product entries in set.

 

product

Parameter Description
product_id System Product ID.
name Product Name
vendor_product_id Merchant Assigned Product ID.
description Product Short Description.
long_description Product Long Description.
price Product Price.
tangible Tangible=1, Intangible=0.
weight Product Weight.
handling Product Handling Fee.
recurrence Product Recurrence.
startup_fee Recurring Startup Fee.
duration Product Duration.
assigned_product_id 2CO Assigned Product ID.
pending_url Product Pending URL.
approved_url Product Approved URL.
commission Affiliate commision.
commission_type Affiliate commision type.

 

images

Parameter Description
image_number Image number.
image_id Image ID.

 

options

Parameter Description
option_value_id Product option value.
option_id Product option ID.
option_name Product option name.
vendor_id Merchant ID (2Checkout Account Number) of user.
option_value_surcharge Option value surcharge.
option_value_name Option value name.

 

categories

Parameter Description
category_id Category ID
name Category name.
parent_id Category parent ID.
description Category description.
parent_name Category parent name.

Example API Call

curl -G https://www.2checkout.com/api/products/list_products \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'sort_col=assigned_product_id' -d 'sort_dir=desc'

Example Successful Response

 {
       "page_info" : {
          "cur_page" : "1",
          "first_entry" : 1,
          "first_page" : 1,
          "first_page_url" : "https://www.2checkout.com/api/products/list_products?cur_page=1",
          "last_entry" : "15",
          "last_page" : 1,
          "last_page_url" : "https://www.2checkout.com/api/products/list_products?cur_page=1",
          "next_page" : null,
          "pagesize" : "20",
          "previous_page" : null,
          "total_entries" : "15"
       },
       "products" : [
          {
             "approved_url" : null,
             "assigned_product_id" : "23",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "Rental for a Double Room in Casino Royale",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : "Really cool.",
             "name" : "Casino Royale - Double Room",
             "options" : [],
             "pending_url" : null,
             "price" : "1.00",
             "product_id" : "4654080950",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "DRT",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "19",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "example short description",
             "duration" : "Forever",
             "handling" : "0.00",
             "images" : [],
             "long_description" : "no",
             "name" : "Example Product",
             "options" : [],
             "pending_url" : null,
             "price" : "10.00",
             "product_id" : "4504052346",
             "recurrence" : "1 Month",
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "123456789",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "15",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : null,
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Classified Ad 1 month",
             "options" : [],
             "pending_url" : "",
             "price" : "29.00",
             "product_id" : "4485343987",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "One Month Ad",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "14",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "12-month subscription",
             "duration" : "Forever",
             "handling" : "0.00",
             "images" : [],
             "long_description" : "12-month subscription to the best magazine ever.",
             "name" : "Annual Subscription",
             "options" : [],
             "pending_url" : "",
             "price" : "29.00",
             "product_id" : "4485343981",
             "recurrence" : "1 Month",
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "AS-12M",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "13",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "Yet another test product.",
             "duration" : "Forever",
             "handling" : "0.00",
             "images" : [],
             "long_description" : "Yet another long description.",
             "name" : "YA-TestProduct",
             "options" : [],
             "pending_url" : "",
             "price" : "1.00",
             "product_id" : "4297596451",
             "recurrence" : "1 Week",
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "YA-TP",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "12",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "A small jar of air",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Jar of Air",
             "options" : [],
             "pending_url" : "",
             "price" : "50.00",
             "product_id" : "4297596160",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "J-A",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "11",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "Authentic painting.",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Buddha Painting (5x5)",
             "options" : [],
             "pending_url" : "",
             "price" : "39.95",
             "product_id" : "4297595302",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "1",
             "vendor_id" : "1311348",
             "vendor_product_id" : "JHB55AAE",
             "weight" : "2.00"
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "10",
             "categories" : [
                {
                   "category_id" : "17",
                   "description" : null,
                   "name" : "Photography",
                   "parent_id" : "1",
                   "parent_name" : "Art & Antiques"
                }
             ],
             "commission" : null,
             "commission_type" : null,
             "description" : "Product with options.",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "OPTION TEST",
             "options" : [
                {
                   "option_id" : "4688550010",
                   "option_name" : "Volume",
                   "option_values" : [
                      {
                         "option_value_id" : "4688550013",
                         "option_value_name" : "Low",
                         "option_value_surcharge" : "1.00"
                      },
                      {
                         "option_value_id" : "4688550016",
                         "option_value_name" : "Medium",
                         "option_value_surcharge" : "2.00"
                      },
                      {
                         "option_value_id" : "4688550019",
                         "option_value_name" : "High",
                         "option_value_surcharge" : "3.00"
                      }
                   ]
                }
             ],
             "pending_url" : null,
             "price" : "100.00",
             "product_id" : "4274737762",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "OP-T",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "9",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : null,
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Hexagonal forged iron",
             "options" : [],
             "pending_url" : null,
             "price" : "0.00",
             "product_id" : "4257794737",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "HEX-002",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "8",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : null,
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Hexagonal aluminum extrusion",
             "options" : [],
             "pending_url" : null,
             "price" : "3490.00",
             "product_id" : "4257793915",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "1",
             "vendor_id" : "1311348",
             "vendor_product_id" : "HEX-001",
             "weight" : "50.00"
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "7",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : null,
             "duration" : null,
             "handling" : "1.00",
             "images" : [],
             "long_description" : "photo frame with laser etched eagle motif.",
             "name" : "Patriotic photo frame",
             "options" : [],
             "pending_url" : null,
             "price" : "14.95",
             "product_id" : "4186286355",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "1",
             "vendor_id" : "1311348",
             "vendor_product_id" : "AFY",
             "weight" : "1.00"
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "6",
             "categories" : [],
             "commission" : null,
             "commission_type" : null,
             "description" : "Lead fishing weights",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : "Exceptional lead fishing weights, not to be eaten under any circumstance.",
             "name" : "Lead weights",
             "options" : [],
             "pending_url" : null,
             "price" : "25.00",
             "product_id" : "4166247708",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "LW-500",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "5",
             "categories" : [
                {
                   "category_id" : "80",
                   "description" : null,
                   "name" : "Education",
                   "parent_id" : null,
                   "parent_name" : null
                }
             ],
             "commission" : null,
             "commission_type" : null,
             "description" : null,
             "duration" : "Forever",
             "handling" : "0.00",
             "images" : [],
             "long_description" : null,
             "name" : "Anonymous Online Magazine",
             "options" : [],
             "pending_url" : null,
             "price" : "24.00",
             "product_id" : "4124411144",
             "recurrence" : "1 Month",
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "OMG-0001",
             "weight" : null
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "4",
             "categories" : [
                {
                   "category_id" : "2",
                   "description" : null,
                   "name" : "Business Solutions & Office Products",
                   "parent_id" : null,
                   "parent_name" : null
                }
             ],
             "commission" : null,
             "commission_type" : null,
             "description" : "A metallic ring",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : "A hand-crafted ring produced from locally sourced material.",
             "name" : "Brass Ring",
             "options" : [],
             "pending_url" : null,
             "price" : "1.00",
             "product_id" : "3987434616",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "1",
             "vendor_id" : "1311348",
             "vendor_product_id" : "BRSRNG",
             "weight" : "0.50"
          },
          {
             "approved_url" : null,
             "assigned_product_id" : "3",
             "categories" : [
                {
                   "category_id" : "2",
                   "description" : null,
                   "name" : "Business Solutions & Office Products",
                   "parent_id" : null,
                   "parent_name" : null
                }
             ],
             "commission" : null,
             "commission_type" : null,
             "description" : "The Short Description",
             "duration" : null,
             "handling" : "0.00",
             "images" : [],
             "long_description" : "The Long Description",
             "name" : "Live Test Product",
             "options" : [],
             "pending_url" : null,
             "price" : "10.00",
             "product_id" : "3970322775",
             "recurrence" : null,
             "startup_fee" : null,
             "tangible" : "0",
             "vendor_id" : "1311348",
             "vendor_product_id" : "LTP-003",
             "weight" : null
          }
       ],
       "response_code" : "OK",
       "response_message" : "Product list successfully retrieved."
    }

Common Error Codes

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

Detail Contact Info

Overview

The detail_contact_info call is used to retrieve your account’s contact information details from the Contact Info page.

URL: https://www.2checkout.com/api/acct/detail_contact_info

HTTP Method: GET

 

Input Parameters

No input parameters required.


Data Returned

Parameter Description
vendor_id Merchant ID (2Checkout Account Number) of user.
mailing_address_id Internal ID assigned to your company’s mailing address.
mailing_address_1 Mailing Address line 1
mailing_address_2 Mailing Address line 2
mailing_city Mailing Address City
mailing_state Mailing Address State
mailing_postal_code Mailing Address Postal Code
mailing_country_code Mailing Address Country Code
physical_address_id Internal Id assigned to your company’s physical address.
physical_address_1 Physical Address line 1
physical_address_2 Physical Address line 2
physical_city Physical Address City
physical_state Physical Address State
physical_postal_code Physical Address Postal Code
physical_country_code Physical Address Country Code
office_phone Office Phone Number
office_phone_ext Business Office Phone Number Extension
office_email Business Office Email Address
customer_service_phone Customer Service Phone Number
customer_service_phone_ext Customer Service Phone Number Extension
customer_service_email Customer Service Email Address

Example API call using cURL

curl -G https://www.2checkout.com/api/acct/detail_contact_info \
    -H 'Accept: application/json' -u 'username:password'

Example Successful Response

 {
       "response_code" : "OK",
       "response_message" : "contact info retrieved",
       "vendor_contact_info" : {
          "2co_account_level_id" : "3",
          "customer_service_email" : "support@fake-company.com",
          "customer_service_phone" : "555-555-5555",
          "customer_service_phone_ext" : "null",
          "mailing_address_1" : "​855 Grandview Avenue",
          "mailing_address_2" : "Suite 11",
          "mailing_address_id" : "2436561523",
          "mailing_city" : "Columbus",
          "mailing_country_code" : "USA",
          "mailing_postal_code" : "43215",
          "mailing_state" : "OH",
          "office_email" : "no-reply@fake-company.com",
          "office_phone" : "555-555-5555",
          "office_phone_ext" : null,
          "physical_address_1" : "​855 Grandview Avenue",
          "physical_address_2" : "Suite 11",
          "physical_address_id" : "2436561526",
          "physical_city" : "Columbus",
          "physical_country_code" : "USA",
          "physical_postal_code" : "43215",
          "physical_state" : "OH",
          "vendor_id" : "123456"
       }
    }

 

Create Comment

Overview

The create_comment call is used to add a comment to a specified sale.

URL: https://www.2checkout.com/api/sales/create_comment

HTTP Method: POST

Input Parameters

Parameter Description
sale_id The order number/sale ID of a sale to look for. Required.
sale_comment String value of comment to be submitted. Required.
cc_vendor Set to 1 to have a copy sent to the merchant. Optional.
cc_customer Set to 1 to have the buyer sent an email copy. Optional.

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

curl -X POST https://www.2checkout.com/api/sales/create_comment -u \ 'username:password' -H 'Accept: application/json' -d 'sale_id=1234567890' \ -d 'sale_comment=Your order will be shipped this week.'

Example Successful Response

{ "response_code" : "OK", "response_message" : "Created comment successfully." }

 

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 sale.

Detail Company Info

Overview

The detail_company_info call is used to retrieve your account’s company information details from the Site Management page.

URL: https://www.2checkout.com/api/acct/detail_company_info

HTTP Method: GET

Input Parameters

No input parameters required.


Data Returned

Parameter Description
vendor_id Merchant ID (2Checkout Account Number) of user.
vendor_name Company Name that is listed in our purchase routine.
site_title Title that is displayed for you in our product listings.
site_description A brief description of your business and the products or services that you feature.
soft_descriptor Description that is listed on the customer’s statement to help identify the charges.
site_category Category that your site is listed in.
return_url URL for your customers to be sent to on a successful purchase.
pending_return_url URL for your customers to be sent to when a purchase cannot be verified immediately.
affiliate_url Third party affiliate URL provided by your affiliate program.
return_method Direct return setting. (0 = Given links back to my website, 1 = Immediately returned to my website, Header Redirect)
secret_word Secret word used to calculate the MD5 hash.
currency_symbol Currency Symbol of the currency your account is priced in.
currency_code Currency code of the currency your account is priced in.
currency_name Currency name of the currency your account is priced in.
url URL registered to your account.
demo Account demo setting. (Y = On, N = Off, P = Parameter)

Example API call using cURL

curl -G https://www.2checkout.com/api/acct/detail_company_info \
    -u 'username:password' -H 'Accept: application/json'

Example Successful Response

 {
      "response_code" : "OK",
      "response_message" : "company info retrieved",
      "vendor_company_info" : {
        "affiliate_url" : "http://www.fake-company.com",
        "currency_code" : "USD",
        "currency_name" : "US Dollars",
        "currency_symbol" : "$",
        "demo" : "P",
        "pending_return_url" : "http://www.fake-company.com",
        "return_method" : "1",
        "return_url" : "http://www.fake-company.com",
        "secret_word" : "wh1sky",
        "site_category" : "Electronics",
        "site_description" : "Fake company for testing!",
        "site_title" : "Fake Company",
        "soft_descriptor" : "Test",
        "url" : "www.fake-company.com",
        "vendor_id" : "1234567",
        "vendor_name" : "Fake Company"
      }
    }

Update Coupon

Overview

The update_coupon call is used to update a coupon.

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

HTTP Method: POST


Input Parameters

Parameter Description
coupon_code The string value of the existing coupon code. Required.
new_code String value of new coupon code. Optional.
date_expire New expiration date of coupon. (YYYY-MM-DD) Optional.
type Denotes if coupon applies to shipping, sale or product. Required.
percentage_off Percentage, if supplied, to discount from purchase price. (value_off must be NULL, if percentage_off used) Optional.
value_off Decimal value of amount to discount. (percentage_off must be NULL, if value_off used) Optional.
minimum_purchase Decimal value indicating minimum purchase required before discount applies. Required if percentage_off or value_off are specified.
product_id Can accept multiple product_ids in querystring. (i.e. product_id=1112223333&product_id=2223334444) Required for product coupons if select_all is not specified.
select_all Set to 1 to enable. Set to 0 to remove all product assignments. Required for product coupons if product_id is not specified.

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

curl -X POST https://www.2checkout.com/api/products/update_coupon \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'coupon_code=APIMODIFY002' -d 'date_expire=2099-12-22' -d 'type=sale'

Example Successful Response

{
       "coupon_code" : "APIMODIFY002",
       "response_code" : "OK",
       "response_message" : "Coupon updated successfully"
    }

Common Error Codes

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

Create Coupon

The create_coupon call is used to create a new coupon.

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

HTTP Method: POST

 

Input Parameters

Parameter Description
coupon_code The string value of coupon code. Optional.
date_expire Expiration date of new coupon. (YYYY-MM-DD) Required.
type Denotes if coupon applies to shipping, sale or product. Required.
percentage_off Percentage, if supplied, to discount from purchase price. Can only be used with sale or product type coupons. (value_off must be NULL, if percentage_off used)
value_off Decimal value of amount to discount. Can only be used with sale or product type coupons. (percentage_off must be NULL, if value_off used)
minimum_purchase Decimal value indicating minimum required purchase amount before discount applies. Optional.
product_id 2CO system product ID. Can accept multiple product_ids in querystring. (i.e. product_id=112345678&product_id=987564321) Required for product coupons if select_all is not specified.
select_all If set to true (1), will select all products and override any product_ids supplied. Set to 0 to remove all product assignments. Required for product coupons if product_id is not specified.

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.
coupon_code ID assigned to the product by 2Checkout.

Example API Call

 curl -X POST https://www.2checkout.com/api/products/create_coupon \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'coupon_code=APITEST004' -d 'date_expire=2099-12-22' -d 'type=sale' \
    -d 'value_off=5.00' -d 'minimum_purchase=10.00'

Example Successful Response

 {
       "coupon_code" : "APITEST004",
       "response_code" : "OK",
       "response_message" : "Coupon successfully created"
    }

Common Error Codes

Code Description
PARAMETER_MISSING Required parameter missing:
PARAMETER_INVALID Invalid value for parameter:

Retrieve Option

Detail Option

The detail_option call is used to retrieve the details for a single option.

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

HTTP Method: GET

Input Parameters

Parameter Description
option_id ID value of option to get details for. Required.

Data Returned

Parameter Description
option_value_id System Option ID
vendor_id Merchant ID (2Checkout Account Number) of user.
option_value_surcharge Option value surcharge amount.
option_value_name Option value name.
option_id System Option ID.

Example API Call

curl -G https://www.2checkout.com/api/products/detail_option \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'option_id=4688355343'

Example Successful Response

 {
       "option" : [
          {
             "option_id" : "4688355343",
             "option_name" : "decibels",
             "option_values" : [
                {
                   "option_value_id" : "4688355346",
                   "option_value_name" : "150dB",
                   "option_value_surcharge" : "11.00"
                },
                {
                   "option_value_id" : "4688441332",
                   "option_value_name" : "200dB",
                   "option_value_surcharge" : "22.00"
                },
                {
                   "option_value_id" : "4688441335",
                   "option_value_name" : "250dB",
                   "option_value_surcharge" : "33.00"
                }
             ]
          }
       ],
       "response_code" : "OK",
       "response_message" : "Option detail retrieved successfully."
    }

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 option.

List Options

Overview

The list_options call is used to retrieve list of all options in the account.

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

HTTP Method: GET

Input Parameters

Parameter Description
option_name Filter list results by option name. Optional.
option_value_name Filter list results by option value name. Optional.
cur_page The page number to retrieve. First page = 1. Optional.
pagesize Total rows per page. Possible values are 1-100. If pagesize not specified, default of 20 items per page will be assigned internally. Optional.
sort_col The name of the column to sort on. Possibile values are option_id and option_name. (case insensitive) Optional.
sort_dir The direction of the sort process. (‘ASC’ or ‘DESC’) (case insensitive) Optional.

 

Data Returned

options

Parameter Description
option_id System Option ID
option_name Option name
option_values
Parameter Description
option_id System Option ID
option_value_id System Option ID
option_value_surcharge Option value surcharge
option_value_name Option value name
option_name Option name

Example API Call

curl -G https://www.2checkout.com/api/products/list_options \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'sort_col=option_name' -d 'sort_dir=desc'

Example Successful Response

 {
       "options" : [
          {
             "option_id" : "4688550010",
             "option_name" : "Volume",
             "option_values" : [
                {
                   "option_value_id" : "4688550013",
                   "option_value_name" : "Low",
                   "option_value_surcharge" : "1.00"
                },
                {
                   "option_value_id" : "4688550016",
                   "option_value_name" : "Medium",
                   "option_value_surcharge" : "2.00"
                },
                {
                   "option_value_id" : "4688550019",
                   "option_value_name" : "High",
                   "option_value_surcharge" : "3.00"
                }
             ]
          }
       ],
       "page_info" : {
          "cur_page" : "1",
          "first_entry" : 1,
          "first_page" : 1,
          "first_page_url" : "https://www.2checkout.com/api/products/list_options?cur_page=1",
          "last_entry" : "1",
          "last_page" : 1,
          "last_page_url" : "https://www.2checkout.com/api/products/list_options?cur_page=1",
          "next_page" : null,
          "pagesize" : "20",
          "previous_page" : null,
          "total_entries" : "1"
       },
       "response_code" : "OK",
       "response_message" : "Option information retrieved successfully."
    }

Common Error Codes

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

Delete Product

Overview

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

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.

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo