If_ECommerceCustomer
ECommerceCustomer interface provides commands to manage creation and updating
of ecommerce customer records
|
| getcustid | | Returns the customer ID |
|
| getempid | | Returns the emp_id of a given addressnum |
|
| initialize | | This command loads an e-commerce customer based on their login name, or
initializes the record for a new customer. Returns 'yes' if an existing
customer was loaded, or 'no' if not. Returns 'error:...' if an error
occurs. | | | | Arguments: | | loginname - Login name (if not present, new customer) | | cust_id - Customer ID (used instead if present) | | usesession - Use session? no/yes/strict (default=no) | | owner_id - Owner ID of this customer (required) | | | | If usesession=strict, this will fail if there's no cust id in the session | | To use loginname usesession must be 'no'. |
|
| checkpassword | | This command checks the password of the loaded customer | | | | Arguments: | | password - The plaintext password to test (will always return 'no' if this is not specified.) | | | | Returns 'yes' or 'no'. |
|
| checkpermlevel | | This command checks the permission level of the loaded customer against a passed number | | | | Arguments: | | emp_perm - Has to be at least this permission level number | | | | Returns 'yes' or 'no'. |
|
| nextaddr | | Moves to next address. Returns 'yes' or 'no' depending on whether there is another address. |
|
| rewindaddresslist | | Rewinds address list |
|
| Commands for printing/returning various pieces of information from addresses
The 'addressnum' argument specifies which address; if it isn't present
then the address counter is used. |
|
| getfname | | Returns first name |
|
| getmname | | Returns middle name |
|
| getlname | | Returns last name |
|
| getaddr1 | | Returns address line 1 |
|
| getaddr2 | | Returns address line 2 |
|
|
|
|
| getphone | | Returns phone number |
|
|
| getcell | | Returns cell phone number |
|
| getpager | | Returns pager phone number |
|
| getemail | | Returns email address |
|
| getpageremail | | Returns pager email address |
|
| gettitle | | Returns person's title |
|
| getcountry | | Returns country |
|
|
| gettollfree | | Returns employee toll free number |
|
| getlinkedempid | | Returns linked employee id |
|
| getcliid | | Returns client id |
|
| getownerid | | Returns owner id |
|
| getcliname | | Returns client name |
|
| getempnotes | | Returns employee notes |
|
| getempperm | | Returns employee permissions |
|
| getownername | | Returns owner name |
|
| templateaddresslist | | This command lists all addresses based on a template. | | | | Arguments: | | template - Template format as below (required) | | startat - Start counter (default=0) | | count - Number to output (default=all) | | | | Template replacable macros: | | ##ADDR1## - Address line #1 | | ##ADDR2## - Address line #2 | | ##ATTN## - Attn to: | | ##CELL## - Cellular phone number | | ##CITY## - City | | ##COUNTRY## - Country | | ##EMAIL## - E-Mail address | | ##FAX## - Fax phone number | | ##FNAME## - First name | | ##MNAME## - Middle name | | ##LNAME## - Last name | | ##PAGER## - Pager phone number | | ##PAGEREMAIL## - Pager email address | | ##PHONE## - Main phone number | | ##STATE## - 2-letter state code | | ##SSL## - State as options list | | ##CSL## - Countries as options list | | ##TITLE## - Title or salutation | | ##TOLLFREE## - Toll free phone number | | ##ZIP## - Zip code | | ##ADDRESSNUM## - Which address is this? | | ##ALT## - Alternates between 1 and 0 | | ##NOTES## - emp_notes field | | ##EMP_PERM## - emp_perm field | | | | Returns 'ok' or 'error:...' |
|
| checkloginexists | | Checks to see if a particular login name 'login' exists | | Returns 'yes' or 'no' |
|
| addupdateaddress | | This command creates a new address and adds it to the end of the address
list or updates an existing address. (Nothing is committed to the
database yet) | | | | Optional arguments (all the fields default to empty): | | addressnum - If this is present, an existing address is updated | | fname - First name | | mname - Middle name | | lname - Last name | | addr1 - Address line #1 | | addr2 - Address line #2 | | city - City | | state - 2-letter state code | | zip - Zip code | | phone - Phone number | | fax - Fax number | | cell - Cellular phone number | | pager - Pager number | | tollfree - Toll free phone number | | email - Email address | | pageremail - Pager email address | | title - Title (mr, ms, etc.) | | country - Country of residence | | attn - Attn to: | | linked_emp_id - linked_emp_id | | notes - employee notes | | | | Returns the addressnum of the new address unless an error occurs. |
|
| deleteaddressnum | | Deletes a given address number | | | | Arguments: | | addressnum - Addressnum to delete (default=last) | | truncate - If this is true, delete all addresses after addressnum (default=false) | | | | Does nothing if addressnum doesn't exist. |
|
| commit | | Commits data to database | | Returns 'ok' or 'error:...' |
|
| getaddressrecordid | | Prints/returns the actual record ID for an address 'addressnum' (dfl=0) | | Returns 0 if addressnum is out of range. |
|
| setlogininfo | | Sets login and password | | | | Arguments: | | login - Login name (required) | | password - Password in plaintext (required) | | encrypt - Scramble password with SHA1? (default=false) | | | | Returns 'ok' or 'error:...' |
|
| setclient | | Sets cli_id value | | | | Arguments: | | cli_id - cli_id to be set (required) | | setall - if yes then set all contacts to new cli_id, otherwise just set primary (optional) | | | | Returns 'ok' or 'error:...' |
|
| setperm | | Sets emp_perm value | | | | Arguments: | | emp_perm - emp_perm level to be set (required) | | | | Returns 'ok' or 'error:...' |
|
| setpreference | | Sets an emp_preference property | | | | Arguments: | | key - key to be set (required) | | value - value to be set (required) | | | | Returns 'ok' or 'error:...' |
|
| setpreferences | | Sets emp_preferences value | | | | Arguments: | | emp_preferences - emp_preferences level to be set (required) | | | | Returns 'ok' or 'error:...' |
|
| setemail | | Sets emp_email value | | | | Arguments: | | emp_email - emp_email level to be set (required) | | | | Returns 'ok' or 'error:...' |
|
| takeorderownership | | This command causes this customer to take 'ownership' of an order. | | | | Arguments: | | order - Actual order object (this is used instead of ord_id if present) | | ord_id - Either this or 'order' is required | | resetcartstatus - Set this order's cart status to 'no'? (default=true) | | billingaddressnum - Addressnum for billing (optional) | | shippingaddressnum - Addressnum for shipping (optional) | | ordertype - 'purchase', 'purrelease', 'sales', or 'salesrelease' (default=sales) | | | | This is typically used to turn a cart into a real order when the order is
finally complete and submitted. This can also be used to save a cart,
since if a cart is owned (cli_id > 0) it won't be cleaned out. | | | | It is perfectly ok to call this more than once to update the information
in the order to say.. change the shipping and billing address. | | | | Returns 'ok' or 'error:...' |
|
| getpassword | | Returns the password of this customer or 'SHA1' if it's encrypted. | | Returns null if there's no password or no customer loaded |
|