Sample code for 30+ languages & platforms
PureBasic

MercadoLibre - Search Orders from a Buyer

See more MercadoLibre Examples

Search for orders from a buyer.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkHttp.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkJsonObject.pb"
IncludeFile "CkDtObj.pb"

Procedure ChilkatExample()

    success.i = 0

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

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    ; First get our previously obtained OAuth2 access token.
    jsonToken.i = CkJsonObject::ckCreate()
    If jsonToken.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success = CkJsonObject::ckLoadFile(jsonToken,"qa_data/tokens/mercadolibre.json")

    ; Implements the following CURL command:

    ; curl -X GET https://api.mercadolibre.com/orders/search?buyer=$BUYER_ID&access_token=$ACCESS_TOKEN

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

    CkHttp::ckSetUrlVar(http,"access_token",CkJsonObject::ckStringOf(jsonToken,"access_token"))
    ; Use an actual buyer ID here..
    CkHttp::ckSetUrlVar(http,"buyer_id","577815702")

    sbResponseBody.i = CkStringBuilder::ckCreate()
    If sbResponseBody.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success = CkHttp::ckQuickGetSb(http,"https://api.mercadolibre.com/orders/search?buyer={$buyer_id}&access_token={$access_token}",sbResponseBody)
    If success = 0
        Debug CkHttp::ckLastErrorText(http)
        Debug "Response Header:"
        Debug CkHttp::ckLastHeader(http)
        Debug "----"
        Debug "Response Body:"
        Debug CkStringBuilder::ckGetAsString(sbResponseBody)
        Debug "Failed."
        CkHttp::ckDispose(http)
        CkJsonObject::ckDispose(jsonToken)
        CkStringBuilder::ckDispose(sbResponseBody)
        ProcedureReturn
    EndIf

    jResp.i = CkJsonObject::ckCreate()
    If jResp.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkJsonObject::ckLoadSb(jResp,sbResponseBody)
    CkJsonObject::setCkEmitCompact(jResp, 0)

    Debug "Response Body:"
    Debug CkJsonObject::ckEmit(jResp)

    respStatusCode.i = CkHttp::ckLastStatus(http)
    Debug "Response Status Code = " + Str(respStatusCode)
    If respStatusCode >= 400
        Debug "Response Header:"
        Debug CkHttp::ckLastHeader(http)
        Debug "----"
        Debug "Response Body:"
        Debug CkStringBuilder::ckGetAsString(sbResponseBody)
        Debug "Failed."
        CkHttp::ckDispose(http)
        CkJsonObject::ckDispose(jsonToken)
        CkStringBuilder::ckDispose(sbResponseBody)
        CkJsonObject::ckDispose(jResp)
        ProcedureReturn
    EndIf

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

    ; {
    ;   "query": "2032217210",
    ;   "results": [
    ;     {
    ;       "seller": {
    ;         "phone": {
    ;           "number": "11971427863",
    ;           "extension": "",
    ;           "area_code": null,
    ;           "verified": false
    ;         },
    ;         "alternative_phone": {
    ;           "number": "",
    ;           "extension": "",
    ;           "area_code": ""
    ;         },
    ;         "nickname": "VENDASDKMB",
    ;         "last_name": "Cheracomo",
    ;         "id": 239432672,
    ;         "first_name": "Demétrio",
    ;         "email": "dcherac.8m6k0q+2-ogiydgmrsge3tenby@mail.mercadolivre.com"
    ;       },
    ;       "payments": [
    ;         {
    ;           "reason": "Kit Com 03 Adesivo Spray 3m 75 Cola Silk Sublimação 300g",
    ;           "status_code": null,
    ;           "total_paid_amount": 129.95,
    ;           "operation_type": "regular_payment",
    ;           "transaction_amount": 129.95,
    ;           "date_approved": "2019-05-22T03:51:07.000-04:00",
    ;           "collector": {
    ;             "id": 239432672
    ;           },
    ;           "coupon_id": null,
    ;           "installments": 1,
    ;           "authorization_code": "008877",
    ;           "taxes_amount": 0,
    ;           "id": 4792155710,
    ;           "date_last_modified": "2019-05-22T03:51:07.000-04:00",
    ;           "coupon_amount": 0,
    ;           "available_actions": [
    ;             "refund"
    ;           ],
    ;           "shipping_cost": 0,
    ;           "installment_amount": 129.95,
    ;           "date_created": "2019-05-22T03:51:05.000-04:00",
    ;           "activation_uri": null,
    ;           "overpaid_amount": 0,
    ;           "card_id": 203453778,
    ;           "status_detail": "accredited",
    ;           "issuer_id": "24",
    ;           "payment_method_id": "master",
    ;           "payment_type": "credit_card",
    ;           "deferred_period": null,
    ;           "atm_transfer_reference": {
    ;             "transaction_id": "135292",
    ;             "company_id": null
    ;           },
    ;           "site_id": "MLB",
    ;           "payer_id": 89660613,
    ;           "marketplace_fee": 14.290000000000001,
    ;           "order_id": 2032217210,
    ;           "currency_id": "BRL",
    ;           "status": "approved",
    ;           "transaction_order_id": null
    ;         }
    ;       ],
    ;       "fulfilled": true,
    ;       "buying_mode": "buy_equals_pay",
    ;       "taxes": {
    ;         "amount": null,
    ;         "currency_id": null
    ;       },
    ;       "order_request": {
    ;         "change": null,
    ;         "return": null
    ;       },
    ;       "expiration_date": "2019-06-19T03:51:07.000-04:00",
    ;       "feedback": {
    ;         "sale": null,
    ;         "purchase": null
    ;       },
    ;       "shipping": {
    ;         "id": 27968238880
    ;       },
    ;       "date_closed": "2019-05-22T03:51:07.000-04:00",
    ;       "id": 2032217210,
    ;       "manufacturing_ending_date": null,
    ;       "hidden_for_seller": false,
    ;       "order_items": [
    ;         {
    ;           "item": {
    ;             "seller_custom_field": null,
    ;             "condition": "new",
    ;             "category_id": "MLB33383",
    ;             "variation_id": null,
    ;             "variation_attributes": [
    ;             ],
    ;             "seller_sku": null,
    ;             "warranty": "Garantia de 1 ano fabricante",
    ;             "id": "MLB1054990648",
    ;             "title": "Kit Com 03 Adesivo Spray 3m 75 Cola Silk Sublimação 300g"
    ;           },
    ;           "quantity": 1,
    ;           "differential_pricing_id": null,
    ;           "sale_fee": 14.29,
    ;           "listing_type_id": "gold_special",
    ;           "base_currency_id": null,
    ;           "unit_price": 129.95,
    ;           "full_unit_price": 129.95,
    ;           "base_exchange_rate": null,
    ;           "currency_id": "BRL",
    ;           "manufacturing_days": null
    ;         }
    ;       ],
    ;       "date_last_updated": "2020-02-14T02:55:49.811Z",
    ;       "last_updated": "2019-05-28T15:16:04.000-04:00",
    ;       "comments": null,
    ;       "pack_id": null,
    ;       "coupon": {
    ;         "amount": 0,
    ;         "id": null
    ;       },
    ;       "shipping_cost": 0,
    ;       "date_created": "2019-05-22T03:51:05.000-04:00",
    ;       "application_id": "7092",
    ;       "pickup_id": null,
    ;       "status_detail": null,
    ;       "tags": [
    ;         "delivered",
    ;         "paid"
    ;       ],
    ;       "buyer": {
    ;         "billing_info": {
    ;           "doc_number": "02183212950",
    ;           "doc_type": "CPF"
    ;         },
    ;         "phone": {
    ;           "number": "99962663",
    ;           "extension": "",
    ;           "area_code": "41",
    ;           "verified": false
    ;         },
    ;         "alternative_phone": {
    ;           "number": "30576339",
    ;           "extension": "",
    ;           "area_code": "41"
    ;         },
    ;         "nickname": "S.VICTORHUGO",
    ;         "last_name": "Schemberger",
    ;         "id": 89660613,
    ;         "first_name": "Victor Hugo",
    ;         "email": "vschemb.y14cdz+2-ogiydgmrsge3tenbz@mail.mercadolivre.com"
    ;       },
    ;       "total_amount": 129.95,
    ;       "paid_amount": 129.95,
    ;       "mediations": [
    ;       ],
    ;       "currency_id": "BRL",
    ;       "status": "paid"
    ;     }
    ;   ],
    ;   "sort": {
    ;     "id": "date_asc",
    ;     "name": "Date ascending"
    ;   },
    ;   "available_sorts": [
    ;     {
    ;       "id": "date_desc",
    ;       "name": "Date descending"
    ;     }
    ;   ],
    ;   "filters": [
    ;   ],
    ;   "paging": {
    ;     "total": 1,
    ;     "offset": 0,
    ;     "limit": 50
    ;   },
    ;   "display": "complete"
    ; }

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

    date_closed.i = CkDtObj::ckCreate()
    If date_closed.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    date_last_updated.i = CkDtObj::ckCreate()
    If date_last_updated.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    date_created.i = CkDtObj::ckCreate()
    If date_created.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    date_approved.i = CkDtObj::ckCreate()
    If date_approved.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    date_last_modified.i = CkDtObj::ckCreate()
    If date_last_modified.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    sellerPhoneNumber.s
    sellerPhoneExtension.s
    sellerPhoneArea_code.s
    sellerPhoneVerified.i
    sellerAlternative_phoneNumber.s
    sellerAlternative_phoneExtension.s
    sellerAlternative_phoneArea_code.s
    sellerNickname.s
    sellerLast_name.s
    sellerId.i
    sellerFirst_name.s
    sellerEmail.s
    fulfilled.i
    buying_mode.s
    taxesAmount.s
    taxesCurrency_id.s
    order_requestChange.s
    order_requestReturn.s
    expiration_date.s
    feedbackSale.s
    feedbackPurchase.s
    shippingId.i
    id.i
    manufacturing_ending_date.s
    hidden_for_seller.i
    last_updated.s
    comments.s
    pack_id.s
    couponAmount.i
    couponId.s
    shipping_cost.i
    application_id.s
    pickup_id.s
    status_detail.s
    buyerBilling_infoDoc_number.s
    buyerBilling_infoDoc_type.s
    buyerPhoneNumber.s
    buyerPhoneExtension.s
    buyerPhoneArea_code.s
    buyerPhoneVerified.i
    buyerAlternative_phoneNumber.s
    buyerAlternative_phoneExtension.s
    buyerAlternative_phoneArea_code.s
    buyerNickname.s
    buyerLast_name.s
    buyerId.i
    buyerFirst_name.s
    buyerEmail.s
    total_amount.s
    paid_amount.s
    currency_id.s
    status.s
    j.i
    count_j.i
    reason.s
    status_code.s
    total_paid_amount.s
    operation_type.s
    transaction_amount.s
    collectorId.i
    coupon_id.s
    installments.i
    authorization_code.s
    taxes_amount.i
    coupon_amount.i
    installment_amount.s
    activation_uri.s
    overpaid_amount.i
    card_id.i
    issuer_id.s
    payment_method_id.s
    payment_type.s
    deferred_period.s
    atm_transfer_referenceTransaction_id.s
    atm_transfer_referenceCompany_id.s
    site_id.s
    payer_id.i
    marketplace_fee.s
    order_id.i
    transaction_order_id.s
    k.i
    count_k.i
    strVal.s
    itemSeller_custom_field.s
    itemCondition.s
    itemCategory_id.s
    itemVariation_id.s
    itemSeller_sku.s
    itemWarranty.s
    itemId.s
    itemTitle.s
    quantity.i
    differential_pricing_id.s
    sale_fee.s
    listing_type_id.s
    base_currency_id.s
    unit_price.s
    full_unit_price.s
    base_exchange_rate.s
    manufacturing_days.s
    id_str.s
    name.s

    query.s = CkJsonObject::ckStringOf(jResp,"query")
    sortId.s = CkJsonObject::ckStringOf(jResp,"sort.id")
    sortName.s = CkJsonObject::ckStringOf(jResp,"sort.name")
    pagingTotal.i = CkJsonObject::ckIntOf(jResp,"paging.total")
    pagingOffset.i = CkJsonObject::ckIntOf(jResp,"paging.offset")
    pagingLimit.i = CkJsonObject::ckIntOf(jResp,"paging.limit")
    display.s = CkJsonObject::ckStringOf(jResp,"display")
    i.i = 0
    count_i.i = CkJsonObject::ckSizeOfArray(jResp,"results")
    While i < count_i
        CkJsonObject::setCkI(jResp, i)
        sellerPhoneNumber = CkJsonObject::ckStringOf(jResp,"results[i].seller.phone.number")
        sellerPhoneExtension = CkJsonObject::ckStringOf(jResp,"results[i].seller.phone.extension")
        sellerPhoneArea_code = CkJsonObject::ckStringOf(jResp,"results[i].seller.phone.area_code")
        sellerPhoneVerified = CkJsonObject::ckBoolOf(jResp,"results[i].seller.phone.verified")
        sellerAlternative_phoneNumber = CkJsonObject::ckStringOf(jResp,"results[i].seller.alternative_phone.number")
        sellerAlternative_phoneExtension = CkJsonObject::ckStringOf(jResp,"results[i].seller.alternative_phone.extension")
        sellerAlternative_phoneArea_code = CkJsonObject::ckStringOf(jResp,"results[i].seller.alternative_phone.area_code")
        sellerNickname = CkJsonObject::ckStringOf(jResp,"results[i].seller.nickname")
        sellerLast_name = CkJsonObject::ckStringOf(jResp,"results[i].seller.last_name")
        sellerId = CkJsonObject::ckIntOf(jResp,"results[i].seller.id")
        sellerFirst_name = CkJsonObject::ckStringOf(jResp,"results[i].seller.first_name")
        sellerEmail = CkJsonObject::ckStringOf(jResp,"results[i].seller.email")
        fulfilled = CkJsonObject::ckBoolOf(jResp,"results[i].fulfilled")
        buying_mode = CkJsonObject::ckStringOf(jResp,"results[i].buying_mode")
        taxesAmount = CkJsonObject::ckStringOf(jResp,"results[i].taxes.amount")
        taxesCurrency_id = CkJsonObject::ckStringOf(jResp,"results[i].taxes.currency_id")
        order_requestChange = CkJsonObject::ckStringOf(jResp,"results[i].order_request.change")
        order_requestReturn = CkJsonObject::ckStringOf(jResp,"results[i].order_request.return")
        expiration_date = CkJsonObject::ckStringOf(jResp,"results[i].expiration_date")
        feedbackSale = CkJsonObject::ckStringOf(jResp,"results[i].feedback.sale")
        feedbackPurchase = CkJsonObject::ckStringOf(jResp,"results[i].feedback.purchase")
        shippingId = CkJsonObject::ckIntOf(jResp,"results[i].shipping.id")
        CkJsonObject::ckDtOf(jResp,"results[i].date_closed",0,date_closed)
        id = CkJsonObject::ckIntOf(jResp,"results[i].id")
        manufacturing_ending_date = CkJsonObject::ckStringOf(jResp,"results[i].manufacturing_ending_date")
        hidden_for_seller = CkJsonObject::ckBoolOf(jResp,"results[i].hidden_for_seller")
        CkJsonObject::ckDtOf(jResp,"results[i].date_last_updated",0,date_last_updated)
        last_updated = CkJsonObject::ckStringOf(jResp,"results[i].last_updated")
        comments = CkJsonObject::ckStringOf(jResp,"results[i].comments")
        pack_id = CkJsonObject::ckStringOf(jResp,"results[i].pack_id")
        couponAmount = CkJsonObject::ckIntOf(jResp,"results[i].coupon.amount")
        couponId = CkJsonObject::ckStringOf(jResp,"results[i].coupon.id")
        shipping_cost = CkJsonObject::ckIntOf(jResp,"results[i].shipping_cost")
        CkJsonObject::ckDtOf(jResp,"results[i].date_created",0,date_created)
        application_id = CkJsonObject::ckStringOf(jResp,"results[i].application_id")
        pickup_id = CkJsonObject::ckStringOf(jResp,"results[i].pickup_id")
        status_detail = CkJsonObject::ckStringOf(jResp,"results[i].status_detail")
        buyerBilling_infoDoc_number = CkJsonObject::ckStringOf(jResp,"results[i].buyer.billing_info.doc_number")
        buyerBilling_infoDoc_type = CkJsonObject::ckStringOf(jResp,"results[i].buyer.billing_info.doc_type")
        buyerPhoneNumber = CkJsonObject::ckStringOf(jResp,"results[i].buyer.phone.number")
        buyerPhoneExtension = CkJsonObject::ckStringOf(jResp,"results[i].buyer.phone.extension")
        buyerPhoneArea_code = CkJsonObject::ckStringOf(jResp,"results[i].buyer.phone.area_code")
        buyerPhoneVerified = CkJsonObject::ckBoolOf(jResp,"results[i].buyer.phone.verified")
        buyerAlternative_phoneNumber = CkJsonObject::ckStringOf(jResp,"results[i].buyer.alternative_phone.number")
        buyerAlternative_phoneExtension = CkJsonObject::ckStringOf(jResp,"results[i].buyer.alternative_phone.extension")
        buyerAlternative_phoneArea_code = CkJsonObject::ckStringOf(jResp,"results[i].buyer.alternative_phone.area_code")
        buyerNickname = CkJsonObject::ckStringOf(jResp,"results[i].buyer.nickname")
        buyerLast_name = CkJsonObject::ckStringOf(jResp,"results[i].buyer.last_name")
        buyerId = CkJsonObject::ckIntOf(jResp,"results[i].buyer.id")
        buyerFirst_name = CkJsonObject::ckStringOf(jResp,"results[i].buyer.first_name")
        buyerEmail = CkJsonObject::ckStringOf(jResp,"results[i].buyer.email")
        total_amount = CkJsonObject::ckStringOf(jResp,"results[i].total_amount")
        paid_amount = CkJsonObject::ckStringOf(jResp,"results[i].paid_amount")
        currency_id = CkJsonObject::ckStringOf(jResp,"results[i].currency_id")
        status = CkJsonObject::ckStringOf(jResp,"results[i].status")
        j = 0
        count_j = CkJsonObject::ckSizeOfArray(jResp,"results[i].payments")
        While j < count_j
            CkJsonObject::setCkJ(jResp, j)
            reason = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].reason")
            status_code = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].status_code")
            total_paid_amount = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].total_paid_amount")
            operation_type = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].operation_type")
            transaction_amount = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].transaction_amount")
            CkJsonObject::ckDtOf(jResp,"results[i].payments[j].date_approved",0,date_approved)
            collectorId = CkJsonObject::ckIntOf(jResp,"results[i].payments[j].collector.id")
            coupon_id = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].coupon_id")
            installments = CkJsonObject::ckIntOf(jResp,"results[i].payments[j].installments")
            authorization_code = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].authorization_code")
            taxes_amount = CkJsonObject::ckIntOf(jResp,"results[i].payments[j].taxes_amount")
            id = CkJsonObject::ckIntOf(jResp,"results[i].payments[j].id")
            CkJsonObject::ckDtOf(jResp,"results[i].payments[j].date_last_modified",0,date_last_modified)
            coupon_amount = CkJsonObject::ckIntOf(jResp,"results[i].payments[j].coupon_amount")
            shipping_cost = CkJsonObject::ckIntOf(jResp,"results[i].payments[j].shipping_cost")
            installment_amount = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].installment_amount")
            CkJsonObject::ckDtOf(jResp,"results[i].payments[j].date_created",0,date_created)
            activation_uri = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].activation_uri")
            overpaid_amount = CkJsonObject::ckIntOf(jResp,"results[i].payments[j].overpaid_amount")
            card_id = CkJsonObject::ckIntOf(jResp,"results[i].payments[j].card_id")
            status_detail = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].status_detail")
            issuer_id = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].issuer_id")
            payment_method_id = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].payment_method_id")
            payment_type = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].payment_type")
            deferred_period = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].deferred_period")
            atm_transfer_referenceTransaction_id = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].atm_transfer_reference.transaction_id")
            atm_transfer_referenceCompany_id = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].atm_transfer_reference.company_id")
            site_id = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].site_id")
            payer_id = CkJsonObject::ckIntOf(jResp,"results[i].payments[j].payer_id")
            marketplace_fee = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].marketplace_fee")
            order_id = CkJsonObject::ckIntOf(jResp,"results[i].payments[j].order_id")
            currency_id = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].currency_id")
            status = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].status")
            transaction_order_id = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].transaction_order_id")
            k = 0
            count_k = CkJsonObject::ckSizeOfArray(jResp,"results[i].payments[j].available_actions")
            While k < count_k
                CkJsonObject::setCkK(jResp, k)
                strVal = CkJsonObject::ckStringOf(jResp,"results[i].payments[j].available_actions[k]")
                k = k + 1
            Wend
            j = j + 1
        Wend
        j = 0
        count_j = CkJsonObject::ckSizeOfArray(jResp,"results[i].order_items")
        While j < count_j
            CkJsonObject::setCkJ(jResp, j)
            itemSeller_custom_field = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].item.seller_custom_field")
            itemCondition = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].item.condition")
            itemCategory_id = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].item.category_id")
            itemVariation_id = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].item.variation_id")
            itemSeller_sku = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].item.seller_sku")
            itemWarranty = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].item.warranty")
            itemId = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].item.id")
            itemTitle = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].item.title")
            quantity = CkJsonObject::ckIntOf(jResp,"results[i].order_items[j].quantity")
            differential_pricing_id = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].differential_pricing_id")
            sale_fee = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].sale_fee")
            listing_type_id = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].listing_type_id")
            base_currency_id = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].base_currency_id")
            unit_price = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].unit_price")
            full_unit_price = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].full_unit_price")
            base_exchange_rate = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].base_exchange_rate")
            currency_id = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].currency_id")
            manufacturing_days = CkJsonObject::ckStringOf(jResp,"results[i].order_items[j].manufacturing_days")
            k = 0
            count_k = CkJsonObject::ckSizeOfArray(jResp,"results[i].order_items[j].item.variation_attributes")
            While k < count_k
                CkJsonObject::setCkK(jResp, k)
                k = k + 1
            Wend
            j = j + 1
        Wend
        j = 0
        count_j = CkJsonObject::ckSizeOfArray(jResp,"results[i].tags")
        While j < count_j
            CkJsonObject::setCkJ(jResp, j)
            strVal = CkJsonObject::ckStringOf(jResp,"results[i].tags[j]")
            j = j + 1
        Wend
        j = 0
        count_j = CkJsonObject::ckSizeOfArray(jResp,"results[i].mediations")
        While j < count_j
            CkJsonObject::setCkJ(jResp, j)
            j = j + 1
        Wend
        i = i + 1
    Wend
    i = 0
    count_i = CkJsonObject::ckSizeOfArray(jResp,"available_sorts")
    While i < count_i
        CkJsonObject::setCkI(jResp, i)
        id_str = CkJsonObject::ckStringOf(jResp,"available_sorts[i].id")
        name = CkJsonObject::ckStringOf(jResp,"available_sorts[i].name")
        i = i + 1
    Wend
    i = 0
    count_i = CkJsonObject::ckSizeOfArray(jResp,"filters")
    While i < count_i
        CkJsonObject::setCkI(jResp, i)
        i = i + 1
    Wend


    CkHttp::ckDispose(http)
    CkJsonObject::ckDispose(jsonToken)
    CkStringBuilder::ckDispose(sbResponseBody)
    CkJsonObject::ckDispose(jResp)
    CkDtObj::ckDispose(date_closed)
    CkDtObj::ckDispose(date_last_updated)
    CkDtObj::ckDispose(date_created)
    CkDtObj::ckDispose(date_approved)
    CkDtObj::ckDispose(date_last_modified)


    ProcedureReturn
EndProcedure