Skip to main content

Order created

Overview

Order creation is a new order placed online by a buyer. You may want to automate inventory management, fulfillment or setup of login credentials based on this message.

Recurring order creation is a special case of order creation; if any item ordered is recurring, the recurring parameter will be set to 1, otherwise, it will be set to 0.

Please note the initial installment billed often differs in price from the installments due to startup fees.

Order Created is an invoice level message; it will be sent once for each new sale and will contain information about all items ordered.

Message Parameters

Parameter Type Description
message_type Upper Case Text Indicates type of message (ORDER_CREATED, FRAUD_STATUS_CHANGED, SHIP_STATUS_CHANGED, INVOICE_STATUS_CHANGED, REFUND_ISSUED, RECURRING_INSTALLMENT_SUCCESS, RECURRING_INSTALLMENT_FAILED, RECURRING_STOPPED, RECURRING_COMPLETE, or RECURRING_RESTARTED )
message_description Text Human readable description of message_type
timestamp Timestamp Timestamp of event; format YYYY-MM-DD HH:MM:SS ZZZ
md5_hash Upper Case Text UPPERCASE(MD5_ENCRYPTED(sale_id + vendor_id + invoice_id + Secret Word)); Can be used to validate authenticity of message
message_id Numeric This number is incremented for each message sent to a given seller.
key_count Numeric Indicates the number of parameters sent in message
vendor_id Numeric Seller account number
sale_id Numeric 2Checkout sale number
sale_date_placed Date Date of sale; format YYYY-MM-DD
vendor_order_id Text Custom order id provided by seller, if available. (“merchant_order_id” can be passed into the checkout with the sale parameters)
invoice_id Numeric 2Checkout invoice number; Each sale can have several invoices, most commonly one per installment billed on a recurring order.
recurring Numeric recurring=1 if any item on the invoice is a recurring item, 0 otherwise
payment_type Lower Case Text Buyer’s payment method (credit card, online check, paypal ec, OR paypal pay later)
list_currency Upper Case Text 3-Letter ISO code for seller currency
cust_currency Upper Case Text 3-Letter ISO code for buyer currency
auth_exp Date The date credit authorization will expire; format YYYY-MM-DD
invoice_status Lower Case Text Status of a transaction (approved, pending, deposited, or declined)
fraud_status Lower Case Text Status of 2Checkout fraud review (pass, fail, or wait); This parameter could be empty on some sales.
invoice_list_amount Numeric Total in seller pricing currency; format as appropriate to currency (2 decimal places for most, integer for JPY)
invoice_usd_amount Numeric Total in US Dollars; format with 2 decimal places
invoice_cust_amount Numeric Total in buyer currency; format as appropriate to currency (2 decimal places for most, integer for JPY)
customer_first_name Text Buyer’s first name (may not be available on older sales)
customer_last_name Text Buyer’s last name (may not be available on older sales)
customer_name Text Buyer’s full name (name as it appears on credit card)
customer_email Text Buyer’s email address
customer_phone Numeric Buyer’s phone number; all but digits stripped out
customer_ip Text Buyer’s IP address at time of sale
customer_ip_country Text Country of record for buyer’s IP address at time of sale; Please note in some cases what is returned is not a country, Ex. Satellite Provider
bill_street_address Text Billing street address
bill_street_address2 Text Billing street address line 2
bill_city Text Billing address city
bill_state Text Billing address state or province
bill_postal_code Text Billing address postal code
bill_country Text 3-Letter ISO country code of billing address
ship_status Lower Case Text Value will be not_shipped, shipped, or empty (if intangible / does not need shipped)
ship_tracking_number Text Tracking Number as entered in Seller Admin
ship_name Text Shipping Recipient’s name (as it should appears on shipping label)
ship_street_address Text Shipping street address
ship_street_address2 Text Shipping street address line 2
ship_city Text Shipping address city
ship_state Text Shipping address state or province
ship_postal_code Text Shipping address postal code
ship_country Upper Case Text 3-Letter ISO country code of shipping address
item_count Numeric Indicates how many numbered sets of item parameters to expect
item_name_# Text Product name
item_id_# Text Seller product id
item_list_amount_# Numeric Total in seller pricing currency; format as appropriate to currency (2 decimal places for most, integer for JPY)
item_usd_amount_# Numeric Total in US Dollars; format with 2 decimal places
item_cust_amount_# Numeric Total in buyer currency; format as appropriate to currency (2 decimal places for most, integer for JPY)
item_type_# Lower Case Text Indicates if item is a bill or refund; Value will be bill or refund
item_duration_# Text Product duration, how long it re-bills for Ex. 1 Year
item_recurrence_# Text Product recurrence, how often it re-bills Ex. 1 Month
item_rec_list_amount_# Numeric Product price; format as appropriate to currency (2 decimal places for most, integer for JPY)
item_rec_status_# Lower Case Text Indicates status of recurring subscription: live, canceled, or completed
item_rec_date_next_# Date Date of next recurring installment; format YYYY-MM-DD
item_rec_install_billed_# Numeric The number of successful recurring installments successfully billed

