GET Requests

Overview

GET requests allow you to retrieve data from the CIMcloud API / platform.

Results can be filtered by Searchstrings or Pagination.

Example: Get All Accounts

Description: Endpoint to retrieve all accounts.

Endpoint: https://api.cimcloud.com/{sitename}/accounts/

Example: Get All Customers

Description: Endpoint to retrieve all customers.

Endpoint: https://api.cimcloud.com/{sitename}/customers/

Example: Get All Products

Description: Endpoint to retrieve all products.

Endpoint: https://api.cimcloud.com/{sitename}/products/

Notes

  • If using a bearer token with a Session attached, customer-specific pricing is in the “customer_price” property

Example: Get Online Orders

Description: A complex resource type to retrieve orders placed on the site where [orders].exported = ‘0’; setting the [orders].exported flag to ‘1’ after a GET request.  Purpose is to GET new orders without risk of duplication.

Endpoint: https://api.cimcloud.com/{sitename}/OnlineOrders

Notes

  • Although a GET request is made, the complex API resource type automatically filters on the [orders] table where the exported flag is set to 0
  • This HTTP method uses a custom GET query to pull the order details from multiple tables including:
    • Order Header [orders]
    • Order Details [order_detail]
    • Product Information [product]
    • Account Information [accounts]
    • Customer Information [customers]
    • Credit Card Information (PCI Compliant) [credit_card_nicknames]
    • Shipping Address [shipping_addresses]
    • Payment [payments]
  • Once a GET request is made to the OnlineOrders endpoint, the [orders].exported flag is set to 1
  • To retrieve the same orders a second time, a POST request should be made to an Orders resource with a “standard” type passing the exported flag as 0

Successful Response:

[
    {
    "c_ordnum": 115860,
    "o_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Header_WS_ID": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "CouponData_Amount": 0.0000,
    "CouponData_UserCode": "",
    "CouponData_ItemCode": null,
    "GiftCard_DepositAmt": 0.0000,
    "GiftCard_UserCode": "",
    "GiftCard_ItemCode": "/GIFT",
    "OrderComment_Text": "TEST ORDER",
    "OrderComment_ItemCode": "/C",
    "ExtraDetail_1_Comment": "",
    "ExtraDetail_1_ItemCode": "/C",
    "ExtraDetail_1_ItemType": "4",
    "ExtraDetail_1_PostExtraLine": "0",
    "Header_CommentText": null,
    "TaxData_TaxSchedule": "SC PIC",
    "Header_ERPOrderNumber": null,
    "Header_SalesOrderNo": null,
    "header_CancelReasonCode": "",
    "header_OrderStatus": null,
    "header_PrintPickingSheets": null,
    "header_PrintSalesOrders": null,
    "header_WarehouseCode": null,
    "Header_SalespersonNo": "Z",
    "Header_DivisionNo": "00",
    "Header_ConfirmTo": " ",
    "Header_FaxNo": "864-123-0000",
    "Header_CustomerNo": "WSP100",
    "header_FreightAmt": 0.0000,
    "Header_CustomerPONo": "TEST ORDER",
    "Header_ShipVia": "CPU",
    "Header_OrderDate": "2010-00-00T17:07:39.817",
    "Header_BillToName": "Website Pipeline",
    "Header_BillToAddress1": "123 Main Street",
    "Header_BillToAddress2": "",
    "Header_BillToAddress3": "",
    "Header_BillToCity": "Greenville",
    "Header_BillToState": "SC",
    "Header_BillToZipCode": "29607",
    "Header_BillToCountryCode": "USA",
    "Header_BillToCustomerNo": "WSP100",
    "Header_BillToDivisionNo": "00",
    "Header_ShipToName": "",
    "Header_ShipToAddress1": "123 Main Street",
    "Header_ShipToAddress2": "Suite 123",
    "Header_ShipToAddress3": "",
    "Header_ShipToCity": "Greenville",
    "Header_ShipToState": "SC",
    "Header_ShipToZipCode": "29607",
    "Header_ShipToCountryCode": "USA",
    "Header_TermsCode": "30",
    "Header_EmailAddress": "joe@gmail.com",
    "Header_ShipExpireDate": "2024-01-04T21:15:22.55",
    "Header_DiscountRate": 0.00,
    "Customer_CustomerNo": "WSP100",
    "Customer_DivisionNo": "00",
    "Customer_SalespersonNo": "Z",
    "Customer_TaxSchedule": "SC",
    "Customer_TermsCode": "30",
    "Customer_UpdateCustomerMaster": "false",
    "Customer_FaxNo": "864-123-0000",
    "Customer_CustomerName": "CimCloud",
    "Customer_AddressLine1": "123 Main Street",
    "Customer_AddressLine2": "",
    "Customer_AddressLine3": null,
    "Customer_City": "Greenville",
    "Customer_State": "SC",
    "Customer_ZipCode": "29607",
    "Customer_CountryCode": "USA",
    "Customer_CreditHold": "N",
    "Customer_CustomerType": "OT",
    "Customer_EmailAddress": "joe@gmail.com",
    "Customer_ShipMethod": null,
    "Customer_TaxExemptNo": null,
    "Customer_TelephoneExt": "105",
    "Customer_TelephoneNo": "864-123-0000",
    "Customer_URLAddress": "",
    "Customer_PriceLevel": "Z",
    "ShipTo_ShipToCode": "W007",
    "ShipTo_LookupShipToAddressFromShipToCode": "false",
    "ShipTo_UpdateShipToMaster": "true",
    "ShipTo_ShipToName": "",
    "ShipTo_ShipToAddress1": "123 Main Street",
    "ShipTo_ShipToAddress2": "Suite 123",
    "ShipTo_ShipToAddress3": "",
    "ShipTo_ShipToCity": "Greenville",
    "ShipTo_ShipToState": "SC",
    "ShipTo_ShipToZipCode": "29607",
    "ShipTo_ShipToCountryCode": "USA",
    "ShipTo_TaxSchedule": "SC PIC",
    "ShipTo_TelephoneNo": "864-123-1000",
    "ShipTo_EmailAddress": "real.customer@gmail.com",
    "ShipTo_SalespersonDivisionNo": "00",
    "ShipTo_SalesPersonNo": "Z",
    "ShipTo_WarehouseCode": null,
    "CreditCard_Gateway": null,
    "CreditCard_AVSAddress": null,
    "CreditCard_AVSAddress2": null,
    "CreditCard_AVSCity": null,
    "CreditCard_AVSState": null,
    "CreditCard_AVSZipCode": null,
    "CreditCard_AVSCountry": null,
    "CreditCard_CardholderName": null,
    "CreditCard_ExpirationDateMonth": "",
    "CreditCard_ExpirationDateYear": "",
    "CreditCard_VaultId": null,
    "CreditCard_First2": null,
    "CreditCard_Last4": null,
    "CreditCard_CardID": null,
    "Payment_DepositAmt": 0.0000,
    "Payment_CreditCardAuthorizationNo": null,
    "Payment_PaymentType": "",
    "Payment_CreditCardPayment": "0",
    "Payment_CreditCardTransactionID": null,
    "Payment_PaymentResponseXML": "<xml></xml>",
    "Payment_PaymentResponseAuthorizeCIM": "",
    "Payment_TransactionDate": "",
    "Payment_TransactionTime": "",
    "Payment_PostDepositAmt": null,
    "Payment_PaymentTypeCategory": "P",
    "Payment_OtherPaymentTypeRefNo": null,
    "Payment_APISecret": null,
    "details": [
        {
            "QuantityOrdered": 1.0000,
            "ItemCode": "SHIRT001",
            "UnitPrice": 34.9900,
            "UnitOfMeasure": "",
            "Comment": "",
            "WarehouseCode": null
        }
    ]
}
]

GET: Searchstrings on Complex Resource Types

Complex resource types allow highly customizable queries to manipulate records.  To allow searchstrings when the Resource Type is set to “Complex”, any of the following syntax should be included in your GET query:

  • {{searchstring(where)}}
    • Appends a searchstring to your custom GET query (without the WHERE clause defined)
    • Example Query: Returns all products where you can append filters within your API calls
      • select * from products {{searchstring(where)}}
  • {{searchstring(and)}}
    • Uses the WHERE clause in your custom GET query and appends optional searchstrings in your API calls
    • Example Query: Returns only enabled products, allowing additiional filtering with an AND searchstring
      • select * from products where isnull(status, ‘1’) = ‘1’ {{searchstring(and)}}
  • {{searchstring(or)}}
    • Allows you to override the WHERE clause in your custom GET query.
    • Example Query: Allows you to override the filter on the query to GET enabled products with an OR searchstring in your API Call
      • select * from products where isnull(status, ‘1’) = ‘1’ {{searchstring(or)}

Was this article helpful

Related Articles

Subscribe to receive email updates of what's new in the CIMcloud Help Center.