OrdersLast updated: 2020-06-09

An order is a customer's completed request to purchase one or more products from the online store.

What you can do with an Order:
Order Properties
Property Description
OID "OID":  12321
The marketAgility ID for the order
UserID "UserID":  34543
The marketAgility ID for the registered user that placed thie order (if available)
SiteID "SiteID":  1
The marketAgility ID for the site
Created "Created":  "2019-04-21T12:43:12"
The date the order was placed
Modified "Modified":  "2020-05-12T08:03:00"
The date the order was last modified
OrderNumber "OrderNumber":  "TEST0001"
The customer-friendly order number
LanguageCode "LanguageCode":  ""
The language the customer was using when the order was placed. Note: This is only populated if the language is different from the base site language
FullName "FullName":  "Bob Smith"
The full name of the customer
Email "Email":  "[email protected]"
The email of the customer
ExternalOrderNumber "ExternalOrderNumber":  "AMZ-1234"
The order number in the source system (if the order was placed through an affiliate such as Amazon or eBay)
IPAddress "IPAddress":  "127.0.0.1"
The IP address of the customer (if available)
OrderState "OrderState":  1
Status of the order (1 = New, 6 = Reviewing, 7 = Verifying, 9 = Processing, 10 = Complete, 21 = Cancelled)
Total "Total":  0.0000
The total for this order
SubTotal "SubTotal":  0.0000
The merchandise subtotal for this order
TotalShipping "TotalShipping":  0.0000
The total shipping charge for this order
TotalServices "TotalServices":  0.0000
The total services charge for this order
TotalTaxes "TotalTaxes":  0.0000
The total tax charge for this order
TotalDiscount "TotalDiscount":  0.0000
The total discounts for this order
SourceCode "SourceCode":  ""
The source code for the order (if used)
PromoCode "PromoCode":  ""
The promotion code for the order (if used)
CustomerNumber "CustomerNumber":  "1432"
The user's customer number
Incentives "Incentives":  "FREESHIP,20% Off"
A list of incentives used on the order
EmployeeNumber "EmployeeNumber":  ""
The Employee number that assisted the order (if provided)
StoreLocation "StoreLocation":  ""
The Store number from where the order was placed (if provided)
OrderSource "OrderSource":  ""
The source of the order (Normal, CallCenter, Amazon, ThirdParty, International)

Get Order

Gets a single order by Id

GET /api/v3/orders/12321

HTTP/1.1 200 OK
{
            "OID": 12321,
            "UserID": 0,
            "SiteID": 0,
            "Created": "0001-01-01T00:00:00",
            "Modified": "0001-01-01T00:00:00",
            "OrderNumber": "TEST1234",
            "LanguageCode": "EN",
            "FullName": "Bob Smith",
            "Email": "[email protected]",
            "ExternalOrderNumber": "",
            "IPAddress": "127.0.0.1",
            "OrderState": 1,
            "Total": 33.1900,
            "SubTotal": 23.9900,
            "TotalShipping": 8.0000,
            "TotalServices": 0.0000,
            "TotalTaxes": 1.2000,
            "TotalDiscount": 0.0000,
            "SourceCode": "",
            "PromoCode": "",
            "Incentives": [],
            "EmployeeNumber": "",
            "StoreLocation": "",
            "OrderSource": 0,
}

List Order Shipment Addresses

Retrieves a list of shipping addresses for an order.

GET /api/v3/orders/12321/shipments

HTTP/1.1 200 OK
[
   {
            "OID": 12321,
            "Alias": "Work",
            "FirstName": "Bob",
            "MiddleName": "",
            "LastName": "Smith",
            "FullName": "Bob Smith",
            "Company": "Virid, Inc",
            "Address": "12005 Sunrise Valley Drive",
            "Address2": "Suite 400",
            "City": "Reston",
            "StateOrProvince": "VA",
            "PostalCode": "20147",
            "Country": "US",
            "Phone": "7036892121",
            "Fax": "",
            "MobilePhone": "",
            "StoreNumber": "",
            "Email": "[email protected]",
            "ShipType": "STD",
            "ShipDescription": "STD",
            "ShipInstructions": "STD",
            "ShipCharge": 0.000,
            "TotalTax": 0.000,
            "TotalCounty": 0.000,
            "TotalCity": 0.000,
            "TotalState": 0.000,
            "TotalDistrict": 0.000,
            "DestinationType": "Business",
            "NoSplitShip": false,
            "ProcessorMessage": "",
            "CarrierCode": "UPS"
   }
]

Acknowledge Order

Aknowledges a single order

POST /api/v3/orders/12321/acknowledge

HTTP/1.1 204 No Content

Metadata

Metadata are custom elements added to and order to aid in integrating with 3rd party systems, or to simply collect additional information not available in a standard order record.

