Hey , I am running into an issue with creating a custom payment flow using the dodo payments api . When I am hitting the /payments route with the payload , it sends me 422 status code , but I have copied the same payload as on the subscription product docs . I have attached the payload as well as the fetch request . My backend is nodejs along with expressjs .
Please help me with this .
#ERROR STATUS 422
1 messages · Page 1 of 1 (latest)
https://docs.dodopayments.com/api-reference/payments/post-payments
Refer to the above docs. You are passing in the metadata incorrectly.
Make sure your product type is one time product in case of one time payments
We also send you an error message in the response of why the request failed. Can you share that
Hey , I was hitting the wrong endpoint . Actually I was creating a subscription and hitting the wrong endpoint . But now I am getting 400 response code .
I have attached the response as well as the payload this time .
@gloomy stag ˆ
hey which api are you calling? also can you share the response body (it contains the error message on why the call failed)
Hey , I am calling he /subscriptions api as listed in the response body . The second image is the response body .
You are not displaying the response body. it only contains headers in the second image. I need you to print the response body too
I did print it but wasn't able to parse the response body .
It's not json, just text in case of error. Can you try just printing the body without json parse