Change log

CRM Orders API

Return or update Order item/s via the public API endpoint.

GET Orders List

Returns a list of order items as a JSON response based on your provided query parameters.

/api/v1/orders

Data / Response:

{
    "fields" : "Status,Member,Discount,GiftVoucher,Tax,ShippingInfo,OrderLines,Payments,CustomCrmGroups",
    "where" : {},
    "order_by" : "Id",
    "offset" : 0,
    "limit" : 100,
}
{
    "Items": [
        {
            "Id": 28057,
            "AWBNumber": null,
            "AmountPaid": 10.00,
            "AmountPending": 0.00,
            "CreatedDateTime": "2022-01-14T09:47:37",
            "CurrencyCountry": "USD/US",
            "Currency": "USD",
            "Country": "US",
            "HasPaidSubscription": false,
            "HasSubscriptions": false,
            "InvoiceDate": "2022-01-14T09:47:37",
            "InvoiceNumber": 65,
            "IsRecurring": false,
            "MainOrderId": null,
            "MemberId": 28049,
            "OrderCaseType": "FormCase",
            "OrderName": "General Payment",
            "PaymentState": "Succeeded",
            "StatusId": 13176,
            "TotalCost": 10.00,
            "TrackingUrl": null,
            "TransactionId": "4X232065C5059574H",            
            "Status" : 
            {
                "Id": 13176,
                "Name": "Paid",
            },
            "Member":
            {
                "Id": 28049,
                "Email": "test@test.com",
                "FirstName": null,
                "LastName": null
            },
            "Discount" : 
            {
                "Code": null,
                "Cost": 0.00,
            },
            "GiftVoucher" : 
            {
                "Name": null,
                "Cost": 0.00,
            },    
            "Tax" : 
            {
                "Code": null,
                "Rate": 0.00,
            },
            "ShippingInfo":
            {
                "Name": null,      
                "Cost": 0.00,
                "Address": null,
                "City": null,
                "State": null,
                "Zipcode": null,        
                "Country": "US"
            },
            "OrderLines": 
            [
                {
                    "Id": 28058,
                    "EntityType": null,
                    "ProductId": null,
                    "ModuleId": null,
                    "ProductName": "General Payment",
                    "Quantity": 1,
                    "TaxRate": 0,
                    "UnitPrice": 10.00,
                    "TotalPrice": 10.00,
                    "FileName": null,
                    "IsDownload": false,
                    "Attributes": []
                }
            ],
            "Payments": 
            [
                {
                    "Id": 28060,
                    "CreatedDateTime": "2022-01-14T11:47:00",
                    "Amount": 2.00,
                    "AmountCaptured": 2.00,
                    "GatewayReason": null,
                    "TransactionId": null,
                    "Status": "Succeeded",
                    "PaymentType": "Cash",
                    "PaymentGatewayType": 0,
                    "Notes": null
                }
            ],
            "CustomCrmGroups": 
            {
                "<GroupAlias1>": 
                {
                    "<FieldAlias1>": "<value>",
                    "<FieldAlias2>": false,
                    "<FieldAlias3>": 0
                }
            }
        }      
    ],
    "TotalItemsCount": 100
}

GET Order Item

Returns a single order item as a JSON response based on your provided ID.

/api/v1/orders/:id

Data / Response:

"N/A"
{
    "Id": 28057,
    "AWBNumber": null,
    "AmountPaid": 10.00,
    "AmountPending": 0.00,
    "CreatedDateTime": "2022-01-14T09:47:37",
    "CurrencyCountry": "USD/US",
    "Currency": "USD",
    "Country": "US",
    "HasPaidSubscription": false,
    "HasSubscriptions": false,
    "InvoiceDate": "2022-01-14T09:47:37",
    "InvoiceNumber": 65,
    "IsRecurring": false,
    "MainOrderId": null,
    "MemberId": 28049,
    "OrderCaseType": "FormCase",
    "OrderName": "General Payment",
    "PaymentState": "Succeeded",
    "StatusId": 13176,
    "TotalCost": 10.00,
    "TrackingUrl": null,
    "TransactionId": "4X232065C5059574H",    
    "Status" : 
    {
        "Id": 13176,
        "Name": "Paid",
    },
    "Member":
    {
        "Id": "28049",
        "Email": "test@test.com",
        "FirstName": null,
        "LastName": null
    },
    "Discount" : 
    {
        "Code": null,
        "Cost": 0.00,
    },
    "GiftVoucher" : 
    {
        "Name": null,
        "Cost": 0.00,
    },    
    "Tax" : 
    {
        "Code": null,
        "Rate": 0.00,
    },
    "ShippingInfo":
    {
        "Name": null,      
        "Cost": 0.00,
        "Address": null,
        "City": null,
        "State": null,
        "Zipcode": null,        
        "Country": "US"
    },
    "OrderLines": 
    [
        {
            "Id": 28058,
            "EntityType": null,
            "ProductId": null,
            "ModuleId": null,
            "ProductName": "General Payment",
            "Quantity": 1,
            "TaxRate": 0,
            "UnitPrice": 10.00,
            "TotalPrice": 10.00,
            "FileName": null,
            "IsDownload": false,
            "Attributes": []
        }
    ],
    "Payments": 
    [
        {
            "Id": 28060,
            "CreatedDateTime": "2022-01-14T11:47:00",
            "Amount": 2.00,
            "AmountCaptured": 2.00,
            "GatewayReason": null,
            "TransactionId": null,
            "Status": "Succeeded",
            "PaymentType": "Cash",
            "PaymentGatewayType": 0,
            "Notes": null
        }
    ],
    "CustomCrmGroups": 
    {
        "<GroupAlias1>": 
        {
            "<FieldAlias1>": "<value>",
            "<FieldAlias2>": false,
            "<FieldAlias3>": 0
        }
    }
}

