Skip to main content
Question

Open API Post request Failure: Sandbox Environment

  • July 16, 2025
  • 11 replies
  • 136 views

I am consuming the MTN Open API and most of the endpoints worked except for some specific endpoints which I would enlist below;

Kindly note that the response I receive from these are all BAD REQUEST so kindly help me out in determining what is the issue;

  1. Request to Pay

    POST https://sandbox.momodeveloper.mtn.com/collection/v1_0/requesttopay
    Headers:

    X-Target-Environment
    X-Callback-Url       
    X-Reference-Id
    Ocp-Apim-Subscription-Key

    Authorization

 

Request Body: 

{

"amount": "2.0",

"currency": "GH",

"externalId": "7916d515-ab40-4bba-bb67-b68bfb13b94c",

"payer": {

"partyIdType": "MSISDN",

"partyId": "23354****414"

},

"payerMessage": "Kindly accept for payment of TEST",

"payeeNote": "Thanks for paying for Test"

}

 

 

  1. Disbursement / Transfer

      POST: https://sandbox.momodeveloper.mtn.com/disbursement/v1_0/transfer

       Headers:

   X-Target-Environment
   X-Callback-Url       
   X-Reference-Id
   Ocp-Apim-Subscription-Key

   Authorization

 

Request Body:

 {

"amount": "2.0",

"currency": "GH",

"externalId": "e4f75ad1-83c7-44b2-937f-6c0849a94a48",

"payer": {

"partyIdType": "MSISDN",

"partyId": "233547013414"

},

"payerMessage": "Refund Payer Message",

"payeeNote": "Payee Note"

}

 

Response: Bad Request

 

 

  1.  Pre-Approval

POST https://sandbox.momodeveloper.mtn.com/collection/v2_0/preapproval

Headers:

   X-Target-Environment
   X-Callback-Url       
   X-Reference-Id
   Ocp-Apim-Subscription-Key
   Authorization

Request Body:

{

"payer": {

"partyIdType": "MSISDN",

"partyId": "233547013414"

},

"payerCurrency": "GH",

"payerMessage": "Kindly approve",

"validityTime": "2"

}

               

Response: Bad request

11 replies

  • Community Manager
  • 39 replies
  • July 26, 2025
  • The currency should be EUR for sandbox.
  • Also ensure the x-reference-id is a valid UUID version 4, you can use online tools for this.
  • Ensure in the authorization you are using the Bearer keyword i.e Authorization: Bearer YourGeneratedAccessToken

  • Active
  • 5 replies
  • July 26, 2025
  • The currency should be EUR for sandbox.
  • Also ensure the x-reference-id is a valid UUID version 4, you can use online tools for this.
  • Ensure in the authorization you are using the Bearer keyword i.e Authorization: Bearer YourGeneratedAccessToken

I am still getting a bad request response error!!


  • Active
  • 5 replies
  • July 28, 2025

Hi, is your token still valid?


  • Active
  • 5 replies
  • July 28, 2025

Hi, is your token still valid?

Yes!! I even tried deserializing it using jwt.io and the claims were very correct and the token hadn’t expired yet

 


  • Active
  • 5 replies
  • July 28, 2025

Ok. It’s the hashtag in your payersMessage.. Seems it’s invalid character


  • Active
  • 5 replies
  • July 28, 2025

Ok. It’s the hashtag in your payersMessage.. Seems it’s invalid character

 That’s a string value. I don’t think that’s the problem. Lemme try your solution though

 

 

 


  • Active
  • 5 replies
  • July 28, 2025

Thats what the documentation sais…

But I just tried it with (400) and without (202)


  • Active
  • 5 replies
  • July 28, 2025

Thats what the documentation sais…

But I just tried it with (400) and without (202)

Could you please send me images of your request so that I use that exact one, please


  • Active
  • 5 replies
  • July 28, 2025

 


  • Active
  • 5 replies
  • July 28, 2025

 

It has worked. Thank you.

 


  • Active
  • 5 replies
  • July 28, 2025

Happy to help