Login Register
Collection API | SpeedPesa

Collection API Documentation

Accept payments from customers via M-Pesa, Tigo Pesa, Airtel Money, and Halopesa.

Authentication

Every request requires your API key in the headers.

Required Headers

Content-Type application/json
Header Name x-api-key
Alternative Authorization: Bearer KEY

Mobile Payin (Receive Money)

Request payments from a customer's mobile money account.

POST https://speedpesa.com/api/v1/mobilepayin

Request Body (JSON)

FieldTypeRequiredDescription
phonenumberstringYesCustomer phone: 2557XXXXXXXX
amountstring/numberYesAmount in TZS to request

cURL Example

curl -X POST https://speedpesa.com/api/v1/mobilepayin \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_API_KEY" \ -d '{ "phonenumber": "255617919056", "amount": "500" }'

JSON Response

Success Error
{ "type": "success", "message": "Payment request sent successfully", "data": { "reference": "A1B2C3D4E5", "phonenumber": "255617919056", "amount": "500.00", "currency": "TZS", "status": "PENDING", "created": "2026-02-23 14:30:45" } }
{ "type": "error", "message": "Invalid phone number format", "data": { "error_code": "phone_invalid_format" } }

Ready to Transform Your Payments?

Join thousands of businesses already growing with SpeedPesa. No setup fees, no monthly minimums.

Start Building Free