Command Line Reference

Cart

Once you have set up your products for your shop, you can redirect customers from your website directly to a shopping basket via the s.cgi command. With this command you can add one or more products, or simply display the basket with it's current contents

The following switches can be used with the s.cgi interface.

Argument Description Required?
a Afiliate ID
This will allow you perform simple afiliate tracking. See the page on Affiliate Tracking for more details.
No
bb Bypass Basket (Available only on certain plans). By setting this parameter to any value, the shopping basket stage will be bypassed and the customer will move straight on to the customer details form.

E.g. s.cgi?s=123&p=123puppy&v=0&d=1&q=1&bb=1 - Add product 123puppy with variation id 0 and delivery id 1 from shop 123 to the basket and not display the shopping basket.
No
clr Switch to clear the basket contents. Including this option and setting it's value to anything will clear the basket contents.

E.g. s.cgi?s=123&p=123puppy&v=0&d=1&q=1&clr=1 - Clear any previous basket contents and add product 123puppy with variation id 0 and delivery id 1 from shop 123.
No
clro Clears the offers applied to the cart.

E.g. s.cgi?s=123&p=123puppy&v=0&d=1&q=1&clro=1 - Clear any offers applied to the cart and add product 123puppy with variation id 0 and delivery id 1 from shop 123.
No
d The delivery id of the product you wish to add. Each variation has one or more delivery types associated. You can specify the delivery id for more than one product by separating the ids with ':' characters. These must be in the same order as the other multiple paramters.

E.g. s.cgi?s=123&p=123puppy&v=0&d=1&q=1 - Add product 123puppy with variation id 0 and delivery id 1 from shop 123 to the basket.

E.g. s.cgi?s=123&p=123puppy:123kitten&v=0:0&d=0:5&q=1:1 - Add products 123puppy with variation id 0 and delivery id 0, and 123kitten with variation id 0 and delivery id 5 from shop 123 to the basket.
Yes, unless 'vd' or 'r'
lang Language Identifier. You can use this parameter to allow the system to select different templates at purchase-time by uploading and assigning a Language Tag to each template.

E.g. If you upload 2 different temlates for the shopping basket, one in English and one in French and activate both. Leave the English version as default, and set the language tag for the French version to Fr

s.cgi?s=123&p=123puppy&v=0&d=1&q=1&lang=Fr - This will pick up the French version
s.cgi?s=123&p=123puppy&v=0&d=1&q=1&lang=Spoon - This will pick up the default (in this case English) version
s.cgi?s=123&p=123puppy&v=0&d=1&q=1 - This will pick up the default (in this case English) version
No
lnk Return link URL. If you supply this paramter, on each System Default confirmation page it will use this URL to create a hyperlink titled 'Continue Shopping'. Those who have customised their purchase process can change this link by using the ###RETURNLINK### token. See the reference guide for more details.

E.g. s.cgi?s=123&p=123puppy&v=0&d=1&q=1&lnk=http://www.mywebsite.com/
No
q The quantity of items you wish to add. You can specify the quantity for more than one product by separating the values with ':' characters. These must be in the same order as the other multiple paramters.

E.g. s.cgi?s=123&p=123puppy&v=0&d=1&q=5 - Add 5 x 123puppy with variation id 0 and delivery id 1 from shop 123 to the basket.

E.g. s.cgi?s=123&p=123puppy:123kitten&v=0:0&d=0:5&q=2:1 - Add 2 x 123puppy with variation id 0 and delivery id 0, and 1 x 123kitten with variation id 0 and delivery id 5 from shop 123 to the basket.
Yes
r If 'r' is specified on the command line with any value, then all other paramters except for 's' will be ignored and the basket will simply be redisplayed.

E.g. s.cgi?s=123&r=1 - Simply redisplay the basket.
Yes
rc Use 'rc' to pass a Promotional URL code.

E.g. s.cgi?s=123&p=123puppy&v=0&d=1&q=5&rc=45K2D45K2F - Trigger a promotion active on 123puppy variation id 0
Yes
s This should be set to your unique shop id allocated to you when you set your shop up. You can specify more than one shop id by separating each shop id with a ':' character. The template used for the look and feel is defined by the first shop id in the list. If only one shop id is specified, then all products on the command line are from that shop. If more than one shop id is specified, then there must be the same amount of shop id's as product codes.

E.g. s.cgi?s=123&p=123puppy&v=0&d=0&q=1 - Add product 123puppy with variation id 0 and delivery id 0 from shop 123 to the basket.

E.g. s.cgi?s=123&p=123puppy:123kitten&v=0:0&d=0:0&q=1:1 - Add product 123puppy with variation id 0 and delivery id 0, and product 123kitten with variation id 0 and delivery id 0 both from shop 123 to the basket.