What you can do with Metadata:
Metadata Properties
Property Description
OID "OID":  12321
The marketAgility ID for the metadata element
Group "Group":  My Group
The group name for the metadata element
Name "Name":  MyName
The name for the metadata element
Value "Value":  MyValue
The value for the metadata element

List Metadata

List all metadata elements for the order.

GET /api/v3/orders/{order_oid}/metadata

HTTP/1.1 200 OK
[
   {
            "OID": 12321,
            "Group": "MyGroup",
            "Name": "MyName",
            "Value": "MyValue",
   }
]

Get Metadata

Retrieves a metadata element by its ID.

GET /api/v3/orders/{order_oid}/metadata/{metadata_oid}

HTTP/1.1 200 OK
 {
            "OID": 12321,
            "Group": "MyGroup",
            "Name": "MyName",
            "Value": "MyValue",
   }

Creates a Metadata element

Creates a metadata element for an order

POST /api/v3/orders/{order_oid}/metadata
{
    "Group": "MyGroup",
    "Name": "MyName",
    "Value": "MyValue",
}

HTTP/1.1 200 OK
 {
            "OID": 456,
            "Group": "MyGroup",
            "Name": "MyName",
            "Value": "MyValue",
   }

Updates a Metadata element

Creates a metadata element for an order

PUT /api/v3/orders/{order_oid}/metadata/{metadata_oid}
{
    "Group": "MyGroup",
    "Name": "MyName",
    "Value": "MyValue",
}

HTTP/1.1 204 No Content

Deletes a Metadata element

Creates a metadata element for an order

DELETE /api/v3/orders/{order_oid}/metadata/{metadata_oid}

HTTP/1.1 204 No Content

Notes

Notes are supplemental content created by people or systems as they make changes to the order. Examples might be the Fraud Screen system putting the order on hold for a particular reason, a CSR changing the price on an order in the cash register, or an agent issuing an appeasement credit.

What you can do with Notes:
Notes Properties
Property Description
OID "OID":  12321
The marketAgility ID for the note
OrderId "OrderId":  3421
The marketAgility Order Id that this note goes with
Author "Author":  "Phillip Agent"
The person or system that created the note
Code "Code":  "FraudScreen"
The code for the note. Can be any Alpha string
Content "Content":  "Order held for fraud rule: Total over $500"
The full text of the note

List Notes

List all notes for the order.

GET /api/v3/orders/{order_oid}/notes

HTTP/1.1 200 OK
[
   {
            "OID": 12321,
            "OrderId": 34543",
            "Created": "2023-02-22T16:22:12.947",
            "Author": "Phillip Agent",
            "Code": "CallCenter",
            "Content": "Order held for fraud rule: Total over $500",
   }
]

Get Note

Retrieves a note by its ID.

GET /api/v3/orders/{order_oid}/notes/{note_oid}

HTTP/1.1 200 OK
 {
            "OID": 12321,
            "OrderId": 34543",
            "Created": "2023-02-22T16:22:12.947",
            "Author": "Phillip Agent",
            "Code": "CallCenter",
            "Content": "Order held for fraud rule: Total over $500",
   }

Creates a Note

Creates a note for an order

POST /api/v3/orders/{order_oid}/notes
{
    "Code": "MyCode",
    "Content": "This is a note"
}

HTTP/1.1 200 OK
 {
            "OID": 12321,
            "OrderId": 34543",
            "Created": "2023-02-22T16:22:12.947",
            "Author": "Phillip Agent",
            "Code": "MyCode",
            "Content": "This is a note",
   }

Updates a Note

Creates a note for an order

PUT /api/v3/orders/{order_oid}/notes/{note_oid}
{
    "Code": "MyCode",
    "Content": "This is a note"
}

HTTP/1.1 204 No Content

Shipments

A Shipment is a transaction that indicates the shipping of one or more items on an order.

What you can do with Shipments:
Shipment Properties
Property Description
OID "OID":  12321
The marketAgility ID for the shipment transaction
OrderID "OrderID":  12321
The marketAgility ID for the order
OrderNumber "OrderNumber":  TEST0001
The customer-friendly order number
ShipmentID "ShipmentID":  12321
The marketAgility ID for the referenced order shipment
Total "Total":  0.0000
The total for this shipment transaction
SubTotal "SubTotal":  0.0000
The merchandise subtotal for this shipment transaction
TotalShipping "TotalShipping":  0.0000
The total shipping charge for this shipment transaction
TotalServices "TotalServices":  0.0000
The total services charge for this shipment transaction
TotalTaxes "TotalTaxes":  0.0000
The total tax charge for this shipment transaction
TotalDiscount "TotalDiscount":  0.0000
The total discounts for this shipment transaction
ShipmentDate "ShipmentDate":  2016-05-12T17:57:05.147
The date and time of this transaction
CarrierCode "CarrierCode":  "UPS"
The SCAC code of the carrier
CarrierService "CarrierService":  "UPSNextDay"
The carriers's service designation that was used for this shipment
ShipSource "ShipSource":  ""
The source of the shipment
TrackingNumber "TrackingNumber":  "Z123212321123"
The carrier tracking number for the shipment
ShippingLabelUrl "ShippingLabelUrl":  ""
Url to a printable shipping label (if provided by carrier)
Items "Items":  "[<OrderItem>]"
An array of order items included in this shipment