PUT Order Update

Updates and returns a single order item as a JSON response based on your provided data.

/api/v1/orders/:id

Data / Response:

{
    "Id": 28057,
    "AWBNumber": null,
    "CreatedDateTime": "2022-01-14T09:47:37",
    "Currency": "USD",
    "Country": "US",
    "InvoiceDate": "2022-01-14T09:47:37",
    "InvoiceNumber": 65,
    "MainOrderId": null,
    "MemberId": 28049,
    "OrderName": "General Payment",
    "PaymentState": "Succeeded",
    "StatusId": 13176,
    "TrackingUrl": null
}
{
    "Id": 28057,
    "AWBNumber": null,
    "AmountPaid": 10.00,
    "AmountPending": 0.00,
    "CreatedDateTime": "2022-01-14T09:47:37",
    "CurrencyCountry": "USD/US",
    "Currency": "USD",
    "Country": "US",
    "HasPaidSubscription": false,
    "HasSubscriptions": false,
    "InvoiceDate": "2022-01-14T09:47:37",
    "InvoiceNumber": 65,
    "IsRecurring": false,
    "MainOrderId": null,
    "MemberId": 28049,
    "OrderCaseType": "FormCase",
    "OrderName": "General Payment",
    "PaymentState": "Succeeded",
    "StatusId": 13176,
    "TotalCost": 10.00,
    "TrackingUrl": null,
    "TransactionId": "4X232065C5059574H",    
    "Status" : 
    {
        "Id": 13176,
        "Name": "Paid",
    },
    "Member":
    {
        "Id": "28049",
        "Email": "test@test.com",
        "FirstName": null,
        "LastName": null
    },
    "Discount" : 
    {
        "Code": null,
        "Cost": 0.00,
    },
    "GiftVoucher" : 
    {
        "Name": null,
        "Cost": 0.00,
    },    
    "Tax" : 
    {
        "Code": null,
        "Rate": 0.00,
    },
    "ShippingInfo":
    {
        "Name": null,      
        "Cost": 0.00,
        "Address": null,
        "City": null,
        "State": null,
        "Zipcode": null,        
        "Country": "US"
    },
    "OrderLines": 
    [
        {
            "Id": 28058,
            "EntityType": null,
            "ProductId": null,
            "ModuleId": null,
            "ProductName": "General Payment",
            "Quantity": 1,
            "TaxRate": 0,
            "UnitPrice": 10.00,
            "TotalPrice": 10.00,
            "FileName": null,
            "IsDownload": false,
            "Attributes": []
        }
    ],
    "Payments": 
    [
        {
            "Id": 28060,
            "CreatedDateTime": "2022-01-14T11:47:00",
            "Amount": 2.00,
            "AmountCaptured": 2.00,
            "GatewayReason": null,
            "TransactionId": null,
            "Status": "Succeeded",
            "PaymentType": "Cash",
            "PaymentGatewayType": 0,
            "Notes": null
        }
    ],
    "CustomCrmGroups": 
    {
        "<GroupAlias1>": 
        {
            "<FieldAlias1>": "<value>",
            "<FieldAlias2>": false,
            "<FieldAlias3>": 0
        }
    }
}


