Assistance with some aspects of your platform, specifically related to shipping methods, the add to cart feature, and handling multiple variants

Questions and Clarifications Regarding Tradly Documentation.

  1. Shipping Methods:
    In the documentation, it is not clear when and how we should set the price for a shipping method created via the admin panel. Could you please provide guidance on when and how to set the price for shipping methods, for example, if we want to charge RM 5 for a 1kg package?

  2. Add to Cart Feature:
    I have noticed that the add to cart feature does not appear to accept any shipping methods via the API, despite the cart model having a field for shipping price. Can you clarify if this is the intended behavior or if there is a way to include shipping methods in the cart via the API?

  3. Handling Multiple Variants:
    When a listing has multiple variants, the API allows us to add products to the cart seamlessly. However, in your React web application, it prompts an error asking users to select a variant first. I’m curious about how this error is handled. Does the React app perform the check on the client side, and if so, is this a security risk since the check is not handled by the API?

  4. Variant Information in “Add to Cart” API:
    The “add to cart” API in Postman appears to only require a listing ID and quantity, without specifying how to include variant information. Could you provide information on how to correctly add listings with variants to the cart via the API?

  1. You can create shipping methods in SuperAdmin with Flat fee under configuration (global level). However, we don’t have weight based shipping charge calculation at the moment. You have option to have listing level flat shipping fee (by sending shipping_charges in the listing object) or account level flat shipping charge by passing below in account object (we will need to enable this for you as this was recently released and not available in SuperAdmin yet, let us know if you’re planning to have account level shipping charges)

“shipping_charges”: {“flat”: 10}

On the summary, we have global level or account level or listing level flat shipping charges.

  1. Per documentation you will have to pass shipping_method_id in the query params of the get cart API. To get all your configured shipping methods you will have to use this endpoint.

3 & 4. Add to cart API allows you to add either listing or variant. You will have to chose which level you want to go. If you’re going variant level have a check on your application to choose variant as mandatory and pass variant in the variant_id key in the add to cart API as below along with listing_id (apologies, variant_id is missed in the doc. we have added it)

{ “cart”: { “listing_id”: 124578, “variant_id”: 137112, “quantity”: 1 } }