E.g. s.cgi?s=123:205&p=123puppy:205hamster&v=0:0&d=0:0&q=1:1 - Add product 123puppy with variation id 0 and delivery id 0 from shop 123, and product 205hamster with variation id 0 and delivery id 0 from shop 205 to the basket.
Yes
t This parameter allows you to pass up to a 250 character arbitrary string which will be passed through the purchase process. You can specify more than one arbitrary strings by separating each string with a ':' character. Ensure any strings generated do not contain ':' characters (such as a date string) as these will be confused with field deliminators. There must be the same amount of arbitrary strings as product codes.

E.g. s.cgi?s=123&p=123puppy&v=0&d=0&q=1&t=Some%20Text - Add product 123puppy with variation id 0 and delivery id 0 and user text 'Some Text' from shop 123 to the basket.
No
v The variation id of the product you wish to add. Each product has one or more variations associated. You can specify the variation id for more than one product by separating the ids with ':' characters. These must be in the same order as the other multiple paramters.

E.g. s.cgi?s=123&p=123puppy&v=0&d=1&q=1 - Add product 123puppy with variation id 0 and delivery id 1 from shop 123 to the basket.

E.g. s.cgi?s=123&p=123puppy:123kitten&v=0:5&d=0:0&q=1:1 - Add products 123puppy with variation id 0 and delivery id 0, and 123kitten with variation id 5 and delivery id 0 from shop 123 to the basket.
Yes, unless 'vd' or 'r'
vd Both the variation id and the delivery id separated with a '.' character. Multiple variation id's and delivery id's can be specified.

E.g. s.cgi?s=123&p=123puppy&vd=2.5&q=1 - Add product 123puppy with variation id 2 and delivery id 5 from shop 123 to the basket

E.g. s.cgi?s=123&p=123puppy:123kitten&vd=2:3.5:4&q=1:1 - Add product 123puppy with variation id 2 and delivery id 5, and product 123kitten with variation id 3 and delivery id 4 from shop 123 to the basket
No
vp Variable Pricing - use this command line switch to specify the price of a product added to the basket. You must first have enabled Variable Pricing for this product in the Electronic Delivery and E-mail Receipt Setup page. Multiple prices can be specified using the ':' character, and if -1 is specified as a price then the original price specified in the product setup will be used. If a delivery charge has been setup then this will be added on. Banding will be ignored. Prices specified will taken in the base currency for the machine (Ie. USD, GBP or EURO).

E.g. s.cgi?s=123&p=123puppy&v=0&d=0&q=1&vp=9.99 - Add product 123puppy with variation id 0 and delivery id 0 from shop 123 to the basket and adjust it's price to 9.99.

Please Note : You can set the minimum price on a per delivery type basis in the Electronic Delivery and E-mail Receipt Setup section of the product setup pages.
No
x This switch causes the the contents of the 't' parameter to be hidden during the purchase process. Use x=1 to hide the data and x=0 or not specified to show the data. No
zb Zero Quantity Item Flag: Allows placement of products with zero quantity into the cart. The line item will be removed after the shopping cart page if the customer has not changed the quantity to > 0. No
Customer Data

Below are optional customer data parameters that can be sent to your order form. You can send as many or as few parameters you have; the purpose is to allow SWREG to pre-fill the order form with customer data elements that you may have already collected.

In order to supply the below parameters, you must call s.cgi over SSL, and the call to s.cgi must be made via HTTP POST. An example can be found here.

Parameter Description Maximum length
fn Billing First Name 20 characters
sn Billing Last Name (Surname) 20 characters
co Billing Company Name 60 characters
a1 Billing Address Line 1 30 characters
a2 Billing Address Line 2 30 characters
a3 Billing City 30 characters
st Billing State/Province
Required if country is US or CA
30 characters
zp Billing ZIP/Postal Code 30 characters
ct Billing Country
ISO3166 codes, can accept english spelling but will be converted so spelling must be correct.
30 characters
em Email Address 60 characters
em2 Alternate Email Address 60 characters
pn Billing Phone Number 22 characters
vn VAT Number 20 characters
ins Instructions. Requires ###COMMENTBOX### token on single page template or details template. 65535 characters
use_billing_address Use billing address as Shipping Address. Below fields will be ignored if populated. 0 or 1
dfn Shipping First Name 20 characters
dsn Shipping Last Name (Surname) 20 characters
dco Shipping Company Name 60 characters
da1 Shipping Address Line 1 30 characters
da2 Shipping Address Line 2 30 characters
da3 Shipping City 30 characters
dst Shipping State/Province
Required if country is US or CA
30 characters
dzp Shipping ZIP/Postal Code 30 characters
dct Shipping Country
ISO3166 codes, can accept english spelling but will be converted so spelling must be correct.
30 characters
SWREG offers a paypal alternative, affordable ecommerce, payment processing, ecommerce solution, and an online software store with the ability to sell shareware.