I am getting "Parse error" on a make_integrated_address request. How do I fix it?

I generated the payment ID using this command in the terminal : openssl rand 32 -hex

The error looks like this:

{"error": {"code": -32700, "message": "Parse error"}, "id": 0, "jsonrpc": "2.0"}

My request is:

string str = "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"make_integrated_address\",\"params\":{\"standard_address\":\"myaddress\",payment_id:\"1027188273c9f2e53131e303404b6e7d9d3ead01d70ca258d0fa63cb6fd14b93\"}}";

string gg = GetResponse (str);
return gg;

Your parameter name payment_id is not quoted.

| improve this answer | |

The payment ID you are trying to use is too long (32 bytes, when it should be 8 bytes).

From the documentation:

payment_id - string; (Optional, defaults to a random ID) 16 characters hex encoded.

Example call:

 curl -sd '{"jsonrpc":"2.0","id":"0", "method":"make_integrated_address","params": {"payment_id":"5b67d705bbf72c77"}}' http://localhost:28084/json_rpc

And response:

  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "integrated_address": "A8mA7fFvCnjhmoNQpCrDBQXFM25rqFBZYBq8RepazSLSBwsj5kRtuM9iCSuz3vs9KbfZhrQj1BKRxVCpyqii7pca5EzinX4GnyZEXS34vk",
    "payment_id": "5b67d705bbf72c77"

@user36303 also correctly points out you have not quoted the parameter name payment_id.

| improve this answer | |
  • Thanks. Corrected it. But still getting the same error. New payment id : 5e36810680adf57e – Guga Todua Aug 16 at 18:35
  • Have you also added the quotes per @user36303's answer? Thus 16 characters hex encoded, quoted "payment_id". Also, as you are wanting to use a random ID, you don't need to supply that parameter; it will default to a random ID. – jtgrassie Aug 16 at 19:11
  • Yes. I tried without quotes too. Now I removed payment_id parameter and I'm getting Method Not Found error. Also, address I'm typing as standard_address is taken from Monero GUI. Did I do it correctly? – Guga Todua Aug 16 at 20:01
  • 1
    I suspect it's your code then. It works fine for me. curl -sd '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"payment_id":"5b67d705bbf72c77"}}' http://localhost:28084/json_rpc – jtgrassie Aug 16 at 20:32
  • 1
    Also, @user36303's comment is referring to the actual parameter name, not the value, which you have not quoted. – jtgrassie Aug 16 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.