Collect a payment
Send a payment request to a customer's wallet. Needs the collect permission.
/payments/collectCreates a pending collection and sends the customer a prompt to approve it. See Collect payments.
Retrying with the same external_reference returns the original transaction and never charges twice.
external_referencebodystringrequiredYour unique reference for this payment, within the project.
providerbodystringrequiredmomoProvider to collect through. Must be enabled for the project.
amountbodynumberrequiredAmount in major units. Greater than 0.
currencybodystringrequiredSZLISO 4217 code of your provider environment.
phone_numberbodystringrequiredThe payer’s MoMo number: 8 digits starting with 76 or 78, with or without +268.
descriptionbodystringShown in both parties’ transaction history. Up to 160 characters.
preapproval_referencebodystringCharge under an approved pre-approval, so the payer isn’t prompted. It must belong to the same number and currency.
metadatabodyobjectYour own data, returned unchanged on the transaction and in webhooks.
Response
200 with a transaction with type: collection and status: pending.
A retry with an existing external_reference also returns 200, with the transaction in its current status. That may no longer be pending, so read status rather than relying on the response code.
Any other response means the payment wasn’t started:
- Rejected before it’s created, such as an invalid number: fix the request and retry with the same reference.
- Refused by the provider: the transaction is saved as
failedand no webhook is sent. Retrying that reference returns the failed transaction with200, so try again with a new reference.
