Screen: ShopSite > Merchandising > Order API

Order API Specification

Interface

From the point of view of the CGI, it's running like any other CGI called with the POST method. It's input is an '&' delimited series of name value pairs (name=value) and the whole thing is URL-encoded.

The CGI should find the pairs, determine the name and value for each, and decode the name and value. The CGI can then do whatever CGIs do. Anything written to standard output will go to the server, etc.

The input is currently in five parts.

Input to thankyou.cgi

The first set of input values contains the original input to thankyou.cgi:

prevlocation
The location (and QUERY method string) where the order entered the shopping cart system of CGIs.
sbid
Shopping basket id. A unique identifier for the shopping cart making the CGI calls.
snoreid
An encrypted value for the store ID. (Yes, that’s "snoreid" and not "storeid.")
tax
Submit this Order.x
The horizontal cursor location when the Submit button was clicked.
Submit this Order.y
The vertical cursor location when the Submit button was clicked.

The next set of items are those entered by the customer in the shopping cart and shipping forms.

Name
ShipName
email_list
Set to on if the customer checked the box to be added to the e-mail list.
Comments
The text supplied by the customer in the Comments box.
Title
First
Middle
Last
Suffix
Company
Email
Address
Address2
City
State
Zip
Country
Phone

Shipping information.

ShipTitle
ShipFirst
ShipMiddle
ShipLast
ShipSuffix
ShipCompany
ShipAddress
ShipAddress2
ShipCity
ShipState
ShipZip
ShipCountry
ShipPhone

The next few items reflect the payment method.

pay1
pay2
pay3
pay4
pay4_1
pay4_2
These differ according to the PayType. For most credit cards:
pay1 is the card number
pay2 is the name on card
pay3 is the company name on the card
pay4 is replaced by pay4_1 containing the expiration month and pay4_2 containing the expiration year.

For PayType C.O.D. all of these will be '--'.

cvv2
the card CVV2 number
fieldnn
The values for any custom checkout fields filled in by the customer. "nn" will be the field number, such as field02.
F- Values

The next block of name value pairs come from an internal thankyou.cgi table. All are prefaced by 'F-'.

Items from the Checkout form:

F-Name
F-Company
F-Email
F-Address
F-Address2
F-City
F-State
F-Zip
F-Country
F-Phone
F-ShipName

The following "Ship" fields are only present if the order includes a separate shipping address.

F-ShipCompany
F-ShipAddress
F-ShipAddress2
F-ShipCity
F-ShipState
F-ShipZip
F-ShipCountry
F-ShipPhone

The PayType stuff again:

F-paytype
F-pay1
F-pay2
F-pay3
F-pay4
credit card expiration date in the form mm/yyyy.
F-OrderInfo
This field is only included if realtime credit card processing was used to pay for the order. It contains the response from the payment gateway.

Miscellaneous information:

F-ShipOn
"checked" if the shipping address and billing address were entered separately. If this field is empty, the customer selected to use the same address for billing and shipping.
F-OrderInst
The text of any customer-supplied ordering instructions.
F-Comments
The text of any customer-supplied comments.
F-ProductTotal
The total price of all products in the order, before any discounts, surcharges, tax, and shipping.
F-TaxTotal
The total amount of tax for the order.
F-ShippingTotal
The total shipping charge for the order.
F-GrandTotal
The amount charged to the customer for the order, including all products, surcharges, discounts, tax, and shipping.
F-Shipping
The name of the shipping method selected by the customer.
F-cvv2
The CVV2 number from the credit card.
F-EmailList
Set to on if the customer checked the e-mail box, or no if the box was not checked.
F-IP_Addr
The IP address from which the customer placed the order.
F-Total_Weight
The total shipping weight for the order.
F-Custom Fields
The names and values of any custom fields, separated by a pipe symbol ( | ).
F-Title
F-First
F-Middle
F-Last
F-Suffix
F-ShipFirst
F-ShipLast
F-tax_percent
Tax percentage for zip-code based tax calculation.
F-tax_string
Zip code location name for zip-code based tax calculation
O- Values (Order Information)

