Skip to main content

Order

Status: Trusted Tester

An order records a sale to a business location. For example requests see the Sales guide.

idstring
Example: AG-1234:ORD-1234567
typestring

Possible values: [orders]

Default value: orders
attributes object
currencyCodestring

The 3 letter currency code as defined by ISO 4217

Possible values: >= 3 characters and <= 3 characters

Example: CAD
lineItems object[]
  • Array [
  • skustringrequired

    The unique identifier of a product, product edition or package. It can be obtained by following this guide.

    Default value:
    Example: A-123
    typestring
    Default value: lineItem
    Example: lineItem
    quantityinteger

    The number of units to ordered

    Default value: 1
    amountinteger

    The unit price in cents. If not provided the default price for this sku in the marketplace will be used.

    Default value: 0
    intervalCodestring

    The billing frequency

    Possible values: [onetime, monthly, yearly, ``]

    isPackageboolean

    Indicates if this lineitem is a package instead of a product or an addon.

    containedInPackagestring

    Holds the SKU of the package that this lineitem is part of. Products inside of a package do not have pricing so refer to the lineitem of the package SKU to find the price.

    Default value:
    Example: MP-123:EDITION-123
  • ]
  • statusCodestring

    The status of the order will be automatically set to one of the following by the system:

    • draft: The order has not yet been sent for approval
    • submitted: The order is ready for approval
    • processing: The order and its items are being processed
    • declined: The order has been declined by an admin or a customer
    • fulfilled: The order and its items have been successfully processed. This includes activating the products with the vendor(s).
    • error: One or more of the orders items failed to be processed
    • archived: The order has been marked as archived
    • NotReady: The order could not be created as a dependent resource is not yet ready to be used

    Possible values: [draft, submitted, processing, declined, fulfilled, error, archived, NotReady]

    Default value: processing
    tagsstring[]

    A tag is a label that can be used for grouping and filtering your list of orders. They may be any string upto 30 characters in length.

    Possible values: <= 30

    notesstring

    Free-text notes associated with the order.

    relationships object
    businessLocation object

    Required during creation: The business location the order is for

    data objectrequired
    idstringrequired
    Example: AG-1234567
    typestringrequired

    Possible values: [businessLocations]

    Default value: businessLocations
    salesPerson object

    The user who will be credited with the sale. Used to associate orders with salespersons in reports.

    Note the user must have the salesperson role.

    data objectrequired
    idstringrequired
    Example: U-1234567
    typestringrequired

    Possible values: [users]

    Default value: users
    Order
    {
    "id": "AG-1234:ORD-1234567",
    "type": "orders",
    "attributes": {
    "currencyCode": "CAD",
    "lineItems": [
    {
    "sku": "A-123",
    "type": "lineItem",
    "quantity": 1,
    "amount": 0,
    "intervalCode": "onetime",
    "isPackage": true,
    "containedInPackage": "MP-123:EDITION-123"
    }
    ],
    "statusCode": "processing",
    "tags": [
    "string"
    ],
    "notes": "string"
    },
    "relationships": {
    "businessLocation": {
    "data": {
    "id": "AG-1234567",
    "type": "businessLocations"
    }
    },
    "salesPerson": {
    "data": {
    "id": "U-1234567",
    "type": "users"
    }
    }
    }
    }