TclMML

[mml upload order]

Documentation: Uploading Orders

[ Home | Docs | FAQ | Download | CVS | Mailing Lists | Bug Tracker | USPS's MOL Site ]

Syntax

mml upload order ?-flags? ?-switches? order_name

Flags

-price_quote (Optional)

When present, rather than uploading an order, a price quote for the specific document, mailing list, and finishing options is generated, and the total cost returned.

-ach (Optional)

When present, rather than paying for an order by credit card, ACH direct withrdawl will be used. To be able to use ACH you must have previously filled out & submitted the proper paperwork with the USPS for your MOL account.

Switches

-debug filename (Optional)

If specified, the XML generated and sent to the MOL system, as well as the XML reply from the MOL system, will be appended to filename.

-document document_id (Required)

The document_id of the document to use with this order. This is the opaque identifier returned initially be upload document, and subsequently available via document details.

-mailing_list mailing_list_id (Required)

The mailing_list_id of the mailing list to use with this order. This is the opaque identifier returned initially be upload mailing_list, and subsequently available via mailing_list details.

-return_address return_address_id (Required)

The return_address_id of the return address to use with this order. This is the opaque identifier returned initially be upload return_address, and subsequently available via return_address details.

-plex plex (Optional)

Specifies what type of envelope to use. Canonical values are: Single-Sided or Double-Sided.

Valid synonyms include: single, "single sided", simplexed; double, "double sided" and duplexed.

The initial default value for -plex is Single-Sided.

-envelope envelope (Optional)

Specifies what type of envelope to use. Canonical values are No10_Envelope, Flat_Envelope, Self-Mailer and Postcard.

Valid synonyms include: #10, "business envelope", "regular envelope", ten; 9x12, flat; self and "self mailer".

The initial default value for -envelope is No10_Envelope.

-mail_class mail_class (Optional)

Specifies what mail class this order qualifies for. Canonical values are First_Class, Standard_Mail and Non_Profit.

Valid synonyms include: 1st, "first class", first; "standard mail", standard, bulk; Non-Profit.

The initial default value for -mail_class is First_Class. Restrictions apply to Standard Mail and Non Profit requires your MOL account to be flagged as being eligible to receive this rate.

-booket boolean (Optional)

Specifies whether the order is to be printed as a booklet. Canonical values are on and off.

Valid synonyms include any value that the Tcl command [string is boolean -strict $boolean] would return true for.

The initial default value for -booklet is off.

-color color (Optional)

Specifies what color(s) are used to print the document. Canonical values are Black_And_White, Blue_Spot_Color, Red_Spot_Color, Green_Spot_Color, Magenta_Spot_Color and Full_Color.

Valid synonyms include: b&w, none, black, blue, red, green, magenta, full and "four color".

The initial default value for -color is Black_And_White.

-carbon_copy method (Optional)

Specifies whether a copy of your final document should be sent to you. Canonical values are None, Mail_Back and Fax_Back.

Valid synonyms include: mail and fax.

The initial default value for -carbon_copy is None. The address or fax number used is the one you provided when you initially create your MOL account on the USPS website. Neither can be changed via the MML interface to MOL.

-binding binding (Optional)

Specifies whether your document should be bound at all. Canonical values are None, Stapled and Saddle-Stitched.

Valid synonyms include: no, staple, sadle and stitched.

The initial default value for -binding is None.

-paper_type paper_type (Optional)

Specifies the type of paper stock to use in printing your document. Canonical values are White_24lb, Off_White_28lb, Canary_24lb and PostcardStock.

Valid synonyms include: white, 24lb, 24#, "off white", 28lb, 28#, canary and postcard.

The initial default value for -paper_type is White_24lb.

-process_delay num_days (Optional)

0 29Specifies the number of business days to wait before printing and mailing the order. Any integer value from to is acceptable.

0The initial default value for -process_delay is .

-cc_type cc_type (Optional)

Specifies the type of credit card being used to pay for your order. Canonical values are Visa, MasterCard, American_Express, Discover, Diners_Club and Carte_Blanche.

Valid synonyms include: MC, AmEx, AX, Diners, Carte and Blanche.

The initial default value for -cc_type is Visa.

-cc_month exp_month (Optional)

Specifies the month of expiration of the credit card being used to pay for this order. Canonical values are the 0-padded numeric values from 01 to 12.

Valid synonyms include the full month name or standard 3-letter abbreviation.

The initial default value for -cc_month is the current month.

-cc_year exp_year (Optional)

Specifies the year of expiration of the credit card being used to pay for this order. Canonical values is the four-digit year.

Valid synonyms include a two-digit year, which will have 20 prepended.

The initial default value for -cc_year is the current year.

-cc_number cc_number (Optional)

Specifies the credit card number to charge this order to.

The initial default value for -cc_number is the utterly bogus Visa number 4111111111111111.

-billing_address billing_address_name (Optional)

If you are paying via credit card, and the billing adress of your credit card is different than the return address you are using, you'll need to provide the credit card billing address for verification.

Use mml configure billing_address to specify the address initially.

Positional Arguments

order_name

This is an arbitrary text string used to name the return address. The MOL system requires order_name to be unique; however, if a duplicate is used, MOL (appears to) append a counter suffix of sorts.

Return Value

If successful the return value will depend on whether the -price_quote flag was used or not.

If it was, then the total cost of the order will be returned.

If it was not, then the order_id assigned by the MOL system is returned. This is an opaque value used to identify the order in subsequent actions (i.e., order details).

An error will be returned if the order upload was not succesful. Possible causes under which an error could be raised include: transient network outages, MOL processor internal errors, incompatible finishing options (i.e., a saddle-stitched postcard), credit card declined, etc.

Notes

There are some restrictions on what type of finishing options are available for certain types of orders. Consult the USPS's Mail Management Language Definition for specific details.