Jump to content
  • 0
Đăng nhập để theo dõi  
taken

Shopee Add To Cart Error : 4 ?

Câu hỏi

Hi, I'm not from Vietnam. But I have a client from Indonesia to create an automation program from this shopping platform called Shopee. This is weird, so the program somehow started not working. I tried adding a user-agent in the code, and also several headers. It keeps dropping the error:4, despite having the headers and json data correct. Am I doing something wrong here?. It worked back in the day, but when it's close to the deadline. It somehow started dropping this error. Any idea?

Trích dẫn

{"version":"35ef74cdd72045b34731ad7f72ac44eb","data":{"cart_item":null,"problematic_items":null,"switch_fulfillment_source_text":null},"error_msg":null,"error":4}

This one is the header and the post data I use.

    $headercart = array(
        'x-csrftoken: '. $csrf_token,
        'x-requested-with: XMLHttpRequest',
        'referer: https://shopee.co.id/',
        'x-api-source: pc',
        'x-requested-with: XMLHttpRequest',
        'x-shopee-language: id',
     );

    $postcart = '
    {
    "quantity": 1,
    "checkout": true,
    "update_checkout_only": false,
    "donot_add_quantity": false,
    "client_source": 1,
    "source": "{\"refer_urls\":[]}",
    "shopid": '.$shopid.',
    "itemid": '.$itemid.',
    "modelid": '.$itemdata["item"]["models"][0]["modelid"].'
}';

 

Chia sẻ bài đăng này


Link tới bài viết
Share on other sites

Recommended Posts

  • 0
6 giờ trước, taken said:

Hi, I'm not from Vietnam. But I have a client from Indonesia to create an automation program from this shopping platform called Shopee. This is weird, so the program somehow started not working. I tried adding a user-agent in the code, and also several headers. It keeps dropping the error:4, despite having the headers and json data correct. Am I doing something wrong here?. It worked back in the day, but when it's close to the deadline. It somehow started dropping this error. Any idea?

This one is the header and the post data I use.


    $headercart = array(
        'x-csrftoken: '. $csrf_token,
        'x-requested-with: XMLHttpRequest',
        'referer: https://shopee.co.id/',
        'x-api-source: pc',
        'x-requested-with: XMLHttpRequest',
        'x-shopee-language: id',
     );

    $postcart = '
    {
    "quantity": 1,
    "checkout": true,
    "update_checkout_only": false,
    "donot_add_quantity": false,
    "client_source": 1,
    "source": "{\"refer_urls\":[]}",
    "shopid": '.$shopid.',
    "itemid": '.$itemid.',
    "modelid": '.$itemdata["item"]["models"][0]["modelid"].'
}';

 

please up example code you add cart ..and show your error website return . i dont see your error when i no have your code :) .. 

Chia sẻ bài đăng này


Link tới bài viết
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Trả lời câu hỏi này...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Đăng nhập để theo dõi  

×
×
  • Create New...