Sample code for 30+ languages & platforms
C

Ecwid - Search Orders

See more Ecwid Examples

Search or filter orders in an Ecwid store. The response provides full details of the found orders.

Chilkat C Downloads

C
#include <C_CkHttp.h>
#include <C_CkJsonObject.h>
#include <C_CkHttpResponse.h>
#include <C_CkStringBuilder.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkHttp http;
    HCkJsonObject jsonToken;
    HCkJsonObject params;
    HCkHttpResponse resp;
    HCkStringBuilder sbResponseBody;
    HCkJsonObject jResp;
    int respStatusCode;
    const char *id;
    const char *subtotal;
    const char *total_str;
    const char *giftCardRedemption;
    const char *totalBeforeGiftCardRedemption;
    BOOL giftCardDoubleSpending;
    const char *usdTotal;
    const char *tax;
    const char *paymentMethod;
    const char *paymentStatus;
    const char *fulfillmentStatus;
    const char *vendorOrderNumber;
    int orderNumber;
    const char *refererUrl;
    const char *globalReferer;
    const char *createDate;
    const char *updateDate;
    int createTimestamp;
    int updateTimestamp;
    BOOL hidden;
    const char *orderComments;
    const char *privateAdminNotes;
    const char *email;
    const char *ipAddress;
    int customerId;
    int customerGroupId;
    const char *customerGroup;
    BOOL customerTaxExempt;
    const char *customerTaxId;
    BOOL customerTaxIdValid;
    BOOL reversedTaxApplied;
    int discount;
    int couponDiscount;
    int volumeDiscount;
    int membershipBasedDiscount;
    int totalAndMembershipBasedDiscount;
    int discountCouponId;
    const char *discountCouponName;
    const char *discountCouponCode;
    const char *discountCouponDiscountType;
    const char *discountCouponStatus;
    int discountCouponDiscount;
    const char *discountCouponLaunchDate;
    const char *discountCouponUsesLimit;
    const char *discountCouponApplicationLimit;
    const char *discountCouponCreationDate;
    const char *discountCouponUpdateDate;
    int discountCouponOrderCount;
    const char *refundedAmount;
    const char *billingPersonName;
    const char *billingPersonCompanyName;
    const char *billingPersonStreet;
    const char *billingPersonCity;
    const char *billingPersonCountryCode;
    const char *billingPersonCountryName;
    const char *billingPersonPostalCode;
    const char *billingPersonStateOrProvinceCode;
    const char *billingPersonStateOrProvinceName;
    const char *billingPersonPhone;
    const char *shippingPersonName;
    const char *shippingPersonCompanyName;
    const char *shippingPersonStreet;
    const char *shippingPersonCity;
    const char *shippingPersonCountryCode;
    const char *shippingPersonCountryName;
    const char *shippingPersonPostalCode;
    const char *shippingPersonStateOrProvinceCode;
    const char *shippingPersonStateOrProvinceName;
    const char *shippingPersonPhone;
    const char *shippingOptionShippingCarrierName;
    const char *shippingOptionShippingMethodName;
    const char *shippingOptionShippingRate;
    const char *shippingOptionEstimatedTransitTime;
    BOOL shippingOptionIsPickup;
    const char *handlingFeeName;
    int handlingFeeValue;
    const char *handlingFeeDescription;
    const char *paymentModule;
    const char *additionalInfoGoogle_customer_id;
    BOOL acceptMarketing;
    const char *refererId;
    BOOL disableAllCustomerNotifications;
    BOOL externalFulfillment;
    BOOL pricesIncludeTax;
    int j;
    int count_j;
    int value;
    const char *v_type;
    const char *base;
    int orderTotal;
    int id_int;
    int productId;
    int categoryId;
    int price;
    int productPrice;
    const char *sku;
    int quantity;
    const char *shortDescription;
    int shipping;
    int quantityInStock;
    const char *name;
    BOOL isShippingRequired;
    int weight;
    BOOL trackQuantity;
    BOOL fixedShippingRateOnly;
    const char *imageUrl;
    const char *smallThumbnailUrl;
    const char *hdThumbnailUrl;
    int fixedShippingRate;
    BOOL digital;
    BOOL couponApplied;
    int dimensionsLength;
    int dimensionsWidth;
    int dimensionsHeight;
    const char *couponAmount;
    int subscriptionId;
    const char *recurringChargeSettingsRecurringInterval;
    int recurringChargeSettingsRecurringIntervalCount;
    int k;
    int count_k;
    const char *value_str;
    HCkJsonObject json1;
    int i1;
    int count_i1;
    const char *strVal;
    const char *selectionTitle;
    int selectionModifier;
    const char *selectionModifierType;
    const char *taxOnDiscountedSubtotal;
    int taxOnShipping;
    BOOL includeInPrice;
    int discountInfoValue;
    const char *discountInfoType;
    const char *discountInfoBase;
    int discountInfoOrderTotal;
    const char *date;
    const char *source;
    const char *reason;
    const char *amount;
    int length;
    int width;
    int height;
    const char *weight_str;
    const char *declaredValue;
    const char *created;
    const char *shipToName;
    const char *shipToCompanyName;
    const char *shipToStreet;
    const char *shipToCity;
    const char *shipToCountryCode;
    const char *shipToCountryName;
    const char *shipToPostalCode;
    const char *shipToStateOrProvinceCode;
    const char *shipToStateOrProvinceName;
    const char *shipToPhone;
    const char *shipFromCompanyName;
    const char *shipFromStreet;
    const char *shipFromCity;
    const char *shipFromCountryCode;
    const char *shipFromCountryName;
    const char *shipFromPostalCode;
    const char *shipFromStateOrProvinceCode;
    const char *shipFromStateOrProvinceName;
    const char *shipFromPhone;
    const char *parcelWeight;
    int parcelWeightUnit;
    int parcelWidth;
    int parcelHeight;
    int parcelLength;
    int parcelDimensionUnit;
    int shippingServiceCarrier;
    int shippingServiceCarrierName;
    const char *shippingServiceCarrierServiceName;
    const char *shippingServiceCarrierServiceCode;
    const char *trackingTracking_number;
    const char *trackingTracking_url;
    int trackingEstimatedDays;
    const char *shippingLabelLabel_url;
    const char *shippingLabelCommercial_invoice_url;
    const char *customerInputType;
    const char *title;
    const char *orderDetailsDisplaySection;
    const char *orderBy;
    int total;
    int count;
    int offset;
    int limit;
    int i;
    int count_i;

    success = FALSE;

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

    http = CkHttp_Create();

    // Implements the following CURL command:

    // curl --request GET \
    //      --url 'https://app.ecwid.com/api/v3/storeId/orders?token=token' \
    //      --header 'Accept: application/json'

    // Use the following online tool to generate HTTP code from a CURL command
    // Convert a cURL Command to HTTP Source Code

    // Load the access token previously obtained in Ecwid Get Access Token
    jsonToken = CkJsonObject_Create();
    CkJsonObject_LoadFile(jsonToken,"qa_data/tokens/ecwid.json");

    CkHttp_SetRequestHeader(http,"Accept","application/json");

    params = CkJsonObject_Create();
    CkJsonObject_UpdateInt(params,"limit",100);
    CkJsonObject_UpdateString(params,"email","joe@example.com");
    CkJsonObject_UpdateString(params,"token",CkJsonObject_stringOf(jsonToken,"access_token"));

    resp = CkHttpResponse_Create();
    success = CkHttp_HttpParams(http,"GET","https://app.ecwid.com/api/v3/storeId/orders",params,resp);
    if (success == FALSE) {
        printf("%s\n",CkHttp_lastErrorText(http));
        CkHttp_Dispose(http);
        CkJsonObject_Dispose(jsonToken);
        CkJsonObject_Dispose(params);
        CkHttpResponse_Dispose(resp);
        return;
    }

    sbResponseBody = CkStringBuilder_Create();
    CkHttpResponse_GetBodySb(resp,sbResponseBody);
    jResp = CkJsonObject_Create();
    CkJsonObject_LoadSb(jResp,sbResponseBody);
    CkJsonObject_putEmitCompact(jResp,FALSE);

    printf("Response Body:\n");
    printf("%s\n",CkJsonObject_emit(jResp));

    respStatusCode = CkHttpResponse_getStatusCode(resp);

    printf("Response Status Code = %d\n",respStatusCode);
    if (respStatusCode != 200) {
        printf("Failed.\n");
        CkHttp_Dispose(http);
        CkJsonObject_Dispose(jsonToken);
        CkJsonObject_Dispose(params);
        CkHttpResponse_Dispose(resp);
        CkStringBuilder_Dispose(sbResponseBody);
        CkJsonObject_Dispose(jResp);
        return;
    }

    // Sample JSON response:
    // (Sample code for parsing the JSON response is shown below)

    // {
    //   "total": 1,
    //   "count": 1,
    //   "offset": 0,
    //   "limit": 100,
    //   "items": [
    //     {
    //       "id": "XJ12H",
    //       "subtotal": 1076.64,
    //       "total": 2014.97,
    //       "giftCardRedemption": 2.23,
    //       "totalBeforeGiftCardRedemption": 2.23,
    //       "giftCardDoubleSpending": false,
    //       "usdTotal": 2014.97,
    //       "tax": 488.48,
    //       "paymentMethod": "Credit or debit card (Mollie)",
    //       "paymentStatus": "PARTIALLY_REFUNDED",
    //       "fulfillmentStatus": "DELIVERED",
    //       "vendorOrderNumber": "XJ12H",
    //       "orderNumber": 1082727626,
    //       "refererUrl": "https://mdemo.ecwid.com/",
    //       "globalReferer": "https://my.ecwid.com/",
    //       "createDate": "2018-05-31 15:08:36 +0000",
    //       "updateDate": "2018-05-31 15:09:35 +0000",
    //       "createTimestamp": 1527779316,
    //       "updateTimestamp": 1527779375,
    //       "hidden": false,
    //       "orderComments": "Test order comments",
    //       "privateAdminNotes": "Must be delivered till Sunday.",
    //       "email": "mscott@gmail.com",
    //       "ipAddress": "123.431.234.243",
    //       "customerId": 40201284,
    //       "customerGroupId": 12345,
    //       "customerGroup": "Gold",
    //       "customerTaxExempt": false,
    //       "customerTaxId": "",
    //       "customerTaxIdValid": false,
    //       "reversedTaxApplied": false,
    //       "discount": 4,
    //       "couponDiscount": 22,
    //       "volumeDiscount": 4,
    //       "membershipBasedDiscount": 0,
    //       "totalAndMembershipBasedDiscount": 0,
    //       "customDiscount": [
    //       ],
    //       "discountCoupon": {
    //         "id": 29567026,
    //         "name": "API Testing",
    //         "code": "APITESTING",
    //         "discountType": "ABS",
    //         "status": "ACTIVE",
    //         "discount": 22,
    //         "launchDate": "2018-05-24 20:00:00 +0000",
    //         "usesLimit": "UNLIMITED",
    //         "applicationLimit": "UNLIMITED",
    //         "creationDate": "2018-05-31 15:08:33 +0000",
    //         "updateDate": "2018-05-24 13:40:32 +0000",
    //         "orderCount": 0
    //       },
    //       "discountInfo": [
    //         {
    //           "value": 4,
    //           "type": "ABS",
    //           "base": "ON_TOTAL",
    //           "orderTotal": 1
    //         }
    //       ],
    //       "items": [
    //         {
    //           "id": 140273658,
    //           "productId": 66722487,
    //           "categoryId": 19563207,
    //           "price": 1060,
    //           "productPrice": 1000,
    //           "sku": "ABCA-IAC",
    //           "quantity": 1,
    //           "shortDescription": "",
    //           "tax": 331.01,
    //           "shipping": 0,
    //           "quantityInStock": 0,
    //           "name": "iMac",
    //           "isShippingRequired": true,
    //           "weight": 0,
    //           "trackQuantity": false,
    //           "fixedShippingRateOnly": false,
    //           "imageUrl": "https://ecwid-images-ru.gcdn.co/images/5035009/391870914.jpg",
    //           "smallThumbnailUrl": "https://ecwid-images-ru.gcdn.co/images/5035009/650638292.jpg",
    //           "hdThumbnailUrl": "https://ecwid-images-ru.gcdn.co/images/5035009/650638293.jpg",
    //           "fixedShippingRate": 0,
    //           "digital": false,
    //           "couponApplied": true,
    //           "selectedOptions": [
    //             {
    //               "name": "Price-Optimizer",
    //               "value": "6",
    //               "valuesArray": [
    //                 "6"
    //               ],
    //               "selections": [
    //                 {
    //                   "selectionTitle": "6",
    //                   "selectionModifier": 6,
    //                   "selectionModifierType": "PERCENT"
    //                 }
    //               ],
    //               "type": "CHOICE"
    //             }
    //           ],
    //           "taxes": [
    //             {
    //               "name": "State tax",
    //               "value": 12,
    //               "total": 124.13,
    //               "taxOnDiscountedSubtotal": 124.13,
    //               "taxOnShipping": 0,
    //               "includeInPrice": false
    //             },
    //             {
    //               "name": "TVA",
    //               "value": 20,
    //               "total": 206.88,
    //               "taxOnDiscountedSubtotal": 206.88,
    //               "taxOnShipping": 0,
    //               "includeInPrice": true
    //             }
    //           ],
    //           "dimensions": {
    //             "length": 0,
    //             "width": 0,
    //             "height": 0
    //           },
    //           "couponAmount": 21.66,
    //           "discounts": [
    //             {
    //               "discountInfo": {
    //                 "value": 4,
    //                 "type": "ABS",
    //                 "base": "ON_TOTAL",
    //                 "orderTotal": 1
    //               },
    //               "total": 3.94
    //             }
    //           ]
    //         },
    //         {
    //           "id": 140273659,
    //           "productId": 66821181,
    //           "categoryId": 0,
    //           "price": 16.64,
    //           "productPrice": 16,
    //           "sku": "001001",
    //           "quantity": 1,
    //           "shortDescription": "This sturdy white, glossy ceramic mug is an essential to your cupboard. This brawny version of ceramic mugs shows it’s ...",
    //           "tax": 157.47,
    //           "shipping": 471.85,
    //           "quantityInStock": 0,
    //           "name": "Mug",
    //           "isShippingRequired": true,
    //           "weight": 0.4,
    //           "trackQuantity": false,
    //           "fixedShippingRateOnly": false,
    //           "imageUrl": "https://ecwid-images-ru.gcdn.co/images/5035009/389900000.jpg",
    //           "smallThumbnailUrl": "https://ecwid-images-ru.gcdn.co/images/5035009/475772545.jpg",
    //           "hdThumbnailUrl": "https://ecwid-images-ru.gcdn.co/images/5035009/408631478.jpg",
    //           "fixedShippingRate": 0,
    //           "digital": false,
    //           "couponApplied": true,
    //           "selectedOptions": [
    //             {
    //               "name": "Color",
    //               "value": "White",
    //               "valuesArray": [
    //                 "White"
    //               ],
    //               "selections": [
    //                 {
    //                   "selectionTitle": "White",
    //                   "selectionModifier": 0,
    //                   "selectionModifierType": "ABSOLUTE"
    //                 }
    //               ],
    //               "type": "CHOICE"
    //             },
    //             {
    //               "name": "Size",
    //               "value": "11oz",
    //               "valuesArray": [
    //                 "11oz"
    //               ],
    //               "selections": [
    //                 {
    //                   "selectionTitle": "11oz",
    //                   "selectionModifier": 0,
    //                   "selectionModifierType": "ABSOLUTE"
    //                 }
    //               ],
    //               "type": "CHOICE"
    //             },
    //             {
    //               "name": "Price-Optimizer",
    //               "value": "4",
    //               "valuesArray": [
    //                 "4"
    //               ],
    //               "selections": [
    //                 {
    //                   "selectionTitle": "4",
    //                   "selectionModifier": 4,
    //                   "selectionModifierType": "PERCENT"
    //                 }
    //               ],
    //               "type": "CHOICE"
    //             }
    //           ],
    //           "taxes": [
    //             {
    //               "name": "State tax",
    //               "value": 12,
    //               "total": 59.05,
    //               "taxOnDiscountedSubtotal": 1.95,
    //               "taxOnShipping": 57.1,
    //               "includeInPrice": false
    //             },
    //             {
    //               "name": "TVA",
    //               "value": 20,
    //               "total": 98.42,
    //               "taxOnDiscountedSubtotal": 3.25,
    //               "taxOnShipping": 95.17,
    //               "includeInPrice": true
    //             }
    //           ],
    //           "dimensions": {
    //             "length": 0,
    //             "width": 0,
    //             "height": 0
    //           },
    //           "couponAmount": 0.34,
    //           "discounts": [
    //             {
    //               "discountInfo": {
    //                 "value": 4,
    //                 "type": "ABS",
    //                 "base": "ON_TOTAL",
    //                 "orderTotal": 1
    //               },
    //               "total": 0.06
    //             }
    //           ]
    //         },
    //         {
    //           "subscriptionId": 123456,
    //           "recurringChargeSettings": {
    //             "recurringInterval": "month",
    //             "recurringIntervalCount": 1
    //           }
    //         }
    //       ],
    //       "refundedAmount": 3.5,
    //       "refunds": [
    //         {
    //           "date": "2017-09-12 10:12:56 +0000",
    //           "source": "CP",
    //           "reason": "Testing!",
    //           "amount": 3.5
    //         }
    //       ],
    //       "billingPerson": {
    //         "name": "Michael Scott",
    //         "companyName": "",
    //         "street": "555 Lackawanna Ave",
    //         "city": "Scranton",
    //         "countryCode": "US",
    //         "countryName": "United States",
    //         "postalCode": "18508",
    //         "stateOrProvinceCode": "PA",
    //         "stateOrProvinceName": "Pennsylvania",
    //         "phone": ""
    //       },
    //       "shippingPerson": {
    //         "name": "Michael Scott",
    //         "companyName": "",
    //         "street": "555 Lackawanna Ave",
    //         "city": "Scranton",
    //         "countryCode": "US",
    //         "countryName": "United States",
    //         "postalCode": "18508",
    //         "stateOrProvinceCode": "PA",
    //         "stateOrProvinceName": "Pennsylvania",
    //         "phone": ""
    //       },
    //       "shippingOption": {
    //         "shippingCarrierName": "Shipping app the-printful",
    //         "shippingMethodName": "USPS Priority Mail",
    //         "shippingRate": 471.85,
    //         "estimatedTransitTime": "1-3",
    //         "isPickup": false
    //       },
    //       "handlingFee": {
    //         "name": "Handling Fee",
    //         "value": 4,
    //         "description": ""
    //       },
    //       "predictedPackage": [
    //         {
    //           "length": 0,
    //           "width": 0,
    //           "height": 0,
    //           "weight": 0.4,
    //           "declaredValue": 1076.64
    //         }
    //       ],
    //       "shipments": [
    //         {
    //           "id": "5e79bd4f-9ebf-4ab8-b901-24c9b48b19eb",
    //           "created": "2020-04-23 19:13:43 +0000",
    //           "shipTo": {
    //             "name": "Michael Scott",
    //             "companyName": "",
    //             "street": "555 Lackawanna Ave",
    //             "city": "Scranton",
    //             "countryCode": "US",
    //             "countryName": "United States",
    //             "postalCode": "18508",
    //             "stateOrProvinceCode": "PA",
    //             "stateOrProvinceName": "Pennsylvania",
    //             "phone": ""
    //           },
    //           "shipFrom": {
    //             "companyName": "Roga Kopyty Inc",
    //             "street": "444 fff",
    //             "city": "New York",
    //             "countryCode": "US",
    //             "countryName": "United States",
    //             "postalCode": "10001",
    //             "stateOrProvinceCode": "NY",
    //             "stateOrProvinceName": "New York",
    //             "phone": "1011991919"
    //           },
    //           "parcel": {
    //             "weight": 0.5,
    //             "weightUnit": 'KILOGRAM',
    //             "width": 10,
    //             "height": 10,
    //             "length": 10,
    //             "dimensionUnit": 'CM'
    //           },
    //           "shippingService": {
    //             "carrier": 'USPS',
    //             "carrierName": 'Shipping,
    //             "carrierServiceName": "Priority Mail",
    //             "carrierServiceCode": "usps_priority"
    //           },
    //           "tracking": {
    //             "tracking_number": "9499907123456123456781",
    //             "tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9499907123456123456781",
    //             "estimatedDays": 3
    //           },
    //           "shippingLabel": {
    //             "label_url": "https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA",
    //             "commercial_invoice_url": ""
    //           }
    //         }
    //       ],
    //       "taxesOnShipping": [
    //         {
    //           "name": "State tax",
    //           "value": 12,
    //           "total": 57.1
    //         },
    //         {
    //           "name": "TVA",
    //           "value": 20,
    //           "total": 95.17
    //         }
    //       ],
    //       "paymentModule": "CUSTOM_PAYMENT_APP-mollie-pg",
    //       "additionalInfo": {
    //         "google_customer_id": "2008512504.1526280224"
    //       },
    //       "paymentParams": {},
    //       "orderExtraFields": [
    //         {
    //           "id": "lang",
    //           "value": "en",
    //           "customerInputType": "",
    //           "title": "",
    //           "orderDetailsDisplaySection": "",
    //           "orderBy": "1"
    //         },
    //         {
    //           "id": "askHowYouFoundUsApp",
    //           "value": "From a friend",
    //           "customerInputType": "SELECT",
    //           "title": "How did you hear about us?",
    //           "orderDetailsDisplaySection": "order_comments",
    //           "orderBy": "2"
    //         }
    //       ],
    //       "acceptMarketing": true,
    //       "refererId": "Amazon",
    //       "disableAllCustomerNotifications": false,
    //       "externalFulfillment": false,
    //       "pricesIncludeTax": false
    //     }
    //   ]
    // }

    // Sample code for parsing the JSON response...
    // Use the following online tool to generate parsing code from sample JSON:
    // Generate Parsing Code from JSON

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.
    // See this example explaining how this memory should be used: const char * functions.

    json1 = CkJsonObject_Create();

    total = CkJsonObject_IntOf(jResp,"total");
    count = CkJsonObject_IntOf(jResp,"count");
    offset = CkJsonObject_IntOf(jResp,"offset");
    limit = CkJsonObject_IntOf(jResp,"limit");
    i = 0;
    count_i = CkJsonObject_SizeOfArray(jResp,"items");
    while (i < count_i) {
        CkJsonObject_putI(jResp,i);
        id = CkJsonObject_stringOf(jResp,"items[i].id");
        subtotal = CkJsonObject_stringOf(jResp,"items[i].subtotal");
        total_str = CkJsonObject_stringOf(jResp,"items[i].total");
        giftCardRedemption = CkJsonObject_stringOf(jResp,"items[i].giftCardRedemption");
        totalBeforeGiftCardRedemption = CkJsonObject_stringOf(jResp,"items[i].totalBeforeGiftCardRedemption");
        giftCardDoubleSpending = CkJsonObject_BoolOf(jResp,"items[i].giftCardDoubleSpending");
        usdTotal = CkJsonObject_stringOf(jResp,"items[i].usdTotal");
        tax = CkJsonObject_stringOf(jResp,"items[i].tax");
        paymentMethod = CkJsonObject_stringOf(jResp,"items[i].paymentMethod");
        paymentStatus = CkJsonObject_stringOf(jResp,"items[i].paymentStatus");
        fulfillmentStatus = CkJsonObject_stringOf(jResp,"items[i].fulfillmentStatus");
        vendorOrderNumber = CkJsonObject_stringOf(jResp,"items[i].vendorOrderNumber");
        orderNumber = CkJsonObject_IntOf(jResp,"items[i].orderNumber");
        refererUrl = CkJsonObject_stringOf(jResp,"items[i].refererUrl");
        globalReferer = CkJsonObject_stringOf(jResp,"items[i].globalReferer");
        createDate = CkJsonObject_stringOf(jResp,"items[i].createDate");
        updateDate = CkJsonObject_stringOf(jResp,"items[i].updateDate");
        createTimestamp = CkJsonObject_IntOf(jResp,"items[i].createTimestamp");
        updateTimestamp = CkJsonObject_IntOf(jResp,"items[i].updateTimestamp");
        hidden = CkJsonObject_BoolOf(jResp,"items[i].hidden");
        orderComments = CkJsonObject_stringOf(jResp,"items[i].orderComments");
        privateAdminNotes = CkJsonObject_stringOf(jResp,"items[i].privateAdminNotes");
        email = CkJsonObject_stringOf(jResp,"items[i].email");
        ipAddress = CkJsonObject_stringOf(jResp,"items[i].ipAddress");
        customerId = CkJsonObject_IntOf(jResp,"items[i].customerId");
        customerGroupId = CkJsonObject_IntOf(jResp,"items[i].customerGroupId");
        customerGroup = CkJsonObject_stringOf(jResp,"items[i].customerGroup");
        customerTaxExempt = CkJsonObject_BoolOf(jResp,"items[i].customerTaxExempt");
        customerTaxId = CkJsonObject_stringOf(jResp,"items[i].customerTaxId");
        customerTaxIdValid = CkJsonObject_BoolOf(jResp,"items[i].customerTaxIdValid");
        reversedTaxApplied = CkJsonObject_BoolOf(jResp,"items[i].reversedTaxApplied");
        discount = CkJsonObject_IntOf(jResp,"items[i].discount");
        couponDiscount = CkJsonObject_IntOf(jResp,"items[i].couponDiscount");
        volumeDiscount = CkJsonObject_IntOf(jResp,"items[i].volumeDiscount");
        membershipBasedDiscount = CkJsonObject_IntOf(jResp,"items[i].membershipBasedDiscount");
        totalAndMembershipBasedDiscount = CkJsonObject_IntOf(jResp,"items[i].totalAndMembershipBasedDiscount");
        discountCouponId = CkJsonObject_IntOf(jResp,"items[i].discountCoupon.id");
        discountCouponName = CkJsonObject_stringOf(jResp,"items[i].discountCoupon.name");
        discountCouponCode = CkJsonObject_stringOf(jResp,"items[i].discountCoupon.code");
        discountCouponDiscountType = CkJsonObject_stringOf(jResp,"items[i].discountCoupon.discountType");
        discountCouponStatus = CkJsonObject_stringOf(jResp,"items[i].discountCoupon.status");
        discountCouponDiscount = CkJsonObject_IntOf(jResp,"items[i].discountCoupon.discount");
        discountCouponLaunchDate = CkJsonObject_stringOf(jResp,"items[i].discountCoupon.launchDate");
        discountCouponUsesLimit = CkJsonObject_stringOf(jResp,"items[i].discountCoupon.usesLimit");
        discountCouponApplicationLimit = CkJsonObject_stringOf(jResp,"items[i].discountCoupon.applicationLimit");
        discountCouponCreationDate = CkJsonObject_stringOf(jResp,"items[i].discountCoupon.creationDate");
        discountCouponUpdateDate = CkJsonObject_stringOf(jResp,"items[i].discountCoupon.updateDate");
        discountCouponOrderCount = CkJsonObject_IntOf(jResp,"items[i].discountCoupon.orderCount");
        refundedAmount = CkJsonObject_stringOf(jResp,"items[i].refundedAmount");
        billingPersonName = CkJsonObject_stringOf(jResp,"items[i].billingPerson.name");
        billingPersonCompanyName = CkJsonObject_stringOf(jResp,"items[i].billingPerson.companyName");
        billingPersonStreet = CkJsonObject_stringOf(jResp,"items[i].billingPerson.street");
        billingPersonCity = CkJsonObject_stringOf(jResp,"items[i].billingPerson.city");
        billingPersonCountryCode = CkJsonObject_stringOf(jResp,"items[i].billingPerson.countryCode");
        billingPersonCountryName = CkJsonObject_stringOf(jResp,"items[i].billingPerson.countryName");
        billingPersonPostalCode = CkJsonObject_stringOf(jResp,"items[i].billingPerson.postalCode");
        billingPersonStateOrProvinceCode = CkJsonObject_stringOf(jResp,"items[i].billingPerson.stateOrProvinceCode");
        billingPersonStateOrProvinceName = CkJsonObject_stringOf(jResp,"items[i].billingPerson.stateOrProvinceName");
        billingPersonPhone = CkJsonObject_stringOf(jResp,"items[i].billingPerson.phone");
        shippingPersonName = CkJsonObject_stringOf(jResp,"items[i].shippingPerson.name");
        shippingPersonCompanyName = CkJsonObject_stringOf(jResp,"items[i].shippingPerson.companyName");
        shippingPersonStreet = CkJsonObject_stringOf(jResp,"items[i].shippingPerson.street");
        shippingPersonCity = CkJsonObject_stringOf(jResp,"items[i].shippingPerson.city");
        shippingPersonCountryCode = CkJsonObject_stringOf(jResp,"items[i].shippingPerson.countryCode");
        shippingPersonCountryName = CkJsonObject_stringOf(jResp,"items[i].shippingPerson.countryName");
        shippingPersonPostalCode = CkJsonObject_stringOf(jResp,"items[i].shippingPerson.postalCode");
        shippingPersonStateOrProvinceCode = CkJsonObject_stringOf(jResp,"items[i].shippingPerson.stateOrProvinceCode");
        shippingPersonStateOrProvinceName = CkJsonObject_stringOf(jResp,"items[i].shippingPerson.stateOrProvinceName");
        shippingPersonPhone = CkJsonObject_stringOf(jResp,"items[i].shippingPerson.phone");
        shippingOptionShippingCarrierName = CkJsonObject_stringOf(jResp,"items[i].shippingOption.shippingCarrierName");
        shippingOptionShippingMethodName = CkJsonObject_stringOf(jResp,"items[i].shippingOption.shippingMethodName");
        shippingOptionShippingRate = CkJsonObject_stringOf(jResp,"items[i].shippingOption.shippingRate");
        shippingOptionEstimatedTransitTime = CkJsonObject_stringOf(jResp,"items[i].shippingOption.estimatedTransitTime");
        shippingOptionIsPickup = CkJsonObject_BoolOf(jResp,"items[i].shippingOption.isPickup");
        handlingFeeName = CkJsonObject_stringOf(jResp,"items[i].handlingFee.name");
        handlingFeeValue = CkJsonObject_IntOf(jResp,"items[i].handlingFee.value");
        handlingFeeDescription = CkJsonObject_stringOf(jResp,"items[i].handlingFee.description");
        paymentModule = CkJsonObject_stringOf(jResp,"items[i].paymentModule");
        additionalInfoGoogle_customer_id = CkJsonObject_stringOf(jResp,"items[i].additionalInfo.google_customer_id");
        acceptMarketing = CkJsonObject_BoolOf(jResp,"items[i].acceptMarketing");
        refererId = CkJsonObject_stringOf(jResp,"items[i].refererId");
        disableAllCustomerNotifications = CkJsonObject_BoolOf(jResp,"items[i].disableAllCustomerNotifications");
        externalFulfillment = CkJsonObject_BoolOf(jResp,"items[i].externalFulfillment");
        pricesIncludeTax = CkJsonObject_BoolOf(jResp,"items[i].pricesIncludeTax");
        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"items[i].customDiscount");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"items[i].discountInfo");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            value = CkJsonObject_IntOf(jResp,"items[i].discountInfo[j].value");
            v_type = CkJsonObject_stringOf(jResp,"items[i].discountInfo[j].type");
            base = CkJsonObject_stringOf(jResp,"items[i].discountInfo[j].base");
            orderTotal = CkJsonObject_IntOf(jResp,"items[i].discountInfo[j].orderTotal");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"items[i].items");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            id_int = CkJsonObject_IntOf(jResp,"items[i].items[j].id");
            productId = CkJsonObject_IntOf(jResp,"items[i].items[j].productId");
            categoryId = CkJsonObject_IntOf(jResp,"items[i].items[j].categoryId");
            price = CkJsonObject_IntOf(jResp,"items[i].items[j].price");
            productPrice = CkJsonObject_IntOf(jResp,"items[i].items[j].productPrice");
            sku = CkJsonObject_stringOf(jResp,"items[i].items[j].sku");
            quantity = CkJsonObject_IntOf(jResp,"items[i].items[j].quantity");
            shortDescription = CkJsonObject_stringOf(jResp,"items[i].items[j].shortDescription");
            tax = CkJsonObject_stringOf(jResp,"items[i].items[j].tax");
            shipping = CkJsonObject_IntOf(jResp,"items[i].items[j].shipping");
            quantityInStock = CkJsonObject_IntOf(jResp,"items[i].items[j].quantityInStock");
            name = CkJsonObject_stringOf(jResp,"items[i].items[j].name");
            isShippingRequired = CkJsonObject_BoolOf(jResp,"items[i].items[j].isShippingRequired");
            weight = CkJsonObject_IntOf(jResp,"items[i].items[j].weight");
            trackQuantity = CkJsonObject_BoolOf(jResp,"items[i].items[j].trackQuantity");
            fixedShippingRateOnly = CkJsonObject_BoolOf(jResp,"items[i].items[j].fixedShippingRateOnly");
            imageUrl = CkJsonObject_stringOf(jResp,"items[i].items[j].imageUrl");
            smallThumbnailUrl = CkJsonObject_stringOf(jResp,"items[i].items[j].smallThumbnailUrl");
            hdThumbnailUrl = CkJsonObject_stringOf(jResp,"items[i].items[j].hdThumbnailUrl");
            fixedShippingRate = CkJsonObject_IntOf(jResp,"items[i].items[j].fixedShippingRate");
            digital = CkJsonObject_BoolOf(jResp,"items[i].items[j].digital");
            couponApplied = CkJsonObject_BoolOf(jResp,"items[i].items[j].couponApplied");
            dimensionsLength = CkJsonObject_IntOf(jResp,"items[i].items[j].dimensions.length");
            dimensionsWidth = CkJsonObject_IntOf(jResp,"items[i].items[j].dimensions.width");
            dimensionsHeight = CkJsonObject_IntOf(jResp,"items[i].items[j].dimensions.height");
            couponAmount = CkJsonObject_stringOf(jResp,"items[i].items[j].couponAmount");
            subscriptionId = CkJsonObject_IntOf(jResp,"items[i].items[j].subscriptionId");
            recurringChargeSettingsRecurringInterval = CkJsonObject_stringOf(jResp,"items[i].items[j].recurringChargeSettings.recurringInterval");
            recurringChargeSettingsRecurringIntervalCount = CkJsonObject_IntOf(jResp,"items[i].items[j].recurringChargeSettings.recurringIntervalCount");
            k = 0;
            count_k = CkJsonObject_SizeOfArray(jResp,"items[i].items[j].selectedOptions");
            while (k < count_k) {
                CkJsonObject_putK(jResp,k);
                name = CkJsonObject_stringOf(jResp,"items[i].items[j].selectedOptions[k].name");
                value_str = CkJsonObject_stringOf(jResp,"items[i].items[j].selectedOptions[k].value");
                v_type = CkJsonObject_stringOf(jResp,"items[i].items[j].selectedOptions[k].type");
                CkJsonObject_ObjectOf2(jResp,"items[i].items[j].selectedOptions[k]",json1);

                i1 = 0;
                count_i1 = CkJsonObject_SizeOfArray(json1,"valuesArray");
                while (i1 < count_i1) {
                    CkJsonObject_putI(json1,i1);
                    strVal = CkJsonObject_stringOf(json1,"valuesArray[i]");
                    i1 = i1 + 1;
                }

                CkJsonObject_ObjectOf2(jResp,"items[i].items[j].selectedOptions[k]",json1);
                i1 = 0;
                count_i1 = CkJsonObject_SizeOfArray(json1,"selections");
                while (i1 < count_i1) {
                    CkJsonObject_putI(json1,i1);
                    selectionTitle = CkJsonObject_stringOf(json1,"selections[i].selectionTitle");
                    selectionModifier = CkJsonObject_IntOf(json1,"selections[i].selectionModifier");
                    selectionModifierType = CkJsonObject_stringOf(json1,"selections[i].selectionModifierType");
                    i1 = i1 + 1;
                }

                k = k + 1;
            }

            k = 0;
            count_k = CkJsonObject_SizeOfArray(jResp,"items[i].items[j].taxes");
            while (k < count_k) {
                CkJsonObject_putK(jResp,k);
                name = CkJsonObject_stringOf(jResp,"items[i].items[j].taxes[k].name");
                value = CkJsonObject_IntOf(jResp,"items[i].items[j].taxes[k].value");
                total_str = CkJsonObject_stringOf(jResp,"items[i].items[j].taxes[k].total");
                taxOnDiscountedSubtotal = CkJsonObject_stringOf(jResp,"items[i].items[j].taxes[k].taxOnDiscountedSubtotal");
                taxOnShipping = CkJsonObject_IntOf(jResp,"items[i].items[j].taxes[k].taxOnShipping");
                includeInPrice = CkJsonObject_BoolOf(jResp,"items[i].items[j].taxes[k].includeInPrice");
                k = k + 1;
            }

            k = 0;
            count_k = CkJsonObject_SizeOfArray(jResp,"items[i].items[j].discounts");
            while (k < count_k) {
                CkJsonObject_putK(jResp,k);
                discountInfoValue = CkJsonObject_IntOf(jResp,"items[i].items[j].discounts[k].discountInfo.value");
                discountInfoType = CkJsonObject_stringOf(jResp,"items[i].items[j].discounts[k].discountInfo.type");
                discountInfoBase = CkJsonObject_stringOf(jResp,"items[i].items[j].discounts[k].discountInfo.base");
                discountInfoOrderTotal = CkJsonObject_IntOf(jResp,"items[i].items[j].discounts[k].discountInfo.orderTotal");
                total_str = CkJsonObject_stringOf(jResp,"items[i].items[j].discounts[k].total");
                k = k + 1;
            }

            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"items[i].refunds");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            date = CkJsonObject_stringOf(jResp,"items[i].refunds[j].date");
            source = CkJsonObject_stringOf(jResp,"items[i].refunds[j].source");
            reason = CkJsonObject_stringOf(jResp,"items[i].refunds[j].reason");
            amount = CkJsonObject_stringOf(jResp,"items[i].refunds[j].amount");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"items[i].predictedPackage");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            length = CkJsonObject_IntOf(jResp,"items[i].predictedPackage[j].length");
            width = CkJsonObject_IntOf(jResp,"items[i].predictedPackage[j].width");
            height = CkJsonObject_IntOf(jResp,"items[i].predictedPackage[j].height");
            weight_str = CkJsonObject_stringOf(jResp,"items[i].predictedPackage[j].weight");
            declaredValue = CkJsonObject_stringOf(jResp,"items[i].predictedPackage[j].declaredValue");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"items[i].shipments");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            id = CkJsonObject_stringOf(jResp,"items[i].shipments[j].id");
            created = CkJsonObject_stringOf(jResp,"items[i].shipments[j].created");
            shipToName = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipTo.name");
            shipToCompanyName = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipTo.companyName");
            shipToStreet = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipTo.street");
            shipToCity = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipTo.city");
            shipToCountryCode = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipTo.countryCode");
            shipToCountryName = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipTo.countryName");
            shipToPostalCode = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipTo.postalCode");
            shipToStateOrProvinceCode = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipTo.stateOrProvinceCode");
            shipToStateOrProvinceName = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipTo.stateOrProvinceName");
            shipToPhone = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipTo.phone");
            shipFromCompanyName = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipFrom.companyName");
            shipFromStreet = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipFrom.street");
            shipFromCity = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipFrom.city");
            shipFromCountryCode = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipFrom.countryCode");
            shipFromCountryName = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipFrom.countryName");
            shipFromPostalCode = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipFrom.postalCode");
            shipFromStateOrProvinceCode = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipFrom.stateOrProvinceCode");
            shipFromStateOrProvinceName = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipFrom.stateOrProvinceName");
            shipFromPhone = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shipFrom.phone");
            parcelWeight = CkJsonObject_stringOf(jResp,"items[i].shipments[j].parcel.weight");
            parcelWeightUnit = CkJsonObject_IntOf(jResp,"items[i].shipments[j].parcel.weightUnit");
            parcelWidth = CkJsonObject_IntOf(jResp,"items[i].shipments[j].parcel.width");
            parcelHeight = CkJsonObject_IntOf(jResp,"items[i].shipments[j].parcel.height");
            parcelLength = CkJsonObject_IntOf(jResp,"items[i].shipments[j].parcel.length");
            parcelDimensionUnit = CkJsonObject_IntOf(jResp,"items[i].shipments[j].parcel.dimensionUnit");
            shippingServiceCarrier = CkJsonObject_IntOf(jResp,"items[i].shipments[j].shippingService.carrier");
            shippingServiceCarrierName = CkJsonObject_IntOf(jResp,"items[i].shipments[j].shippingService.carrierName");
            shippingServiceCarrierServiceName = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shippingService.carrierServiceName");
            shippingServiceCarrierServiceCode = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shippingService.carrierServiceCode");
            trackingTracking_number = CkJsonObject_stringOf(jResp,"items[i].shipments[j].tracking.tracking_number");
            trackingTracking_url = CkJsonObject_stringOf(jResp,"items[i].shipments[j].tracking.tracking_url");
            trackingEstimatedDays = CkJsonObject_IntOf(jResp,"items[i].shipments[j].tracking.estimatedDays");
            shippingLabelLabel_url = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shippingLabel.label_url");
            shippingLabelCommercial_invoice_url = CkJsonObject_stringOf(jResp,"items[i].shipments[j].shippingLabel.commercial_invoice_url");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"items[i].taxesOnShipping");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            name = CkJsonObject_stringOf(jResp,"items[i].taxesOnShipping[j].name");
            value = CkJsonObject_IntOf(jResp,"items[i].taxesOnShipping[j].value");
            total_str = CkJsonObject_stringOf(jResp,"items[i].taxesOnShipping[j].total");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObject_SizeOfArray(jResp,"items[i].orderExtraFields");
        while (j < count_j) {
            CkJsonObject_putJ(jResp,j);
            id = CkJsonObject_stringOf(jResp,"items[i].orderExtraFields[j].id");
            value_str = CkJsonObject_stringOf(jResp,"items[i].orderExtraFields[j].value");
            customerInputType = CkJsonObject_stringOf(jResp,"items[i].orderExtraFields[j].customerInputType");
            title = CkJsonObject_stringOf(jResp,"items[i].orderExtraFields[j].title");
            orderDetailsDisplaySection = CkJsonObject_stringOf(jResp,"items[i].orderExtraFields[j].orderDetailsDisplaySection");
            orderBy = CkJsonObject_stringOf(jResp,"items[i].orderExtraFields[j].orderBy");
            j = j + 1;
        }

        i = i + 1;
    }



    CkHttp_Dispose(http);
    CkJsonObject_Dispose(jsonToken);
    CkJsonObject_Dispose(params);
    CkHttpResponse_Dispose(resp);
    CkStringBuilder_Dispose(sbResponseBody);
    CkJsonObject_Dispose(jResp);
    CkJsonObject_Dispose(json1);

    }