Getting a 400 bad request while doing a request payment in sandbox. with no further message and not sure why or what is wrong.
Cannot submit requestpay api
Getting a 400 bad request while doing a request payment in sandbox. with no further message and not sure why or what is wrong.
Hi, Bad Request basically means there something wrong with your request, could be an issue on the header values your sending or request body. It would help if you could share the details of your request i.e request headers and request body
Remove the callback URL field and try again.
Here is the body and headers
Headers: {
"Ocp-Apim-Subscription-Key": "xxxx",
"X-Reference-Id": "xxxx",
"Authorization": "xxxx",
"X-Target-Environment": "sandbox"
}
body:
{'amount': '200.0', 'externalId': '550e8400-e29b-41d4-a716-446655440000', 'payerMessage': 'This is a test for payment', 'payeeNote': 'This is test note for the payment', 'payer': {'partyIdType': 'MSISDN', 'partyId': '56733123453'}}
You forgot to add the Currency whose value is EUR
i tried XAF since i am planing on operating in Cameroon but no luck. or sandbox only accept EUR?
I have just tried this
{'amount': '200.0', 'currency': 'EUR', 'externalId': '550e8400-e29b-41d4-a716-446655440000', 'payerMessage': 'This is a test for payment', 'payeeNote': 'This is test note for the payment', 'payer': {'partyIdType': 'MSISDN', 'partyId': '56733123453'}}
still getting a 400
Kindly follow the sandbox requirements, you are using the wrong sandbox test numbers.
Visist the testnumbers section under the documentation menu n the momo developer platform or on the momo develeoper community, scroll down and follow the how to videos.
_remember to vote the answer when you get one so other developers facing the same challange as you easily find the answer
```
{
"amount": "200.0",
"currency": "EUR",
"payerMessage": "This is a test for payment",
"payeeNote": "This is test note for the payment",
"payer": {
"partyIdType": "MSISDN",
"partyId": "46733123451"
}
}
Request failed with status code: 400
Response content:
```
```
{
"amount": "200.0",
"currency": "EUR",
"payerMessage": "This is a test for payment",
"payeeNote": "This is test note for the payment",
"payer": {
"partyIdType": "MSISDN",
"partyId": "46733123451"
}
}
Request failed with status code: 400
Response content:
```
No need to include a period on the figures. eg 200.0, let it just be 200
Reply
Sign into the MoMo Developer Community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.