Get Shipment

Retrieves a shipment by its ID.

GET /api/v3/shipments/12321

HTTP/1.1 200 OK
{
            "OID": 12321,
            "OrderId": 45654,
            "OrderNumber": "TEST00001",
            "ShipmentId": 56765,
            "Total": 0.000,
            "SubTotal": 0.000,
            "TotalShipping": 0.000,
            "TotalServices": 0.000,
            "TotalTaxes": 0.000,
            "TotalDiscount": 0.000,
            "ShipmentDate": "2016-05-12T17:57:05.147Z",
            "CarrierCode": "UPS",
            "CarrierService": "UPSNextDay",
            "ShipSource": "Smith",
            "TrackingNumber": "Z12321232123",
            "ShippingLabelUrl": "",
            "Items": <Items> []
}

Creates a Shipment

Creates a shipment for an order and bills the customer if necessary

POST /api/v3/shipments
{
    "OrderNumber": "TEST0001",
    "ShipmentId": 12321,
    "ShipmentDate": "2016-05-12T21:57:05",
    "CarrierCode": "UPS",
    "TrackingNumber": "Z1232132132",
    "ShippingLabelUrl": "https://lablels.ups.com/Z1232132132",
    "Products": [
        {
            "ItemId": 123212
        },
        {
            "ItemId": 23432
        }
    ]
}

HTTP/1.1 204 No Content

Cancellations

A Cancellation is a transaction that indicates that one or more items have been cancelled and will not be shipped to the customer or billed.

If the merchant has opted to use bill up front payments, a cancellation will triggere a credit to the customer for the amount representative of the cancelled items.

What you can do with a Cancellation:
Cancellation Properties
Property Description
OID "OID":  12321
The marketAgility ID for the cancel transaction
OrderID "OrderID":  12321
The marketAgility ID for the order
OrderNumber "OrderNumber":  TEST0001
The customer-friendly order number
CancelDate "CancelDate":  2016-05-12T17:57:05.147
The date and time of this transaction
Total "Total":  0.0000
The total credit for this cancel transaction
Price "Price":  0.0000
The merchandise credit for this cancel transaction
Tax "Tax":  0.0000
The merchandise tax credit for this cancel transaction
Shipping "Shipping":  0.0000
The shipping credit for this cancel transaction
Shipping Tax "ShippingTax":  0.0000
The shipping tax credit for this cancel transaction
Services "Services":  0.0000
The services credit for this cancel transaction
Services Tax "ServicesTax":  0.0000
The services tax credit for this cancel transaction
Items "Items":  "[<CancellationItem>]"
An array of items included in this cancel transaction

Get Cancellation

Retrieves a cancellation by its ID.

GET /api/v3/cancellations/12321

HTTP/1.1 200 OK
   {
            "OID": 12321,
            "OrderId": 45654,
            "CancelDate": "2016-05-12T17:57:05.147Z",
            "OrderNumber": "TEST00001",
            "Price": 0.000,
            "Tax": 0.000,
            "Shipping": 0.000,
            "ShippingTax": 0.000,
            "Services": 0.000,
            "ServicesTax": 0.000,
            "Total": 0.000,
            "Items": <Items> [],

   }

List Cancellations

Lists all cancellations for an order.

GET /api/v3/orders/12321/cancellations?OrderId=12321

HTTP/1.1 200 OK
[
   {
            "OID": 12321,
            "OrderId": 45654,
            "CancelDate": "2016-05-12T17:57:05.147Z",
            "OrderNumber": "TEST00001",
            "Price": 0.000,
            "Tax": 0.000,
            "Shipping": 0.000,
            "ShippingTax": 0.000,
            "Services": 0.000,
            "ServicesTax": 0.000,
            "Total": 0.000,
            "Items": <Items> [],

   }
]

Creates a Cancellation

Creates a cancellation associated with an order and issues any necessary credits.

POST /api/v3/cancellations
{
    "OrderNumber": "TEST0000212",
    "CancelDate": "06/24/2020",
    "Products": [
        {
            "ItemID": 389196,
            "ReasonCode": "OOS",
            "Reason": "Out of Stock"
        }
    ]
}

HTTP/1.1 204 No Content

Returns

A Return is a transaction that indicates the customer has returned one or more items on an order.

