GithubHelp home page GithubHelp logo

Use of APIs about evershop HOT 19 CLOSED

leandrosantoss avatar leandrosantoss commented on June 11, 2024
Use of APIs

from evershop.

Comments (19)

treoden avatar treoden commented on June 11, 2024 1

So you are looking for an API which help you create a new shopping cart and return the ID of the cart, from here you can add item and finish the checkout based on the cart ID right?

from evershop.

treoden avatar treoden commented on June 11, 2024 1

Hi @leandrosantoss ,

I will implement it, it will be included in the next release. I will let you know the timeline soon. Ideally in this month

Thanks

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024 1

Hi, @treoden

Prioritized for this month?

Thanks

from evershop.

treoden avatar treoden commented on June 11, 2024 1

Yes I am working on it @leandrosantoss

from evershop.

treoden avatar treoden commented on June 11, 2024 1

Hi @leandrosantoss ,

Yes the PR includes the create cart API.
Please wait, I am doing some more test and release a package to the npm.
I will keep you posted here.
Thanks

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024 1

Resolved! I validated the POST/carts API and it worked perfectly.
Thank you for your help.

from evershop.

treoden avatar treoden commented on June 11, 2024

Hi @leandrosantoss ,

EverShop uses Graphql for query data. So instead of looking for REST API, you can check the Graphql query

image

Thanks

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024

Yes, I managed it via GraphQL. I'm going to integrate ecommerce with a chatbot and I'm having trouble understanding:

  1. Retrieve (Category, Product, etc) via GraphQL (Ok)
  2. Add item to cart needs to have a sessionID to call the http://localhost:3000/api/cart/mine/items service, but how do I get this sessionID?

In the chatbot, the customer will list categories, then list products in the category, add to cart, generate order and finalize.

My code is in nodejs and I will need to make calls to Evershop.

Can you help me?

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024

Here, is basic flow

image

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024

Yes, perfect!

Do you help me?

Thanks!

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024

There could be a feature that just creates a cart:

POST /carts
Request:

{
"full_name": {{customer_name}}
"email": {{customer_email}}
}

Response:

{
"cardId": {{cardId}}
}

If there is an active cart (by email) return the existing one, so you can continue your purchase.

What do you think?

from evershop.

treoden avatar treoden commented on June 11, 2024

Hi @leandrosantoss ,

Yes it is a good Idea. How about we ask for at lease 1 first item to create a cart?

Something like

POST /carts
Request:

   {
      "full_name": {{customer_name}},
      "email": {{customer_email}},
      "items": [
        {
          "sku": "justasku",
          "qty": 1
        }
      ]
    }

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024

Yes, perfect!

Do you implement? Or do I implement it?

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024

Ok, thanks @treoden !

I await the schedule to continue my development

If you need help I can help you.

Thanks!

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024

Thank you very much

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024

Hi @treoden,

PR 512 contains this implementation, correct?

What version of evershop should I put in package.json to pull this FEATURE?

Thanks

from evershop.

leandrosantoss avatar leandrosantoss commented on June 11, 2024

Hi @treoden , I installed the new version 1.1.0.

I run the build:
> evershop build ✔ Client ✔ Server Compiled successfully in 1.93m

I run start:
`> [email protected] start

evershop start production`

But no message "Started sucessful in localhost:3000"

If execute https://localhost:3000 in browser, display this error:

image

In terminal this error:
❌ error: Enum "FilterOperation" cannot represent non-enum value: "=". GraphQLError: Enum "FilterOperation" cannot represent non-enum value: "=". at GraphQLEnumType.parseLiteral (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\type\definition.js:1140:13) at isValidValueNode (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\validation\rules\ValuesOfCorrectTypeRule.js:154:30) at Object.StringValue (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\validation\rules\ValuesOfCorrectTypeRule.js:118:28) at Object.enter (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\language\visitor.js:301:32) at Object.enter (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\utilities\TypeInfo.js:391:27) at visit (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\language\visitor.js:197:21) at validate (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\validation\validate.js:91:24) at graphql (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\@evershop\evershop\src\modules\graphql\pages\global\[buildQuery]graphql[notification].js:32:34) at asyncMiddlewareWrapper (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\@evershop\evershop\src\lib\middleware\async.js:24:18) at C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\@evershop\evershop\src\lib\middleware\buildMiddlewareFunction.js:56:11

Help me understand if something is wrong?

from evershop.

treoden avatar treoden commented on June 11, 2024

Hi @leandrosantoss

This new release comes with a changes to the FillterOperation input GraphQL query.
If you are working on a customization using GraphQL collection filtering, you will have to pass the operation argument to the query variable.

Before

{key: 'type', value: 'select'}

After

{ key: 'type', operation: 'eq', value: 'select' }

The operation value should be one of the following: eq, neq, gt, gteq, lt, lteq, like, nlike, in, nin

Thank you

from evershop.

treoden avatar treoden commented on June 11, 2024

Hi @leandrosantoss ,

Let me know if you solved the issue. You can refer to my commit here for example: evershopcommerce/evetheme@3de75b1

Thanks

from evershop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.