Sample code for 30+ languages & platforms
Rust Requires Chilkat v11.0.0+

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 Rust Downloads

Rust

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

let http = chilkat::Http::new();

// 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
let json_token = chilkat::JsonObject::new();
let _ = json_token.load_file("qa_data/tokens/ecwid.json");

http.set_request_header("Accept", "application/json");

let params = chilkat::JsonObject::new();
let _ = params.update_int("limit", 100);
let _ = params.update_string("email", "joe@example.com");
let _ = params.update_string("token", &json_token.string_of("access_token").unwrap_or_default());

let resp = chilkat::HttpResponse::new();
if http.http_params("GET", "https://app.ecwid.com/api/v3/storeId/orders", &params, &resp).is_err() {
    println!("{}", http.last_error_text());
    return;
}

let sb_response_body = chilkat::StringBuilder::new();
let _ = resp.get_body_sb(&sb_response_body);
let j_resp = chilkat::JsonObject::new();
let _ = j_resp.load_sb(&sb_response_body);
j_resp.set_emit_compact(false);

println!("Response Body:");
println!("{}", j_resp.emit().unwrap_or_default());

let resp_status_code = resp.status_code();

println!("Response Status Code = {}", resp_status_code);
if resp_status_code != 200 {
    println!("Failed.");
    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

let mut j: i32 = 0;
let mut count_j: i32 = 0;
let mut k: i32 = 0;
let mut count_k: i32 = 0;
let json1 = chilkat::JsonObject::new();
let mut i1: i32 = 0;
let mut count_i1: i32 = 0;

let total = j_resp.int_of("total");
let count = j_resp.int_of("count");
let offset = j_resp.int_of("offset");
let limit = j_resp.int_of("limit");
let mut i = 0;
let count_i = j_resp.size_of_array("items");
while i < count_i {
    j_resp.set_i(i);
    let _ = j_resp.string_of("items[i].id").unwrap_or_default();
    let _ = j_resp.string_of("items[i].subtotal").unwrap_or_default();
    let _ = j_resp.string_of("items[i].total").unwrap_or_default();
    let _ = j_resp.string_of("items[i].giftCardRedemption").unwrap_or_default();
    let _ = j_resp.string_of("items[i].totalBeforeGiftCardRedemption").unwrap_or_default();
    let _ = j_resp.bool_of("items[i].giftCardDoubleSpending");
    let _ = j_resp.string_of("items[i].usdTotal").unwrap_or_default();
    let _ = j_resp.string_of("items[i].tax").unwrap_or_default();
    let _ = j_resp.string_of("items[i].paymentMethod").unwrap_or_default();
    let _ = j_resp.string_of("items[i].paymentStatus").unwrap_or_default();
    let _ = j_resp.string_of("items[i].fulfillmentStatus").unwrap_or_default();
    let _ = j_resp.string_of("items[i].vendorOrderNumber").unwrap_or_default();
    let _ = j_resp.int_of("items[i].orderNumber");
    let _ = j_resp.string_of("items[i].refererUrl").unwrap_or_default();
    let _ = j_resp.string_of("items[i].globalReferer").unwrap_or_default();
    let _ = j_resp.string_of("items[i].createDate").unwrap_or_default();
    let _ = j_resp.string_of("items[i].updateDate").unwrap_or_default();
    let _ = j_resp.int_of("items[i].createTimestamp");
    let _ = j_resp.int_of("items[i].updateTimestamp");
    let _ = j_resp.bool_of("items[i].hidden");
    let _ = j_resp.string_of("items[i].orderComments").unwrap_or_default();
    let _ = j_resp.string_of("items[i].privateAdminNotes").unwrap_or_default();
    let _ = j_resp.string_of("items[i].email").unwrap_or_default();
    let _ = j_resp.string_of("items[i].ipAddress").unwrap_or_default();
    let _ = j_resp.int_of("items[i].customerId");
    let _ = j_resp.int_of("items[i].customerGroupId");
    let _ = j_resp.string_of("items[i].customerGroup").unwrap_or_default();
    let _ = j_resp.bool_of("items[i].customerTaxExempt");
    let _ = j_resp.string_of("items[i].customerTaxId").unwrap_or_default();
    let _ = j_resp.bool_of("items[i].customerTaxIdValid");
    let _ = j_resp.bool_of("items[i].reversedTaxApplied");
    let _ = j_resp.int_of("items[i].discount");
    let _ = j_resp.int_of("items[i].couponDiscount");
    let _ = j_resp.int_of("items[i].volumeDiscount");
    let _ = j_resp.int_of("items[i].membershipBasedDiscount");
    let _ = j_resp.int_of("items[i].totalAndMembershipBasedDiscount");
    let _ = j_resp.int_of("items[i].discountCoupon.id");
    let _ = j_resp.string_of("items[i].discountCoupon.name").unwrap_or_default();
    let _ = j_resp.string_of("items[i].discountCoupon.code").unwrap_or_default();
    let _ = j_resp.string_of("items[i].discountCoupon.discountType").unwrap_or_default();
    let _ = j_resp.string_of("items[i].discountCoupon.status").unwrap_or_default();
    let _ = j_resp.int_of("items[i].discountCoupon.discount");
    let _ = j_resp.string_of("items[i].discountCoupon.launchDate").unwrap_or_default();
    let _ = j_resp.string_of("items[i].discountCoupon.usesLimit").unwrap_or_default();
    let _ = j_resp.string_of("items[i].discountCoupon.applicationLimit").unwrap_or_default();
    let _ = j_resp.string_of("items[i].discountCoupon.creationDate").unwrap_or_default();
    let _ = j_resp.string_of("items[i].discountCoupon.updateDate").unwrap_or_default();
    let _ = j_resp.int_of("items[i].discountCoupon.orderCount");
    let _ = j_resp.string_of("items[i].refundedAmount").unwrap_or_default();
    let _ = j_resp.string_of("items[i].billingPerson.name").unwrap_or_default();
    let _ = j_resp.string_of("items[i].billingPerson.companyName").unwrap_or_default();
    let _ = j_resp.string_of("items[i].billingPerson.street").unwrap_or_default();
    let _ = j_resp.string_of("items[i].billingPerson.city").unwrap_or_default();
    let _ = j_resp.string_of("items[i].billingPerson.countryCode").unwrap_or_default();
    let _ = j_resp.string_of("items[i].billingPerson.countryName").unwrap_or_default();
    let _ = j_resp.string_of("items[i].billingPerson.postalCode").unwrap_or_default();
    let _ = j_resp.string_of("items[i].billingPerson.stateOrProvinceCode").unwrap_or_default();
    let _ = j_resp.string_of("items[i].billingPerson.stateOrProvinceName").unwrap_or_default();
    let _ = j_resp.string_of("items[i].billingPerson.phone").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingPerson.name").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingPerson.companyName").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingPerson.street").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingPerson.city").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingPerson.countryCode").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingPerson.countryName").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingPerson.postalCode").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingPerson.stateOrProvinceCode").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingPerson.stateOrProvinceName").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingPerson.phone").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingOption.shippingCarrierName").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingOption.shippingMethodName").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingOption.shippingRate").unwrap_or_default();
    let _ = j_resp.string_of("items[i].shippingOption.estimatedTransitTime").unwrap_or_default();
    let _ = j_resp.bool_of("items[i].shippingOption.isPickup");
    let _ = j_resp.string_of("items[i].handlingFee.name").unwrap_or_default();
    let _ = j_resp.int_of("items[i].handlingFee.value");
    let _ = j_resp.string_of("items[i].handlingFee.description").unwrap_or_default();
    let _ = j_resp.string_of("items[i].paymentModule").unwrap_or_default();
    let _ = j_resp.string_of("items[i].additionalInfo.google_customer_id").unwrap_or_default();
    let _ = j_resp.bool_of("items[i].acceptMarketing");
    let _ = j_resp.string_of("items[i].refererId").unwrap_or_default();
    let _ = j_resp.bool_of("items[i].disableAllCustomerNotifications");
    let _ = j_resp.bool_of("items[i].externalFulfillment");
    let _ = j_resp.bool_of("items[i].pricesIncludeTax");
    j = 0;
    count_j = j_resp.size_of_array("items[i].customDiscount");
    while j < count_j {
        j_resp.set_j(j);
        j = j + 1;
    }

    j = 0;
    count_j = j_resp.size_of_array("items[i].discountInfo");
    while j < count_j {
        j_resp.set_j(j);
        let _ = j_resp.int_of("items[i].discountInfo[j].value");
        let _ = j_resp.string_of("items[i].discountInfo[j].type").unwrap_or_default();
        let _ = j_resp.string_of("items[i].discountInfo[j].base").unwrap_or_default();
        let _ = j_resp.int_of("items[i].discountInfo[j].orderTotal");
        j = j + 1;
    }

    j = 0;
    count_j = j_resp.size_of_array("items[i].items");
    while j < count_j {
        j_resp.set_j(j);
        let _ = j_resp.int_of("items[i].items[j].id");
        let _ = j_resp.int_of("items[i].items[j].productId");
        let _ = j_resp.int_of("items[i].items[j].categoryId");
        let _ = j_resp.int_of("items[i].items[j].price");
        let _ = j_resp.int_of("items[i].items[j].productPrice");
        let _ = j_resp.string_of("items[i].items[j].sku").unwrap_or_default();
        let _ = j_resp.int_of("items[i].items[j].quantity");
        let _ = j_resp.string_of("items[i].items[j].shortDescription").unwrap_or_default();
        let _ = j_resp.string_of("items[i].items[j].tax").unwrap_or_default();
        let _ = j_resp.int_of("items[i].items[j].shipping");
        let _ = j_resp.int_of("items[i].items[j].quantityInStock");
        let _ = j_resp.string_of("items[i].items[j].name").unwrap_or_default();
        let _ = j_resp.bool_of("items[i].items[j].isShippingRequired");
        let _ = j_resp.int_of("items[i].items[j].weight");
        let _ = j_resp.bool_of("items[i].items[j].trackQuantity");
        let _ = j_resp.bool_of("items[i].items[j].fixedShippingRateOnly");
        let _ = j_resp.string_of("items[i].items[j].imageUrl").unwrap_or_default();
        let _ = j_resp.string_of("items[i].items[j].smallThumbnailUrl").unwrap_or_default();
        let _ = j_resp.string_of("items[i].items[j].hdThumbnailUrl").unwrap_or_default();
        let _ = j_resp.int_of("items[i].items[j].fixedShippingRate");
        let _ = j_resp.bool_of("items[i].items[j].digital");
        let _ = j_resp.bool_of("items[i].items[j].couponApplied");
        let _ = j_resp.int_of("items[i].items[j].dimensions.length");
        let _ = j_resp.int_of("items[i].items[j].dimensions.width");
        let _ = j_resp.int_of("items[i].items[j].dimensions.height");
        let _ = j_resp.string_of("items[i].items[j].couponAmount").unwrap_or_default();
        let _ = j_resp.int_of("items[i].items[j].subscriptionId");
        let _ = j_resp.string_of("items[i].items[j].recurringChargeSettings.recurringInterval").unwrap_or_default();
        let _ = j_resp.int_of("items[i].items[j].recurringChargeSettings.recurringIntervalCount");
        k = 0;
        count_k = j_resp.size_of_array("items[i].items[j].selectedOptions");
        while k < count_k {
            j_resp.set_k(k);
            let _ = j_resp.string_of("items[i].items[j].selectedOptions[k].name").unwrap_or_default();
            let _ = j_resp.string_of("items[i].items[j].selectedOptions[k].value").unwrap_or_default();
            let _ = j_resp.string_of("items[i].items[j].selectedOptions[k].type").unwrap_or_default();
            let _ = j_resp.object_of2("items[i].items[j].selectedOptions[k]", &json1);

            i1 = 0;
            count_i1 = json1.size_of_array("valuesArray");
            while i1 < count_i1 {
                json1.set_i(i1);
                let _ = json1.string_of("valuesArray[i]").unwrap_or_default();
                i1 = i1 + 1;
            }

            let _ = j_resp.object_of2("items[i].items[j].selectedOptions[k]", &json1);
            i1 = 0;
            count_i1 = json1.size_of_array("selections");
            while i1 < count_i1 {
                json1.set_i(i1);
                let _ = json1.string_of("selections[i].selectionTitle").unwrap_or_default();
                let _ = json1.int_of("selections[i].selectionModifier");
                let _ = json1.string_of("selections[i].selectionModifierType").unwrap_or_default();
                i1 = i1 + 1;
            }

            k = k + 1;
        }

        k = 0;
        count_k = j_resp.size_of_array("items[i].items[j].taxes");
        while k < count_k {
            j_resp.set_k(k);
            let _ = j_resp.string_of("items[i].items[j].taxes[k].name").unwrap_or_default();
            let _ = j_resp.int_of("items[i].items[j].taxes[k].value");
            let _ = j_resp.string_of("items[i].items[j].taxes[k].total").unwrap_or_default();
            let _ = j_resp.string_of("items[i].items[j].taxes[k].taxOnDiscountedSubtotal").unwrap_or_default();
            let _ = j_resp.int_of("items[i].items[j].taxes[k].taxOnShipping");
            let _ = j_resp.bool_of("items[i].items[j].taxes[k].includeInPrice");
            k = k + 1;
        }

        k = 0;
        count_k = j_resp.size_of_array("items[i].items[j].discounts");
        while k < count_k {
            j_resp.set_k(k);
            let _ = j_resp.int_of("items[i].items[j].discounts[k].discountInfo.value");
            let _ = j_resp.string_of("items[i].items[j].discounts[k].discountInfo.type").unwrap_or_default();
            let _ = j_resp.string_of("items[i].items[j].discounts[k].discountInfo.base").unwrap_or_default();
            let _ = j_resp.int_of("items[i].items[j].discounts[k].discountInfo.orderTotal");
            let _ = j_resp.string_of("items[i].items[j].discounts[k].total").unwrap_or_default();
            k = k + 1;
        }

        j = j + 1;
    }

    j = 0;
    count_j = j_resp.size_of_array("items[i].refunds");
    while j < count_j {
        j_resp.set_j(j);
        let _ = j_resp.string_of("items[i].refunds[j].date").unwrap_or_default();
        let _ = j_resp.string_of("items[i].refunds[j].source").unwrap_or_default();
        let _ = j_resp.string_of("items[i].refunds[j].reason").unwrap_or_default();
        let _ = j_resp.string_of("items[i].refunds[j].amount").unwrap_or_default();
        j = j + 1;
    }

    j = 0;
    count_j = j_resp.size_of_array("items[i].predictedPackage");
    while j < count_j {
        j_resp.set_j(j);
        let _ = j_resp.int_of("items[i].predictedPackage[j].length");
        let _ = j_resp.int_of("items[i].predictedPackage[j].width");
        let _ = j_resp.int_of("items[i].predictedPackage[j].height");
        let _ = j_resp.string_of("items[i].predictedPackage[j].weight").unwrap_or_default();
        let _ = j_resp.string_of("items[i].predictedPackage[j].declaredValue").unwrap_or_default();
        j = j + 1;
    }

    j = 0;
    count_j = j_resp.size_of_array("items[i].shipments");
    while j < count_j {
        j_resp.set_j(j);
        let _ = j_resp.string_of("items[i].shipments[j].id").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].created").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipTo.name").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipTo.companyName").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipTo.street").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipTo.city").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipTo.countryCode").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipTo.countryName").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipTo.postalCode").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipTo.stateOrProvinceCode").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipTo.stateOrProvinceName").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipTo.phone").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipFrom.companyName").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipFrom.street").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipFrom.city").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipFrom.countryCode").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipFrom.countryName").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipFrom.postalCode").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipFrom.stateOrProvinceCode").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipFrom.stateOrProvinceName").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shipFrom.phone").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].parcel.weight").unwrap_or_default();
        let _ = j_resp.int_of("items[i].shipments[j].parcel.weightUnit");
        let _ = j_resp.int_of("items[i].shipments[j].parcel.width");
        let _ = j_resp.int_of("items[i].shipments[j].parcel.height");
        let _ = j_resp.int_of("items[i].shipments[j].parcel.length");
        let _ = j_resp.int_of("items[i].shipments[j].parcel.dimensionUnit");
        let _ = j_resp.int_of("items[i].shipments[j].shippingService.carrier");
        let _ = j_resp.int_of("items[i].shipments[j].shippingService.carrierName");
        let _ = j_resp.string_of("items[i].shipments[j].shippingService.carrierServiceName").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shippingService.carrierServiceCode").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].tracking.tracking_number").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].tracking.tracking_url").unwrap_or_default();
        let _ = j_resp.int_of("items[i].shipments[j].tracking.estimatedDays");
        let _ = j_resp.string_of("items[i].shipments[j].shippingLabel.label_url").unwrap_or_default();
        let _ = j_resp.string_of("items[i].shipments[j].shippingLabel.commercial_invoice_url").unwrap_or_default();
        j = j + 1;
    }

    j = 0;
    count_j = j_resp.size_of_array("items[i].taxesOnShipping");
    while j < count_j {
        j_resp.set_j(j);
        let _ = j_resp.string_of("items[i].taxesOnShipping[j].name").unwrap_or_default();
        let _ = j_resp.int_of("items[i].taxesOnShipping[j].value");
        let _ = j_resp.string_of("items[i].taxesOnShipping[j].total").unwrap_or_default();
        j = j + 1;
    }

    j = 0;
    count_j = j_resp.size_of_array("items[i].orderExtraFields");
    while j < count_j {
        j_resp.set_j(j);
        let _ = j_resp.string_of("items[i].orderExtraFields[j].id").unwrap_or_default();
        let _ = j_resp.string_of("items[i].orderExtraFields[j].value").unwrap_or_default();
        let _ = j_resp.string_of("items[i].orderExtraFields[j].customerInputType").unwrap_or_default();
        let _ = j_resp.string_of("items[i].orderExtraFields[j].title").unwrap_or_default();
        let _ = j_resp.string_of("items[i].orderExtraFields[j].orderDetailsDisplaySection").unwrap_or_default();
        let _ = j_resp.string_of("items[i].orderExtraFields[j].orderBy").unwrap_or_default();
        j = j + 1;
    }

    i = i + 1;
}