What you can do with a Return:
Return Properties
Property Description
OID "OID":  12321
The marketAgility ID for the return
OrderID "OrderID":  45678
The marketAgility ID for the order
ReturnDate "ReturnDate":  "2020-06-25T23:56:03.493"
The date and time the appeasement was placed
OrderNumber "OrderNumber":  "TEST123"
The customer-friendly order number
Price "Price": 19.99  
The price of the product
Tax "Tax": 1.00  
The tax on the order
Shipping "Shipping": 0.0  
The shipping price for the order
ShippingTax "ShippingTax": 0.00  
The shipping tax on the order
Total "Total": 20.99  
The total price of the order
Items "Items":  "[<OrderItem>]"
An array of order items included in this return

Get Return

Retrieves a return by its ID.

GET /api/v3/returns/1232

HTTP/1.1 200 OK
   {
            "OID": 1232,
            "OrderID": 535994,
            "ReturnDate": "2020-06-24T00:00:00Z",
            "RMA": null,
            "OrderNumber": "TEST123",
            "Price": 19.99,
            "Tax": 1.0,
            "Shipping": 0.0,
            "ShippingTax": 0.0,
            "Total": 20.99,
            "Items": <Items> []
   }

List Returns

Lists all returns for an order.

GET /api/v3/orders/12321/returns

HTTP/1.1 200 OK
[
   {
            "OID": 5421,
            "OrderID": 12321,
            "ReturnDate": "2020-06-24T00:00:00Z",
            "RMA": null,
            "OrderNumber": "TEST123",
            "Price": 19.99,
            "Tax": 1.0,
            "Shipping": 0.0,
            "ShippingTax": 0.0,
            "Total": 20.99,
            "Items": <Items> []
   }
]

Creates a Return

Creates a return associated with a customer's order, issuing any necessary credits.

POST /api/v3/returns
{
    "OrderNumber": "TEST0000222",
    "ReturnDate": "06/24/2020",
    "Products": [
        {
            "itemID": 389223
        }
    ]
}

HTTP/1.1 201 Created
{
            "OID": 12321,
            "Alias": "Work",
            "FirstName": "",
            "MiddleName": "",
            "LastName": "",
            "FullName": "",
            "Company": "",
            "Address": "123 Testing Avenue",
            "Address2": "",
            "City": "Reston",
            "StateOrProvince": "VA",
            "PostalCode": "20191",
            "Country": "US",
            "Phone": "",
            "Fax": "",
            "MobilePhone": "",
            "Email": "",
            "ShipType": "",
            "DestinationType": ""
}

Appeasements

An Appeasement is a transaction that indicates the customer has received a credit from the merchant.

What you can do with an Appeasement:
Appeasement Properties
Property Description
OID "OID":  12321
The marketAgility ID for the appeasement
OrderID "OrderID":  45678
The marketAgility ID for the order
AppeasementDate "AppeasementDate":  "2020-06-25T23:56:03.493"
The date and time the appeasement was placed
OrderNumber "OrderNumber":  "TEST123"
The customer-friendly order number
Price "Price": 24.99  
The price of the product
Tax "Tax": 0.00  
The tax on the order
Shipping "Shipping": 0.00  
The shipping price for the order
ShippingTax "ShippingTax": 0.00  
The shipping tax on the order
Total "Price": 24.99  
The total price of the order
Items "Items":  "[<OrderItem>]"
An array of order items included in this appeasement

Get Appeasement

Retrieves an appeasement by its ID.

GET /api/v3/appeasements/12321

HTTP/1.1 200 OK
{
            "OID": 12321,
            "OrderID": 456,
            "AppeasementDate": "2020-06-24T00:00:00Z",
            "OrderNumber": "TEST123",
            "Price": 24.99,
            "Tax": 1.0,
            "Shipping": 0.0,
            "ShippingTax": 0.0,
            "Total": 25.99,
            "Items": <Items> []
}

List Appeasement

Lists all appeasements for an order.

GET /api/v3/orders/12321/appeasements

HTTP/1.1 200 OK
[
   {
            "OID": 5421,
            "OrderID": 12321,
            "AppeasementDate": "2020-06-24T00:00:00Z",
            "OrderNumber": "TEST123",
            "Price": 19.99,
            "Tax": 1.0,
            "Shipping": 0.0,
            "ShippingTax": 0.0,
            "Total": 20.99,
            "Items": <Items> []
   }
]

Creates an Appeasement

Creates an appeasement for an order and issues any necessary credits

POST /api/v3/appeasements
{
    "OrderNumber": "TEST0000217",
    "appeasementDate": "06/24/2020",
    "Products": [
        {
            "itemID": 389207,
            "ReasonCode": "tax error"
        }
    ]
}

HTTP/1.1 204 No Content