Example message

{
        auth_exp => 
        bill_city => Columbus
        bill_country => USA
        bill_postal_code => 43215
        bill_state => OH
        bill_street_address => ​855 Grandview Avenue
        bill_street_address2 => Suite 11
        cust_currency => GBP
        customer_email => no-reply@2co.com
        customer_first_name => Testing
        customer_ip => 192.168.2.250
        customer_ip_country => Unknown
        customer_last_name => Tester
        customer_name => Testing  Tester
        customer_phone => 6149212450
        fraud_status => pass
        invoice_cust_amount => 2.00
        invoice_id => 4632527490
        invoice_list_amount => 2.00
        invoice_status => approved
        invoice_usd_amount => 3.04
        item_count => 2
        item_cust_amount_1 => 2.00
        item_cust_amount_2 => 2.00
        item_duration_1 => Forever
        item_duration_2 => Forever
        item_id_1 => test recurring product
        item_id_2 => test recurring product
        item_list_amount_1 => 2.00
        item_list_amount_2 => 2.00
        item_name_1 => test recurring product
        item_name_2 => test recurring product
        item_rec_date_next_1 => 2012-02-18
        item_rec_date_next_2 => 
        item_rec_install_billed_1 => 1
        item_rec_install_billed_2 => 1
        item_rec_list_amount_1 => 1.00
        item_rec_list_amount_2 => 1.00
        item_rec_status_1 => cancelled
        item_rec_status_2 => 
        item_recurrence_1 => 1 Week
        item_recurrence_2 => 1 Week
        item_type_1 => bill
        item_type_2 => refund
        item_usd_amount_1 => 3.04
        item_usd_amount_2 => 3.04
        key_count => 68
        list_currency => GBP
        md5_hash => 42C25A6BBA17D226C725B92A4A40C34A
        message_description => Order fraud status changed
        message_id => 2636
        message_type => FRAUD_STATUS_CHANGED
        payment_type => credit card
        recurring => 1
        sale_date_placed => 2012-02-11 09:11:18
        sale_id => 4632527448
        ship_city => Columbus
        ship_country => USA
        ship_name => Testing Tester
        ship_postal_code => 43215
        ship_state => OH
        ship_status => shipped
        ship_street_address => ​855 Grandview Avenue
        ship_street_address2 => Suite 11
        ship_tracking_number => 
        timestamp => 2012-02-11 18:47:02
        vendor_id => 532001
        vendor_order_id => test123
    }

 

Notifications

Overview

You can use the Instant Notification Service (INS) to automate order management processes by accepting order information via web posts. The INS is a service that will post sets of parameters to any URL you specify. Each post represents a message containing all the information you need about a specific event (such as when a recurring order re-bills successfully).

