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.

The next 11 items are those entered by the customer in the "Your Shopping Cart" form.

Comments
Name
Company
Email
Address
Address2
City
State
Zip
Phone
Country

The next few items reflect the payment method.

paytype
paytype is an integer representing the payment method chosen by the customer in the Shopping Cart form, as follows:

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

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

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-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-bo_reg_url
URL of ShopSite CGIs
S-from_addr
"From" address in e-mail receipts
S-mystore
The storefront URL that the merchant sees by clicking the My Store button.
S-customcgi
Location of custom CGI
S-bo_secure_url
Secure URL of ShopSite CGIs
S-image_url
The URL where standard ShopSite images are stored.
S-smartbuild
(ignore)
S-image_dir
The pathname where standard ShopSite images are stored.
S-image_url_secure
The secure URL where standard ShopSite images are stored.
S-perl_loc
Location of PERL executable
S-indexbuild
(ignore)
S-MerchantLocale
Full description of the merchant locale, as defined in the localeinfo.dat file.
S-sb_use_security
Use security in shopping cart?
S-AdvancedUser
(ignore)
S-pagesbuild
(ignore)
S-sb_dir
Shopping cart (basket) directory
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-outputdir
Output directory
S-BuyerLocale
Full description of the merchant locale, as defined in the localeinfo.dat file.
S-currency
The currency defined for the store, in the format of the currency.dat file.
S-sendmail_loc
Location of sendmail executable.
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-City
F-State
F-Zip
F-Country
F-Phone

The paytype stuff again:

F-paytype
F-pay1
F-pay2
F-pay3
credit card expiration date in the form mm/yyyy.
F-pay4

Miscellaneous information:

F-ShipOn
"checked" if the customer checked the box for a separate shipping address.
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.
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 value '--'.

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

paytype stuff:

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.
B Values (Basket information)

Last, information for each of the products in the order from the basket db. Each name starts with 'B' and a two or more digit preface, which differs for each product. The products 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-Name
B0x-Price
B0x-Quantity
B0x-Sub-total
B0x-Finite Options
B0x-Freeform Options
B0x-OrigDB
B0x-OrigRNum
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
B0x-recid

ShopSite Help and Resource Center
April 18, 2002
Give Feedback

Copyright © ShopSite, Inc.
http://www.shopsite.com