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;
-
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-KeyAuthorization
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"
}
-
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
-
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