Enabling Notifications

In the seller admin, you can enable INS notifications under the Notifications tab. Messages can be enabled or disabled by selecting the checkbox for each message type and you may define either a Global URL for receipt of all messages or individual URLs per message as needed. You may also view and resend Successful and Failed INS notifications by clicking the Success and Failed sub-tab on the Notifications page. By clicking the Test sub-tab you may send test INS posts from inside your account to your URLs.

ins 2checkout

Listening for Notifications

Notifications are sent by an HTTP POST request to the message URL that you specified on the Notifications tab. The message parameters are passed as key => value pairs. Your message URL should route to the script where you will be handling the message. You can listen for messages by simply setting up logic in your application to take action based on the message_type parameter that is passed in each message.

Validating the Notification

Each notification message will include an MD5 hash that is computed using the secret word that you set up in your account.

The hash is returned on each message through the md5_hash key and is computed as follows:

UPPERCASE(MD5_ENCRYPTED(sale_id + vendor_id + invoice_id + Secret Word))

Each of our community-supported libraries provides a binding to validate the hash on a notification message.

Example

Below is an example PHP script that listens for the Fraud Status Changed message.

<?php

    if ($_POST['message_type'] == 'FRAUD_STATUS_CHANGED') {

        $insMessage = array();
        foreach ($_POST as $k => $v) {
        $insMessage[$k] = $v;
        }

        # Validate the Hash
        $hashSecretWord = "tango"; # Input your secret word
        $hashSid = 1303908; #Input your seller ID (2Checkout account number)
        $hashOrder = $insMessage['sale_id'];
        $hashInvoice = $insMessage['invoice_id'];
        $StringToHash = strtoupper(md5($hashOrder . $hashSid . $hashInvoice . $hashSecretWord));

        if ($StringToHash != $insMessage['md5_hash']) {
            die('Hash Incorrect');
        }

        switch ($insMessage['fraud_status']) {
            case 'pass':
                # Do something when sale passes fraud review.
                break;
            case 'fail':
                # Do something when sale fails fraud review.
                break;
            case 'wait':
                # Do something when sale requires additional fraud review.
                break;
        }
    }

?>

 

Delete Coupon

Overview

The delete_coupon call is used to delete a coupon.

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

HTTP Method: POST

Input Parameters

Parameter Description
coupon_code String value of coupon code for deleting coupon. 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 -G https://www.2checkout.com/api/products/detail_coupon \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'coupon_code=APITEST002'

