Helcim Logo Support & Tutorials

© Copyright 2006-2019 Helcim Inc.

All Rights Reserved.

Helcim Commerce API » Orders »

Add or Edit an Order

This API call let's you add or edit an order. The response is an XML of the add/edit order action.

Request Fields

Field Name Type Required Description
action String Yes orderEdit
accountId Integer Yes The Helcim Commerce account ID.
apiToken String Yes API token used for authentication and access control. 
orderNumber String No The order number. If it's entered then you are editing an order. If it is not entered then you are adding a new order.
dateIssed String No The date the order was issued.
datePaid String No The date the order was paid.
currency String No The currency of the order's price.
status String No Due, paid, shipped, completed, refunded, cancelled.
paymentTerms Integer No The number of days the customer has to pay for the order.
comments String No Comments about the order. 
customerCode String No The customer code.
billing_contactName String No The the billing address contact name.
billing_businessName String No The billing address business name.
billing_street1 String No The billing street address.
billing_street2 String No The billing street address.
billing_city String No The billing city.
billing_province String No The billing province.
billing_country String No The billing country.
billing_postalCode String  No The billing postal code.
billing_phone String No The billing phone number.
billing_fax String No The billing fax number
billing_email String  No The billing email.
shipping_contactName String No The shipping contact name.
shipping_businessName String No The shipping business name.
shipping_street1 String No The shipping street address.
shipping_street2 String No The shipping street address.
shipping_city String No  The shipping city.
shipping_province String No The shipping province.
shipping_country String No The shipping country.
shipping_postalCode String No The shipping postal code.
shipping_phone String No The shipping phone number.
shipping_fax String No The shipping fax number.
shipping_email String No The shipping email address.
amount Decimal No Amount to process. Must include two decimal places, and must NOT include $.
amountShipping Decimal No The shipping cost.
amountTax Decimal No The tax.
amountTip Decimal No The tip.
amountDiscount Decimal No The discount.
shippingMethod String No The method of shipping.
taxDetails String  No Information about the applicable taxes.
discountDetails String No Information about the applicable discounts.
Order Information
NOTICE: For all item variables replace "#" with a unique item number (starting at 1, and increasing by 1 for each unique item added).
itemSKU# Integer No The sku.
itemDescription# String No The item description.
itemSerialNumber# String No The item serial number.
itemQuantity# Decimal No Item quantity, must be at least one for item to be added.
itemPrice# Decimal No The item price.
itemTotal# Decimal No The item price x the quantity.

Response Fields (XML)

Field Name Type Description
message - XML structure
response Integer 1 or 0. Whether the order was added/edited or not.
responseMessage String Confirmation of completed action.
order - XML structure
orderNumber String The order number.
token String The order token.
amount Decimal Amount to process. Must include two decimal places, and must NOT include $.
currency String The currency of the order's price.
status String The status of the order (paid/unpaid).
dateCreated String The date the order was created.
dateIssued String The date the order was issued.
datePaid String The date the order was paid.


For all API requests, there are also generic API authentication and user access restriction errors.
Response Code Error Code Message Description
0 - Invalid Order Number The order number is invalid.
0 - Failed Saving Order The order was not saved.

Code Samples

Sample Add/Edit an Order Response XML

<?xml version="1.0"?>
    <responseMessage>Order Updated</responseMessage>
        <dateCreated>2017-06-16 14:47:43</dateCreated>
        <dateIssued>2017-06-16 00:00:00</dateIssued>
        <datePaid>2017-06-16 15:24:36</datePaid>

HTML Form Sample HTML

<input type="hidden" name="accountId" value="YOUR-ACCOUNT-ID">
<input type="hidden" name="apiToken" value="YOUR-API-TOKEN">
<input type="hidden" name="action" value="orderView">
<input type="hidden" name="orderNumber" value="ORDR11464">
<input type="hidden" name="dateIssued" value="2017-06-16 14:40:00">
<input type="hidden" name="datePaid" value="2017-06-16 15:40:00">
<input type="hidden" name="currency" value="CAD">
<input type="hidden" name="status" value="PAID">
<input type="hidden" name="paymentTerms" value="30">
<input type="hidden" name="comments" value="Sold">
<input type="hidden" name="customerCode" value="12A1168">
<input type="hidden" name="billing_contactName" value="John Smith">
<input type="hidden" name="billing_businessName" value="Helcim">
<input type="hidden" name="billing_street1" value="123 Home Street">
<input type="hidden" name="billing_street2" value="123 Home Street">
<input type="hidden" name="billing_city" value="Calgary">
<input type="hidden" name="billing_province" value="Alberta">
<input type="hidden" name="billing_country" value="Canada">
<input type="hidden" name="billing_postalCode" value="T2H1K7">
<input type="hidden" name="billing_phone" value="877-643-5246">
<input type="hidden" name="billing_fax" value="866-469-3077">
<input type="hidden" name="billing_email" value="info@helcim.com">
<input type="hidden" name="shipping_contactName" value="John Smith">
<input type="hidden" name="shipping_businessName" value="Helcim">
<input type="hidden" name="shipping_street1" value="123 Home Street">
<input type="hidden" name="shipping_street2" value="123 Home Street">
<input type="hidden" name="shipping_city" value="Calgary">
<input type="hidden" name="shipping_province" value="Alberta">
<input type="hidden" name="shipping_country" value="Canada">
<input type="hidden" name="shipping_postalCode" value="T2H1K7">
<input type="hidden" name="shipping_phone" value="877-643-5246">
<input type="hidden" name="shipping_fax" value="866-469-3077">
<input type="hidden" name="shipping_email" value="info@helcim.com">
<input type="hidden" name="amount" value="30.00">
<input type="hidden" name="amountShipping" value="4.95">
<input type="hidden" name="amountTax" value="1.50">
<input type="hidden" name="amountTip" value="2.50">
<input type="hidden" name="amountDiscount" value="0.50">
<input type="hidden" name="shippingMethod" value="UPS">
<input type="hidden" name="taxDetails" value="10% Tax">
<input type="hidden" name="discountDetails" value="Friends and family discount">
<input type="hidden" name="itemSKU1" value="123654">
<input type="hidden" name="itemDescription1" value="Beach bags">
<input type="hidden" name="itemSerialNumber1" value="10210412905B">
<input type="hidden" name="itemQuantity1" value="2.0">
<input type="hidden" name="itemPrice1" value="12.99">
<input type="hidden" name="itemTotal1" value="25.98">