Related Articles

  • Site Settings & Management
    Domains

    The Treepl CMS Domain settings allow you to control default domain, landing pages, domain authentication for system emails along with country and cultural settings like number and currency formatting.
  • Site Settings & Management
    Payment Settings

    Integrate various payment gateways, for multiple countries and currencies, into Treepl CMS for form payments, subscriptions and eCommerce workflows.
  • CRM
    Orders

    Orders store accounts of any payments made via the website and provide management for additional payments, invoices, order statuses, tracking info, the products purchased within the order and the details of the form submission used to take the order.
  • CRM
    Advanced CRM Groups

    Advanced CRM Groups allow you to extend the data fields within multiple areas of the CRM, either globally or on a per-record basis.
  • Liquid Objects & Usage
    {{ order }} object

    This liquid object will output the order details of a submitted payment. ...
  • Liquid Components
    module (Catalogs)

    This module component fetches data relating to eCommerce Catalogs and can be used to render Catalog structures and Products within them.
  • Liquid Components
    module (Products)

    This module component fetches data relating to eCommerce Products and can be used to render Product information.
  • Liquid Components
    ecommerce_add_to_cart

    This component renders an anchor element allowing the javascript function to add the item to the shopping cart.
  • Liquid Components
    ecommerce_buy_now

    This component renders an anchor element allowing the javascript function to add the item to the shopping cart and then proceeding directly to the shopping cart page.
  • Liquid Components
    ecommerce_item_quantity

    This component renders a form input element allowing a quantity to be set for when the source item is added to the shopping cart.
  • Liquid Components
    item_attributes

    This component fetches all attributes/options for a specified product. By default, each attribute group is rendered, with its options and any prices, according to their specified form inputs.
  • Liquid Components
    related_items

    This component fetches related items of a specific source item, such as a Product that has had Related Products assign to it.
  • Liquid Components
    grouped_items

    This component fetches grouped items of a specific source item, such as a Product that has been Grouped with other Products and allows the ability to navigate between grouped items.
  • Liquid Components
    currencies

    This component renders a form select element of all currency names, codes and symbols by default, and can also be used to output currency data to a Liquid collection.
  • Liquid Components
    shopping_cart

    This component fetches data relating to the shopping cart, such as any products added, order totals, tax, shipping, etc.
  • Liquid Components
    shipping_options

    This component renders a form select element of all shipping options configured on the site, and can also be used to output shipping option data to a Liquid collection.
  • Liquid Components
    shippingProviderFields

    This component provides a placeholder for populating additional Shipping Provider options to the user.
  • Liquid Components
    tax_codes

    This component renders a form select element of all tax codes configured on the site, and can also be used to output tax code data to a Liquid collection.
  • Liquid Components
    payment_form_fields

    This component is used to render payment fields, and payment related validation errors, within a form using the capabilities provided by your configured payment gateway.
  • Liquid Components
    orders

    This component fetches Orders from the CRM, either owned by the logged-in user or for all customer Orders.
  • eCommerce
    Getting Started

    To get started with the eCommerce module there are some overall settings to configure that provide eCommerce with further context in order to function appropriately for your situation.
  • eCommerce
    Products

    Products are one of the most powerful and flexible modules in Treepl CMS. Create customised product schemas with multiple price points, catalogs, inventory tracked attributes/variables, SEO optimisation and more.
  • eCommerce
    Catalogs

    When organising any eCommerce store, Catalogs are crucial to your Products structure and browserbility. Easily create and customise unlimited product catalogs for your online store.
  • eCommerce
    Discount codes

    Provide discount code functionality for your Treepl CMS shopping cart. Ideal for promotions, customer loyalty and conversions or to help move more stock.
  • eCommerce
    Gift vouchers

    Gift vouchers can be issued to your customers or purchased by them online via the shopping cart.
  • eCommerce
    Taxes

    Create any number of required tax codes specific to the shipping country selected in your Treepl CMS shopping cart.
  • Liquid Components
    countries

    This component renders a form select element of all country names and country codes by default, and can also be used to output country codes/names to a Liquid collection.
  • Liquid Components
    domain_settings

    This module component retrieves settings associated with the current domain, or optionally from another specified domain configured in the site instance.
  • eCommerce
    Shipping Options

    Treepl CMS provides the ability to configure both custom shipping options and integrated shipping providers based on a variety of conditions during the shopping cart stage.
  • eCommerce
    Settings

    These various eCommerce settings allow you to further control and customise the way your website functions, both in the admin and on the front-end, in terms of eCommerce functionality.
  • eCommerce
    eCommerce Javascript

    This is the provided javascript options for further controlling/customising the ecommerce javascript provided by the CMS.
  • Extensions
    Abandoned Cart Recovery

    With Abandoned Cart Recovery functionality, you can automatically send email reminders to customers who add products to their cart (while logged in) and leave without completing the order.
  • Extras
    Migrating to Advanced Payment Flow

    This article describes differences and possible required actions for migrating to the Advanced Payment Gateway flow.

External Resources

There are currently no external resources available.

Please let us know if you have any other contributions or know of any helpful resources you'd like to see added here.


Questions?

We are always happy to help with any questions you may have.
Visit the Treepl Forum for community support and to search previously asked questions or send us a message at support@treepl.co and we will consult you as soon as possible.