Example Successful Response

 {
       "response_code" : "OK",
       "response_message" : "Coupon 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 coupon.

List Payments

Overview

The list_payments call is used to get a list of past payments.

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

HTTP Method: GET

Input Parameters

No input parameters required.


Data Returned

Parameter Description
payment_id Identifier of payment
payment_identifier Identifier of payment batch
date_paid Date of payment (YYYY-MM-DD MM:HH:SS format)
amount Amount of payment
reserve_held Reserve held
total_reserve_released Reserve released
date_reserve_released Date reserve released
payment_type Method of money transfer
total_sales Total amount of sales included in payment
total_fees Total amount of fees included in payment
total_refunds Total amount of refunds included in payment
total_chargeback_fees Total amount of chargebacks included in payment
total_adjustments Total amount of adjustments included in payment
total_commissions Total amount of commissions earned included in payment
total_outgoing_commissions Total amount of commissions paid included in payment
total_balance_forward Total amount of forwarded balance included in payment
void Wheter or not the payment was voided. (0=not voided, 1=voided)
date_voided Date the payment was voided.

Example API calls using cURL

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

Example Successful Response

{
       "payments" : [
          {
             "amount" : "50240.51",
             "date_paid" : null,
             "date_reserve_released" : null,
             "date_voided" : null,
             "payment_id" : "4681565342",
             "payment_identifier" : "wire_999042012",
             "payment_type" : "wire",
             "reserve_held" : "1646.07",
             "total_adjustments" : "0.00",
             "total_balance_forward" : "0.00",
             "total_chargeback_fees" : "0.00",
             "total_commissions" : "0.00",
             "total_fees" : "1941.34",
             "total_outgoing_commissions" : "0.00",
             "total_refunds" : "2418.46",
             "total_reserve_released" : "1397.38",
             "total_sales" : "54869.00",
             "void" : null
          },
          {
             "amount" : "45616.52",
             "date_paid" : null,
             "date_reserve_released" : null,
             "date_voided" : null,
             "payment_id" : "4676285423",
             "payment_identifier" : "wire_992042012",
             "payment_type" : "wire",
             "reserve_held" : "1499.83",
             "total_adjustments" : "0.00",
             "total_balance_forward" : "0.00",
             "total_chargeback_fees" : "0.00",
             "total_commissions" : "0.00",
             "total_fees" : "1768.57",
             "total_outgoing_commissions" : "0.00",
             "total_refunds" : "2553.00",
             "total_reserve_released" : "1463.62",
             "total_sales" : "49994.30",
             "void" : null
          }
       ],
       "response_code" : "OK",
       "response_message" : "payment info retrieved"
    }

 

Detail Pending Payment

Overview

The detail_pending_payment call is used to get a detailed estimate of the current pending payment.

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

HTTP Method: GET

Input Parameters

No input parameters required.

Data Returned

Parameter Description
amount Amount of payment
reserve_held Reserve held
total_sales Total amount of sales included in payment
total_fees Total amount of fees included in payment
total_refunds Total amount of refunds included in payment
total_chargeback_fees Total amount of chargebacks included in payment
total_adjustments Total amount of adjustments included in payment
total_commissions Total amount of commissions earned included in payment
total_outgoing_commissions Total amount of commissions paid included in payment
total_balance_forward Total amount of forwarded balance included in payment
payment_fee Amount charged for sending payment
payment_id Identifier of payment
payment_method Method of money transfer
release_level Release level

Example API calls using cURL

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

Example Successful Response

 {
       "payment" : {
          "amount" : "999.99",
          "payment_fee" : "0.00",
          "payment_id" : "2436561667",
          "payment_method" : "ach",
          "release_level" : "15",
          "reserve_held" : "14.19",
          "total_adjustments" : "61.07",
          "total_balance_forward" : "0.00",
          "total_chargeback_fees" : "0.00",
          "total_commissions" : "0.21",
          "total_fees" : "86.92",
          "total_outgoing_commissions" : "4.35",
          "total_refunds" : "275.36",
          "total_reserve_released" : "0.00",
          "total_sales" : "283.86"
       },
       "response_code" : "OK",
       "response_message" : "payment info retrieved"
    }

 

Detail Coupon

Overview

The detail_coupon call is used to retrieve the details for a single coupon.

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

HTTP Method: GET


Input Parameters

Parameter Description
coupon_code The string value of coupon code. Required

Data Returned

Parameter Description
coupon_code String value of coupon code.
date_expire Expiration Date. (YYYY-MM-DD)
percentage_off Percentage Discount
type Coupon type
value_off Fixed Discount
minimum_purchase Minimum purchase amount.
product_id ID of product selected for coupon.

Example API Call

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

Example Successful Response

 {
       "coupon" : {
          "coupon_code" : "APITEST002",
          "date_expire" : "2012-12-31",
          "minimum_purchase" : "5.00",
          "percentage_off" : "5",
          "product" : [
             {
                "product_id" : "0",
                "product_url" : "https://www.2checkout.com/api/products/detail_product?product_id=0"
             }
          ],
          "type" : "sale",
          "value_off" : null
       },
       "response_code" : "OK",
       "response_message" : "Coupon 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 coupon.

List Coupons

Overview

The list_coupons call is used to retrieve list of all coupons in the account.

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

HTTP Method: GET

Input Parameters

No input parameters required.

Data Returned

coupon

Parameter Description
coupon_code The string value of coupon code.
vendor_id Merchant ID (2Checkout Account Number) of user.
date_expire Expiration Date.(YYYY-MM-DD)
percentage_off Percentage Discount.
value_off Fixed Discount.
type Coupon type.
minimum_purchase Minimum purchase amount.
product_id ID of product selected for coupon.

Example API Call

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

Example Successful Response

{
       "coupon" : [
          {
             "coupon_code" : "TESTPERCENT",
             "date_expire" : "2013-06-30",
             "minimum_purchase" : "1.00",
             "percentage_off" : "0.10",
             "type" : "product",
             "value_off" : null
          },
          {
             "coupon_code" : "APITEST002",
             "date_expire" : "2012-12-31",
             "minimum_purchase" : "5.00",
             "percentage_off" : "0.05",
             "type" : "sale",
             "value_off" : null
          },
          {
             "coupon_code" : "APITEST003",
             "date_expire" : "2012-12-31",
             "minimum_purchase" : "5.00",
             "percentage_off" : "0.01",
             "type" : "sale",
             "value_off" : null
          },
          {
             "coupon_code" : "APITEST004",
             "date_expire" : "2012-12-31",
             "minimum_purchase" : "5.00",
             "percentage_off" : "0.02",
             "type" : "sale",
             "value_off" : null
          },
          {
             "coupon_code" : "PERCENTALL",
             "date_expire" : "2012-05-04",
             "minimum_purchase" : "10.00",
             "percentage_off" : "0.10",
             "type" : "product",
             "value_off" : null
          }
       ],
       "response_code" : "OK",
       "response_message" : "Coupon 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 Option

Overview

The delete_option call is used to delete a product option.

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

HTTP Method: POST


Input Parameters

Parameter Description
option_id ID of option 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_option \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'option_id=4709264206'

Example Successful Response

    {
       "response_code" : "OK",
       "response_message" : "Option deleted 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.

Update Option

Overview

The update_option call is used to update an option.

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

HTTP Method: POST


Input Parameters

Parameter Description
option_id ID of option being updated. Required.
option_name Name of new product option. Required.
option_value_id ID of existing option value to update/delete. Required when updating/deleting an option value.
option_value_name Name of option value. Required when creating an option value.
option_value_surcharge Amount of option surcharge. Required when creating an option value surcharge.

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_option \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'option_id=1001' -d 'option_name=test option' -d 'option_value_name=colors'
    -d 'option_value_surcharge=1.00'

Example Successful Response

    {
       "response_code" : "OK",
       "response_message" : "Option 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.
FORBIDDEN Access denied to option.

Create Option

Overview

The create_option call is used to create a new product option.

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

HTTP Method: POST


Input Parameters

Parameter Description
option_name Name of new product option. Required.
option_value_name Name of option value. Multiples allowed but must equal number of option_value_surcharges supplied (&option_value_name=xxxxxxxx&option_value_name=yyyyyyyyy). Required.
option_value_surcharge Amount of option value. Multiples allowed but must equal number of option_value_names supplied (&option_value_surcharge=xxxxxxxx&option_value_surcharge=yyyyyyyyy). 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.
option_id ID assigned to the option by 2Checkout.

Example API Call

curl -X POST https://www.2checkout.com/api/products/create_option \
    -H 'Accept: application/json' -u 'username:password' \
    -d 'option_name=test' -d 'option_value_name=red' -d 'option_value_surcharge=1.00' \
    -d 'option_value_name=blue' -d 'option_value_surcharge=1.00'

Example Successful Response

    {
       "option_id" : "1234567890",
       "response_code" : "OK",
       "response_message" : "Option created successfully"
    }

Common Error Codes

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

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