Skip to main content

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.

Update Product

Overview

The update_product call is used to update a product.

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

HTTP Method: POST

Input Parameters

Parameter Description
product_id ID of product to update. Required.
name Product Name. Required.
price Product Price. Required.
vendor_product_id Merchant Assigned Product ID. Optional.
description Product Short Description. Optional.
long_description Product Long Description. Optional.
pending_url Product Pending URL. Optional.
approved_url Product Approved URL. Optional.
tangible Tangible=1, Intangible=0. Optional.
weight Decimal value of weight. Required for tangible products.
handling Specifies handling charge if applicable. Required for tangible products.
recurring 1 = recurring, 0 = non-recurring. Required for recurring products.
startup_fee Specifies start up fee if applicable. Optional.
recurrence Specifies recurrence frequency (n Week
duration Specifies recurrence duration (n Week
commission 1 = commission, 0 = no commission. Required for affiliate products.
commission_type Sets commission type for product. Possible values: amount, percentage. Required for affiliate products.
commission_amount Sets commission value for product (based on commission_type). Required for affiliate products.
option_id Accepts single or multiple option IDs to assign to product. (multiple IDs would be &option_id=xxxxxxxxx repeated for each ID to assign, where xxxxxxxxx represents each ID value to assign.) Optional.
category_id Accepts single or multiple category IDs to assign product to. (multiple IDs would be &category_id=xxxxxxxxx repeated for each ID to assign, where xxxxxxxxx represents each ID value to assign.) 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/products/update_product \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'name=test product' -d 'price=1.00' -d 'product_id=4691409938'

Example Successful Response

 {
       "assigned_product_id" : "2561",
       "product_id" : "4691409938",
       "response_code" : "OK",
       "response_message" : "Product successfully updated"
    }

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.

Mark Shipped

 

Overview

The mark_shipped call is used to attempt to mark an order as shipped and will attempt to reauthorize sale if specified in call. This call will send the SHIP_STATUS_CHANGED INS message.

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

HTTP Method: POST


Input Parameters

Parameter Description
sale_id The order number/sale ID to mark shipped. Optional when invoice_id is present.
invoice_id ID of the invoice to add tracking information to. Required on sales with more than one invoice.
tracking_number The tracking number issued by the shipper. Required.
cc_customer Specify whether the customer should be automatically notified. Use “1” for true. Defaults to false. Optional.
reauthorize Reauthorize payment if payment authorization has expired. Defaults to false. Optional.
comment Any text except for “<” and “>” up to 255 chars in length. 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/mark_shipped \ -H 'Accept: application/json' -u 'username:password' \ -d 'tracking_number=123' -d 'cc_customer=1' -d 'sale_id=1234567890'

Example Successful Response

{ "response_code" : "OK", "response_message" : "Sale marked shipped." }

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.

Method Specific Error Codes

Code Description
NOTHING_TO_DO Item not shippable.
TOO_LATE Payment is already pending or deposited and cannot be reauthorized.
TOO_SOON Please wait until the next day before trying to reauthorize again.
FAILED Failed to reauthorize payment.
INTERNAL_ERROR Failed to marked shipped but reauthorization succeeded.
INTERNAL_ERROR Failed to marked shipped.

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