Chilkat Online Tools

DataFlex / Shopify / Get all orders from a customer

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vQueryParams
    Handle hoQueryParams
    Variant vResp
    Handle hoResp
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Get Create (RefClass(cComChilkatJsonObject)) To hoQueryParams
    If (Not(IsComObjectCreated(hoQueryParams))) Begin
        Send CreateComObject of hoQueryParams
    End
    Get ComUpdateString Of hoQueryParams "customer_id" "<>" To iSuccess

    Send ComSetRequestHeader To hoHttp "Content" "<>"

    Get pvComObject of hoQueryParams to vQueryParams
    Get ComQuickRequestParams Of hoHttp "GET" "httpsDefaultParameterValue:DefaultParameterValue@DefaultParameterValue.myshopify.com/admin/orders.json" vQueryParams To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iTemp1
    Showln iTemp1
    Get ComBodyStr Of hoResp To sTemp1
    Showln sTemp1
    Send Destroy of hoResp


End_Procedure

Curl Command

curl -G -d "customer_id=%3C%3E"
	-H "Content: <>"
httpsDefaultParameterValue:DefaultParameterValue@DefaultParameterValue.myshopify.com/admin/orders.json

Postman Collection Item JSON

{
  "name": "Get all orders from a customer",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Content",
        "value": "<>"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/admin/orders.json?customer_id=<>",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "admin",
        "orders.json"
      ],
      "query": [
        {
          "key": "customer_id",
          "value": "<>"
        }
      ]
    },
    "description": "Get all orders from a customer."
  },
  "response": [
  ]
}