The next block of name value pairs come from the record for this order in the orders database. Each name is prefixed by 'O-' and the name is the field name in the data base.

O-Date
Date of the order
O-OrderNum
Order number

Items from the various forms:

O-Name
O-Company
O-Email
O-Address
O-Address2
O-City
O-State
O-Zip
O-Country
O-Phone

Items for the shipping information. If the shipping information is the same as the billing information, these fields will have no value.

O-ShipName
O-ShipCompany
O-ShipAddress
O-ShipAddress2
O-ShipCity
O-ShipState
O-ShipZip
O-ShipCountry
O-ShipPhone

PayType stuff:

O-paytype
O-PayType
O-pay1
O-pay2
O-pay3
O-pay4

More form stuff:

O-ShipOn
O-OrderInst
O-Comments
O-ProductTotal
O-TaxTotal
O-ShippingTotal
O-GrandTotal

Last, some items not on the form.

O-NumItems
Number of items in this order
O-OrderData
Some miscellaneous binary coded data. Usually a couple of random bytes (BSDI, Linux) or nothing (Solaris).
O-Viewed
Whether the order has been viewed from ShopSite by the merchant. 'n' or 'y'.
O-Shipping
The shipping method selected by the customer.
O-Discount
The amount of any discount applied to the order.
O-Surcharge
The text of the surcharge selection chosen by the customer, including the method for modifying the price.
O-RefName
Associate name, if the customer arrived at the store via an associate referral
O-AllTotals
A text line containing various totals in the order, separated by a pipe ( | ) character.
O-Coupons
O-OrderInfo
O-cvv2
O-EmailList
O-IP/Hostname
The IP address and hostname of the customer placing the order.
O-TotalWeight
The total weight of all products in the order.
O-CustomFields
O-Title
O-First
O-Middle
O-Last
O-Suffix
O-ShipTitle
O-ShipFirst
O-ShipMiddle
O-ShipLast
O-ShipSuffix
O-TaxRate
O-TaxName
O-GiftCertificate
If a gift certificate is redeemed, the certificate number, the remaining balance, and the used balance of the certificate.
B Values (Basket information)

Information for each of the products and coupons in the order from the basket db. Each name starts with 'B' and a two or more digit preface, which differs for each product/coupon. The products and coupons are numbered starting with '01'. So, for the first product (item) in the basket, the prefix will be 'B01-'.

The names and functions can be best understood by looking in the back office in the Products -> Add Product form.

B0x-Download Key
The download key for downloadable products. This field will not appear if B0x-Product Type is not "Download"
B0x-Name
B0x-Price
The price of the product. This value will be negative for coupons that have been applied, and 0 for coupons that were not applied.
B0x-Quantity
B0x-Sub-total
B0x-Finite Options
Customer-selected ordering options
B0x-Freeform Options
Text entered into the ordering options text box.
B0x-OrigDB
The database that the product information came from.
B0x-OrigRNum
The product record number in the database.
B0x-ship1
B0x-ship2
B0x-ship3
B0x-Options Box?
B0x-Option Text
B0x-Option Finite Text
B0x-Taxable
B0x-SKU
B0x-Base Price
B0x-ship4
B0x-ship5
B0x-ship6
B0x-ship7
B0x-ship8
B0x-ship9
B0x-ship10
B0x-SuperNum
The item number of the parent product if the product ordered is a subproduct (AKA Cross-Sell).
B0x-Page Ordered From
The URL of the page from which the product was ordered.
B0x-recid
B0x-NoShipping
B0x-Product Type
Tangible, Download, or coupon
B0x-Product Type Data
The file name of a digital download product.
B0x-record_number
B0x-rec_type
Set to cpn for coupons
B0x-coupon_ret_val
1 if the coupon was applied, 0 if the coupons was not applied
B0x-Dimension
The dimensions of the shipping box for this product, in the form LxWxH.
B0x-Weight
The shipping weight of the product.
B0x-Handling_Charge
The product-specific handling charge for this product.
B0x-QBImport
The QuickBooks account and sales categories for this product, which are only used when exporting order information in QuickBooks format.
B0x-Field1
B0x-Field2
B0x-Field3
B0x-Field4
B0x-Field5
The five generic product fields for this product. These can hold any string value that the merchant enters.
B0x-Quantity Pricing
If Quantity Pricing is enabled for this product, this value contains all of the information from the Quantity Pricing table. The important values, such as price, quantity, and sub-total, can be found in other fields.
B0x-OnSaleFlag
checked if the product was on sale.
B0x-ActualBasePrice
The base product price (not the sale price)
storeid
The unique identifier of the store. This value is also contained in the store’s store.auth file.
S- Values (Store Settings)

