• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

get customers orders using API

General Discussion
4
17
1.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    boragnit last edited by 2 Oct 2023, 10:20

    Did you fix this?

    A 1 Reply Last reply 3 Oct 2023, 02:54 Reply Quote 0
    • A
      adebayoade @boragnit last edited by 3 Oct 2023, 02:54

      @boragnit Not yet.

      1 Reply Last reply Reply Quote 0
      • A
        Amitk-Webkul last edited by 3 Oct 2023, 04:27

        Hello there,

        Please provide the correct path. Customer orders view path is-

        {{base_url}}/api/v1/customer/orders
        

        If you still facing the same please let us know.
        Thanks.

        A 1 Reply Last reply 3 Oct 2023, 10:49 Reply Quote 0
        • A
          adebayoade @Amitk-Webkul last edited by 3 Oct 2023, 10:49

          @Amitk-Webkul Thanks for the response. I am currently using Bagisto version 1.3.1 and using the V1 prefix returns a 404 error when accessing the API endpoints.

          7bfc3057-e1fe-4608-aed9-850167f441d3-image.png

          1 Reply Last reply Reply Quote 0
          • A
            Amitk-Webkul last edited by 4 Oct 2023, 04:21

            Hello there,

            "Upon reviewing the API, I've noticed that the prefix is not capitalized and there seems to be a missing authorization. These are important aspects that should be addressed for proper functionality and security.

            Please let me know if you still facing the same.
            Thanks.

            A 1 Reply Last reply 4 Oct 2023, 11:33 Reply Quote 0
            • A
              adebayoade @Amitk-Webkul last edited by 4 Oct 2023, 11:33

              @Amitk-Webkul Can you please tell me how to fix this?

              1 Reply Last reply Reply Quote 0
              • A
                Amitk-Webkul last edited by 5 Oct 2023, 04:06

                Hello there,

                Please update the API URL by capitalizing the prefix (V1), and then try authenticating again.

                If you encounter any further issues. please let me know.

                A 1 Reply Last reply 5 Oct 2023, 17:44 Reply Quote 0
                • Referenced by  A Amitk-Webkul 5 Oct 2023, 04:09
                • A
                  adebayoade @Amitk-Webkul last edited by adebayoade 5 Oct 2023, 17:45 5 Oct 2023, 17:44

                  @Amitk-Webkul I can authenticate on this version of Bagisto 1.3.1. The problem is not able to get the customer's orders using the orders endpoint.

                  Upon testing it does not require the 'V1' prefix as required for Bagisto 1.5.1

                  eab52e48-f972-40f7-877b-a38cbcdd4793-image.png

                  1 Reply Last reply Reply Quote 0
                  • A
                    Amitk-Webkul last edited by 6 Oct 2023, 15:18

                    Hello there,

                    Could you please let me know if there have been any customizations made to your project? This information will help me provide you with the most accurate assistance or recommendations moving forward.

                    A 2 Replies Last reply 12 Oct 2023, 06:20 Reply Quote 0
                    • Referenced by  A Amitk-Webkul 6 Oct 2023, 15:21
                    • A
                      adebayoade @Amitk-Webkul last edited by 6 Oct 2023, 15:47

                      @Amitk-Webkul said in get customers orders using API:

                      Hello there,

                      Could you please let me know if there have been any customizations made to your project? This information will help me provide you with the most accurate assistance or recommendations moving forward.

                      I am using a fresh install of Bagisto for this purpose.

                      1 Reply Last reply Reply Quote 0
                      • Referenced by  A adebayoade 6 Oct 2023, 15:48
                      • A
                        adebayoade @Amitk-Webkul last edited by 12 Oct 2023, 06:20

                        @Amitk-Webkul Hello, any update with this?

                        1 Reply Last reply Reply Quote 0
                        • A
                          Amitk-Webkul last edited by 12 Oct 2023, 11:12

                          Hello,

                          Let me some time to find the precise solution.

                          Thanks.

                          A 1 Reply Last reply 20 Oct 2023, 17:32 Reply Quote 0
                          • 8 days later
                          • A
                            adebayoade @Amitk-Webkul last edited by 20 Oct 2023, 17:32

                            @Amitk-Webkul said in get customers orders using API:

                            Hello,

                            Let me some time to find the precise solution.

                            Thanks.

                            I am currently working on the checkout flow. I am able to checkout successfully as a guest but I am getting a 500 error when I hit the save-order endpoint with an authenticated user.

                            I am passing the JWT token. Can you please tell me what could be wrong? @Amitk-Webkul

                            ashish2409 1 Reply Last reply 21 Oct 2023, 04:20 Reply Quote 0
                            • ashish2409
                              ashish2409 @adebayoade last edited by 21 Oct 2023, 04:20

                              @adebayoade
                              Hello there, can you please share the endpoints and screenshot where you are facing the issue, Also do share the screenshots of the Requests which you are passing in Postman.

                              Thank you

                              A 1 Reply Last reply 21 Oct 2023, 06:01 Reply Quote 0
                              • A
                                adebayoade @ashish2409 last edited by adebayoade 21 Oct 2023, 06:13 21 Oct 2023, 06:01

                                @ashish2409 It worked while testing in Postman but got the 500 error from the Axios request on the front end.

                                I have no problem with the save shipment, save address, and save payment endpoints from the Axios request.

                                I get the 500 error when I try to save the order which is the last step.

                                Note that all endpoints worked without issues as a guest.

                                Authenticated:
                                f15d44f1-1f3f-4dad-86fe-50796efbafad-image.png

                                Guest:
                                678a53cf-8b19-4451-97bf-18045e2eacdd-image.png

                                A 1 Reply Last reply 21 Oct 2023, 08:56 Reply Quote 0
                                • A
                                  adebayoade @adebayoade last edited by 21 Oct 2023, 08:56

                                  @adebayoade @Amitk-Webkul @ashish2409 I don't know where the error is coming from but it seems to be failing the Cart::hasError() check on the backend.

                                  Please have a look at my get cart response to see why I can't save the order.

                                  {
                                      "data": {
                                          "rates": [
                                              {
                                                  "carrier_title": "Flat Rate",
                                                  "rates": [
                                                      {
                                                          "id": 1348,
                                                          "carrier": "flatrate",
                                                          "carrier_title": "Flat Rate",
                                                          "method": "flatrate_flatrate",
                                                          "method_title": "Flat Rate",
                                                          "method_description": "Flat Rate Shipping",
                                                          "price": 10,
                                                          "formated_price": "\u20a610",
                                                          "base_price": 10,
                                                          "formated_base_price": "\u20a610.00",
                                                          "created_at": "2023-10-21T08:55:31.000000Z",
                                                          "updated_at": "2023-10-21T08:55:31.000000Z"
                                                      }
                                                  ]
                                              },
                                              {
                                                  "carrier_title": "Free Shipping",
                                                  "rates": [
                                                      {
                                                          "id": 1349,
                                                          "carrier": "free",
                                                          "carrier_title": "Free Shipping",
                                                          "method": "free_free",
                                                          "method_title": "Free Shipping",
                                                          "method_description": "Free Shipping",
                                                          "price": 0,
                                                          "formated_price": "\u20a60",
                                                          "base_price": 0,
                                                          "formated_base_price": "\u20a60.00",
                                                          "created_at": "2023-10-21T08:55:31.000000Z",
                                                          "updated_at": "2023-10-21T08:55:31.000000Z"
                                                      }
                                                  ]
                                              }
                                          ],
                                          "cart": {
                                              "id": 470,
                                              "customer_email": "toyosi@gmail.com",
                                              "customer_first_name": "Toyo",
                                              "customer_last_name": "Si",
                                              "shipping_method": "flatrate_flatrate",
                                              "coupon_code": null,
                                              "is_gift": 0,
                                              "items_count": 1,
                                              "items_qty": "1.0000",
                                              "exchange_rate": null,
                                              "global_currency_code": "NGN",
                                              "base_currency_code": "NGN",
                                              "channel_currency_code": "NGN",
                                              "cart_currency_code": "NGN",
                                              "grand_total": "14010.0000",
                                              "formated_grand_total": "\u20a614,010",
                                              "base_grand_total": "14010.0000",
                                              "formated_base_grand_total": "\u20a614,010.00",
                                              "sub_total": "14000.0000",
                                              "formated_sub_total": "\u20a614,000",
                                              "base_sub_total": "14000.0000",
                                              "formated_base_sub_total": "\u20a614,000.00",
                                              "tax_total": "0.0000",
                                              "formated_tax_total": "\u20a60",
                                              "base_tax_total": "0.0000",
                                              "formated_base_tax_total": "\u20a60.00",
                                              "discount": "0.0000",
                                              "formated_discount": "\u20a60",
                                              "base_discount": "0.0000",
                                              "formated_base_discount": "\u20a60.00",
                                              "checkout_method": null,
                                              "is_guest": 0,
                                              "is_active": 1,
                                              "conversion_time": null,
                                              "customer": null,
                                              "channel": null,
                                              "items": [
                                                  {
                                                      "id": 762,
                                                      "quantity": 1,
                                                      "sku": "fifa22",
                                                      "type": "simple",
                                                      "name": "Fifa 22",
                                                      "coupon_code": null,
                                                      "weight": "0.6000",
                                                      "total_weight": "0.6000",
                                                      "base_total_weight": "0.6000",
                                                      "price": "14000.0000",
                                                      "formated_price": "\u20a614,000",
                                                      "base_price": "14000.0000",
                                                      "formated_base_price": "\u20a614,000.00",
                                                      "custom_price": null,
                                                      "formated_custom_price": "\u20a60",
                                                      "total": "14000.0000",
                                                      "formated_total": "\u20a614,000",
                                                      "base_total": "14000.0000",
                                                      "formated_base_total": "\u20a614,000.00",
                                                      "tax_percent": "0.0000",
                                                      "tax_amount": "0.0000",
                                                      "formated_tax_amount": "\u20a60",
                                                      "base_tax_amount": "0.0000",
                                                      "formated_base_tax_amount": "\u20a60.00",
                                                      "discount_percent": "0.0000",
                                                      "discount_amount": "0.0000",
                                                      "formated_discount_amount": "\u20a60",
                                                      "base_discount_amount": "0.0000",
                                                      "formated_base_discount_amount": "\u20a60.00",
                                                      "additional": {
                                                          "product_id": 178,
                                                          "quantity": 1,
                                                          "token": "true"
                                                      },
                                                      "child": null,
                                                      "product": {
                                                          "id": 178,
                                                          "sku": "fifa22",
                                                          "type": "simple",
                                                          "name": "Fifa 22",
                                                          "url_key": "fifa-22-1",
                                                          "price": "14000.0000",
                                                          "formated_price": "\u20a614,000",
                                                          "short_description": "<p>Fifa 22 game<\/p>",
                                                          "description": "<p>Best football game<\/p>",
                                                          "images": [
                                                              {
                                                                  "id": 265,
                                                                  "path": "product\/178\/A8pSpUcbpThCb6u3v8OCdMCtO2YhvhkRIstSXEnI.jpg",
                                                                  "url": "http:\/\/localhost\/dev-saleko\/public\/storage\/product\/178\/A8pSpUcbpThCb6u3v8OCdMCtO2YhvhkRIstSXEnI.jpg",
                                                                  "original_image_url": "http:\/\/localhost\/dev-saleko\/public\/storage\/product\/178\/A8pSpUcbpThCb6u3v8OCdMCtO2YhvhkRIstSXEnI.jpg",
                                                                  "small_image_url": "http:\/\/localhost\/dev-saleko\/public\/cache\/small\/product\/178\/A8pSpUcbpThCb6u3v8OCdMCtO2YhvhkRIstSXEnI.jpg",
                                                                  "medium_image_url": "http:\/\/localhost\/dev-saleko\/public\/cache\/medium\/product\/178\/A8pSpUcbpThCb6u3v8OCdMCtO2YhvhkRIstSXEnI.jpg",
                                                                  "large_image_url": "http:\/\/localhost\/dev-saleko\/public\/cache\/large\/product\/178\/A8pSpUcbpThCb6u3v8OCdMCtO2YhvhkRIstSXEnI.jpg"
                                                              }
                                                          ],
                                                          "videos": [],
                                                          "base_image": {
                                                              "small_image_url": "http:\/\/localhost\/dev-saleko\/public\/cache\/small\/product\/178\/A8pSpUcbpThCb6u3v8OCdMCtO2YhvhkRIstSXEnI.jpg",
                                                              "medium_image_url": "http:\/\/localhost\/dev-saleko\/public\/cache\/medium\/product\/178\/A8pSpUcbpThCb6u3v8OCdMCtO2YhvhkRIstSXEnI.jpg",
                                                              "large_image_url": "http:\/\/localhost\/dev-saleko\/public\/cache\/large\/product\/178\/A8pSpUcbpThCb6u3v8OCdMCtO2YhvhkRIstSXEnI.jpg",
                                                              "original_image_url": "http:\/\/localhost\/dev-saleko\/public\/cache\/original\/product\/178\/A8pSpUcbpThCb6u3v8OCdMCtO2YhvhkRIstSXEnI.jpg"
                                                          },
                                                          "created_at": "2022-08-04T15:03:39.000000Z",
                                                          "updated_at": "2022-08-04T15:03:39.000000Z",
                                                          "reviews": {
                                                              "total": 1,
                                                              "total_rating": "5",
                                                              "average_rating": "5.0",
                                                              "percentage": "{\"5\":100,\"4\":0,\"3\":0,\"2\":0,\"1\":0}"
                                                          },
                                                          "in_stock": true,
                                                          "is_saved": false,
                                                          "is_wishlisted": false,
                                                          "is_item_in_cart": true,
                                                          "show_quantity_changer": true,
                                                          "special_price": "14000.0000",
                                                          "formated_special_price": "\u20a614,000",
                                                          "regular_price": 16000,
                                                          "formated_regular_price": "\u20a616,000",
                                                          "on_sale": 1
                                                      },
                                                      "created_at": "2023-10-21T08:51:27.000000Z",
                                                      "updated_at": "2023-10-21T08:55:32.000000Z"
                                                  }
                                              ],
                                              "selected_shipping_rate": {
                                                  "id": 1348,
                                                  "carrier": "flatrate",
                                                  "carrier_title": "Flat Rate",
                                                  "method": "flatrate_flatrate",
                                                  "method_title": "Flat Rate",
                                                  "method_description": "Flat Rate Shipping",
                                                  "price": 10,
                                                  "formated_price": "\u20a610",
                                                  "base_price": 10,
                                                  "formated_base_price": "\u20a610.00",
                                                  "created_at": "2023-10-21T08:55:31.000000Z",
                                                  "updated_at": "2023-10-21T08:55:32.000000Z"
                                              },
                                              "payment": {
                                                  "id": 346,
                                                  "method": "cashondelivery",
                                                  "method_title": "Cash On Delivery",
                                                  "created_at": "2023-10-21T08:54:44.000000Z",
                                                  "updated_at": "2023-10-21T08:54:44.000000Z"
                                              },
                                              "billing_address": {
                                                  "id": 679,
                                                  "first_name": "Toyo",
                                                  "last_name": "Si",
                                                  "name": "Toyo Si",
                                                  "email": "toyosi@gmail.com",
                                                  "address1": [
                                                      "2 Test St"
                                                  ],
                                                  "country": "NG",
                                                  "country_name": "Nigeria",
                                                  "state": "LG",
                                                  "city": "Ikeja",
                                                  "postcode": "101233",
                                                  "phone": "+123456789",
                                                  "created_at": "2023-10-21T08:51:45.000000Z",
                                                  "updated_at": "2023-10-21T08:55:31.000000Z"
                                              },
                                              "shipping_address": {
                                                  "id": 680,
                                                  "first_name": "Toyo",
                                                  "last_name": "Si",
                                                  "name": "Toyo Si",
                                                  "email": "toyosi@gmail.com",
                                                  "address1": [
                                                      "2 Test St"
                                                  ],
                                                  "country": "NG",
                                                  "country_name": "Nigeria",
                                                  "state": "LG",
                                                  "city": "Ikeja",
                                                  "postcode": "101233",
                                                  "phone": "+123456789",
                                                  "created_at": "2023-10-21T08:51:45.000000Z",
                                                  "updated_at": "2023-10-21T08:55:31.000000Z"
                                              },
                                              "created_at": "2023-10-21T08:51:27.000000Z",
                                              "updated_at": "2023-10-21T08:55:32.000000Z",
                                              "taxes": "{\"0\":0}",
                                              "formated_taxes": "{\"0\":\"\\u20a60\"}",
                                              "base_taxes": "{\"0\":0}",
                                              "formated_base_taxes": "{\"0\":\"\\u20a60.00\"}",
                                              "formated_discounted_sub_total": "\u20a614,000",
                                              "formated_base_discounted_sub_total": "\u20a614,000"
                                          }
                                      }
                                  }
                                  
                                  1 Reply Last reply Reply Quote 0
                                  11 out of 17
                                  • First post
                                    11/17
                                    Last post