lavanya
lavanya

Reputation: 31

Error: An error occurred in the request and at the time were unable to send the consumer data

I am integrating Woo-commerce API’s in my wordpress site using Woo-commerce official rest sdk. I made a link using authentication endpoint URL. When I click the link it takes the user to Woo-commerce authentication page, where user login and Approve the request.

After approving the request it should take me to return url which i mention in the link. Instead it shows me the following error.

Error: An error occurred in the request and at the time were unable to send the consumer data.

Upvotes: 3

Views: 4709

Answers (3)

srx
srx

Reputation: 343

For whoever Shattique's answer did not work,
check the response status code sent by the callback_url handler.
Anything other than 200 will throw the error in OP's question.

Here is link to woocommerce github repo, where it throws the error.

TLDR: Make sure callback_url handler returns statusCode: 200

Upvotes: 1

Shattique
Shattique

Reputation: 128

I know it's late for the answer but writing it for the people who will face the same issue in the future.

I was having the same issue and my problem was that the callback_url was wrong which was creating the error internally. So if you are getting this error, most probably your callback_url is not correct, please check that properly.

Upvotes: 1

Shubham Kushwah
Shubham Kushwah

Reputation: 655

I was having the same issue as well, and in my case, the return_url on my backend server was accepting GET requests, I changed it to POST, and everything worked perfectly. I hope it helps!

Upvotes: 0

Related Questions