The next block of pairs represents the settings file for the store. All names are prefaced by 'S-'. Many of these may be seen in the Hosting Service screen.

S-storeid
The unique identifier of the store. This value is also contained in the store’s store.auth file.
S-datadir
Data directory
S-bo_dir
URL of ShopSite CGIs
S-smtp_host
The name of the host that ShopSite uses for SMTP services.
S-keep_sb_days
The number of days that ShopSite keeps shopping carts.
S-sb_secure_url
Secure URL of shopping cart CGIs
S-sb_prompt_orderinst
Prompt for ordering instructions
S-bo_use_security
Use Security in ShopSite?
S-from_addr
"From" address in e-mail receipts
S-bo_reg_url
URL of ShopSite CGIs
S-mystore
The storefront URL that the merchant sees by clicking the My Store button.
S-customcgi
Location of custom CGI
S-separator
The separator character used in large currency amounts.
S-decimal
The decimal separator used in currency for this locale.
S-bo_secure_url
The secure URL of back office CGI programs.
S-image_url
The URL where standard ShopSite images are stored.
S-delim_infield
S-image_dir
The pathname where standard ShopSite images are stored.
S-smartbuild
(ignore)
S-image_url_secure
The secure URL where standard ShopSite images are stored.
S-indexbuild
(ignore)
S-MerchantLocale
Full description of the merchant locale, as defined in the localeinfo.dat file.
S-AdvancedUser
(ignore)
S-sb_use_security
Use security in shopping cart?
S-sb_dir
Shopping cart (basket) directory
S-pagesbuild
(ignore)
S-altcurrency
The alternate currency used in the store.
S-ccprocessor
Credit card processor type
S-sb_prompt_comments
Prompt for comments?
S-sb_reg_url
URL of shopping cart CGIs
S-outputurl
URL of store
S-delim_betfield
(ignore)
S-currencyratio
(ignore)
S-outputdir
Output directory
S-currency
The currency defined for the store, in the format of the currency.dat file.
S-BuyerLocale
Full description of the merchant locale, as defined in the localeinfo.dat file.
S-sendmail_loc
Location of sendmail executable.
PayType
PayType is an integer representing the payment method chosen by the customer in the Shopping Cart form. Possible value are:

0 = Visa
1 = MasterCard
2 = Discover
3 = American Express
4 = Purchase Order
5 = C.O.D.
6 = Check
7 = PayPal
8 = Generic Payment Option 1
9 = Generic Payment Option 2
10 = Diner’s Club/Carte Blanche

orderapi1
orderapi2
orderapi3
orderapi4
The values that the merchant entered into the Additional Parameter fields on the Order API screen.
CCemail
The e-mail addresses and names entered by the merchant in the Order Notifications CC: field on the Hosting Services screen.
cgi
The file name of the currently running CGI program.
number_cgis
The total number of CGI programs that are to be run by the Order AIP interface.
current_cgi
The number of the current CGI program out of the total number to run.

ShopSite Help and Resource Center
February 13, 2004
Give Feedback

© 2007, ShopSite, Inc.
ShopSite Shopping Cart Software