$orderby Parameter

The interworks.cloud Platform API provides ordering options on all basic methods that return a collection of resources using the $orderby parameter. The Ordering of Collections enables sorting of resources in a collection given certain criteria and priorities.

The value of the $orderby parameter contains a comma-separated list of property names to sort by.

The property name may include the suffix asc for ascending or desc for descending order, separated from the property name by one or more spaces.

If asc or desc is not specified, the service will order by the specified property in ascending order.

The following table contains some common use cases of $orderby parameter

Query DescriptionExample
Get accounts ordered by created date/api/accounts?$orderby=createdAt
Get accounts ordered by created date in descending order/api/accounts?$orderby=createdAt desc
Get products ordered by last update date in descending order/api/products?$orderby=updatedAt desc
Get contacts order by account name, then last name and first name/api/contacts?$orderBy=accountname,lastname,firstname
Get contacts order by account name in descending order, then last name and first name/api/contacts?$orderBy=accountname desc,lastname,firstname

Ordering Criteria

Accounts ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/accounts are:

PropertyDescription
nameAccount’s name
codeAccount’s code
emailAccount’s email
creditLimitAccount’s credit limit
createdAtAccount’s created date
updatedAtAccount’s updated date

Assets ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/assets are:

PropertyDescription
billingToName Asset’s bill to account name
createdAtAsset’s created date
customerNameAsset’s customer name
nameAsset’s name
productName Asset’s product name
updatedAtAsset’s updated date

Contacts ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/contacts are:

PropertyDescription
firstName Contact’s first name
lastName Contact’s last name
createdAtContact’s created date
updatedAtContact’s updated date

Documents ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET/api/files/folders are:

NameTypeDescriptionExample
idintSorts the request response by the Id field./api/files/folders?$orderby=id
NamestringSorts the request response by the Name field./api/files/folders?$orderby=name

Invoices ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/invoices are:

PropertyDescription
codeInvoice’s code
status Invoice’s status
billingToName Invoice’s bill to account name
invoiceDate Invoice’s date
dueDate Invoice’s due date
createdAtInvoice creation date
updatedAtInvoice update date

Orders ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/orders are:

PropertyDescription
codeOrder’s code
nameOrder’s name
accountNameOrder’s account name
billingToNameOrder’s bill to account name
createdAtOrder’s created date
updatedAtOrder’s updated date

Pricelists ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/pricelists are:

PropertyDescription
namePricelist’s name
isActivePricelist’s status
fromPricelist’s from date
toPricelist’s to date
createdAtPricelist’s created date
updatedAtPricelist’s updated date

Products ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/products are:

PropertyDescription
nameProduct’s name
createdAtProduct’s created date
updatedAtProduct’s updated date

Leads ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/leads are:

PropertyDescription
firstNameLead’s firstName
lastNameLead’s lastName
emailLead’s email
annualRevenueLead’s annualRevenue value
employeesLead’s employees number
createdAtLead’s created date
updatedAtLead’s updated date

Subscriptions ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/subscriptions are:

NameDescription
nameSubscription’s name
startDateSubscription’s start date
endDateSubscription’s end date
activationDateSubscription’s activation date
quantitySubscription’s quantity
subscriptionAmountSubscription’s amount
createdAtSubscription’s created date
updatedAtSubscription’s updated date

FutureActions ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/futureactions are:

PropertyDescription
requestDateFuture action’s request date
effectiveDateFuture action’s effective date
createdAtFuture action’s created date
updatedAtFuture action’s updated date

Organization

Organization/Countries ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/countries are:

PropertyDescription
nameThe country’s name
codeThe country’s code

Organization/Languages ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/languages are:

PropertyDescription
codeLanguage’s code

Organization/Currencies ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/currencies are:

PropertyDescription
nameCurrency’s name
mnemonicCurrency’s mnemonic
codeCurrency’s code

Organization/PaymentMethods ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/paymentmethods are:

PropertyDescription
namePayment method’s name
gatewayNamePayment method’s gateway name

Organization/Taxes ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/taxes are:

PropertyDescription
idTax’s ID
nameTax’s name
displayNameTax’s display name
isActiveTax ‘s activity status
isExcludedEUTax’s status of EU exclusion

Organization/Tax Authorities ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/taxauthorities are:

PropertyDescription
nameTax authority’s name
codeTax authority’s code

Organization/Account Types ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/accounts/types are:

PropertyDescription
nameAccount type’s name

Organization/Invoice Statuses ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/invoices/statuses are:

PropertyDescription
nameInvoice status’s name

Organization/Invoice Types ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/invoices/types are:

PropertyDescription
nameInvoice type’s name

Organization/Lead Statuses ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/leads/statuses are:

PropertyDescription
nameLead status’s name

Organization/Lead Sources ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/leads/sources are:

PropertyDescription
nameLead source’s name

Organization/Lead Ratings ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/leads/ratings are:

PropertyDescription
nameLead rating’s name

Organization/Titles ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/titles are:

PropertyDescription
nameTitle’s name
mnemonicTitle’s mnemonic

Organization/Product Types ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/producttypes are:

PropertyDescription
nameProduct type ‘s name
basicTypeNameProduct type ‘s basic type name

Organization/Unit Groups ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/unitgroups are:

PropertyDescription
nameUnit group’s name

Organization/Volume Discounts ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/volumediscounts are:

PropertyDescription
nameVolume discount’s name

Organization/Units of Measure ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/unitsofmeasure are:

PropertyDescription
nameUnit’s of measure name

Organization/Price Groups ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/pricegroups are:

PropertyDescription
namePrice group’s name

Organization/Product Industries ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/products/industries are:

PropertyDescription
nameProduct industry’s name

Organization/Industries ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/organization/industries are:

PropertyDescription
nameIndustry’s name

Organization Custom Fields ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for the following end-points:

  • GET /api/organization/accounts/customfields
  • GET /api/organization/assets/customfields
  • GET /api/organization/contacts/customfields
  • GET /api/organization/invoices/customfields
  • GET /api/organization/leads/customfields
  • GET /api/organization/orders/customfields
  • GET /api/organization/pricelists/customfields
  • GET /api/organization/products/customfields
  • GET /api/organization/subscriptions/customfields
PropertyDescription
nameCustom field’s name

Synchronization

Synchronization/Accounts ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET api/synchronization/{systemId}/accounts are:

NameTypeDescriptionExample
syncStatusstringSorts the request response by the Status field./api/synchronization/{systemId}/accounts?$orderby=SyncStatus

Note: Ordering can be either ascending (asc) or descending (desc). Default is ascending.

Synchronization/Assets ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET api/synchronization/{systemId}/assets are:

NameTypeDescriptionExample
syncStatusstringSorts the request response by the Status field./api/synchronization/{systemId}/assets?$orderby=syncStatus

Synchronization/ProductTypes ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET api/synchronization/{systemId}/accounts are:

NameTypeDescriptionExample
syncStatusstringSorts the request response by the Status field./api/synchronization/{systemId}/productTypes?$orderby=syncStatus

Synchronization/Products ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET api/synchronization/{systemId}/products are:

NameTypeDescriptionExample
syncStatusstringSorts the request response by the Status field./api/synchronization/{systemId}/products?$orderby=SyncStatus

System

System/Countries ($orderby)

The ordering criteria that could be used for constructing an $orderby expression for GET /api/system/countries are:

PropertyDescription
nameThe country’s name
codeThe country’s code