unable to call guest cart glue api in b2b marketplace demo shop

NarenLingoju
NarenLingoju Unconfirmed Posts: 2 πŸ§‘πŸ»β€πŸš€ - Cadet
edited July 15 in Spryker Development

http://glue.us.spryker.local/guest-carts

Answers

  • NarenLingoju
    NarenLingoju Unconfirmed Posts: 2 πŸ§‘πŸ»β€πŸš€ - Cadet

    any idea how to call guest cart glue api

  • victor.vanherpt
    victor.vanherpt Spryker Solution Partner Posts: 55 πŸͺ - Explorer
    edited July 15

    Good morning (here :)) @NarenderLingoju!

    First of all, let me give you a suggestion: when requesting help for things like this, I'd recommend providing as much information to help someone (like me) reproduce the issue and see clear details on what you're doing exactly.
    For instance, in this situation, the full request would be helpful (i.e. curl command, use something like postman if you don't know how to build it), of course, you should scrap away any private data, but keep the structure so it's more detailed.

    Regarding your issue:
    I would guess maybe you're not providing the Guest Customer unique id? I think that endpoint will not return any data if you don't provide it with at least a guest customer, or suffix a cart id to the request.

    You can use the following Header Key:
    X-Anonymous-Customer-Unique-Id

    Here's the docs:
    https://docs.spryker.com/docs/pbc/all/cart-and-checkout/202404.0/marketplace/manage-using-glue-api/guest-carts/manage-guest-carts.html#retrieve-a-guest-cart

    You can use it like this ( remember to add authentication):

    curl --location 'http://glue.us.spryker.local/guest-carts' \
    --header 'X-Anonymous-Customer-Unique-Id: 164b-5708-8530'
    

    (you can import this snippet to Postman, or other HTTP helper app)

  • victor.vanherpt
    victor.vanherpt Spryker Solution Partner Posts: 55 πŸͺ - Explorer

    Also, I believe this is in the wrong forum section, no?
    Can an @admin maybe fix this? ( @Samuel Pais , @fsmeier ?)

  • NarenderLingoju
    NarenderLingoju Posts: 4 πŸ§‘πŸ»β€πŸš€ - Cadet

    @victor.vanherpt Please find below attached screenshot , using b2b demo marketplace shop in local

    curl --location --request GET 'http://glue.de.spryker.local/guest-carts/' \--header 'X-Anonymous-Customer-Unique-Id: 164b-5708-8531

    404 not found

    curl --location --request GET 'http://glue.de.spryker.local/guest-carts/' \--header 'X-Anonymous-Customer-Unique-Id: 164b-5708-8531

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    Good morning :)
    thank you @victor.vanherpt for pointing this out, I move this thread into the right section: Spryker Development.

    All the best,

    Florian

  • victor.vanherpt
    victor.vanherpt Spryker Solution Partner Posts: 55 πŸͺ - Explorer
    edited July 15

    @NarenderLingoju I can't see a screenshot, but if you say it's 404, I will believe it :).
    Try to get a known existing cart by providing it as a path parameter:
    curl --location 'http://glue.us.spryker.local/guest-carts/c9881d60-2497-5d0f-94ed-b421dbb73d38' \--header 'X-Anonymous-Customer-Unique-Id: 164b-5708-8530'

    Of course, change the unique ids to match whatever you have in your database.

    If no luck, I'd suggest to use the debugger to see if the desired controller is being triggered and see where/why it is returning 404.

  • NarenderLingoju
    NarenderLingoju Posts: 4 πŸ§‘πŸ»β€πŸš€ - Cadet

    curl --location 'http://glue.us.spryker.local/guest-carts' \ --header 'X-Anonymous-Customer-Unique-Id: 164b-5708-8530'

    { "errors": [ { "status": 404, "detail": "Not Found" } ]}

    any one help me on this whether guest will work on b2b marketplace demo setup or not.

    if not how to enable guest cart glue api's .

    Thanks

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 βš–οΈ - Guardians (admin)

    I just merged the two topics, likely even complete duplicate. So the comment before mine was from another thread :)

    All the best,

    Florian