Transactions
Create a transaction
Transactions
Create a transaction
Create a transaction
POST
/
transactions
curl --request POST \
--url https://api.mpesaflow.com/v1/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"customerId": "<string>",
"amount": "<string>",
"currency": "kes",
"provider": "mpesa",
"providerReference": "<string>",
"description": "<string>",
"status": "pending",
"type": "payment",
"origin": "api",
"metadata": {
"provider": "mpesa",
"initialRequest": {
"merchantRequestId": "<string>",
"checkoutRequestId": "<string>",
"responseCode": "<string>",
"responseDescription": "<string>",
"customerMessage": "<string>"
},
"callbackResult": {
"resultCode": 123,
"resultDescription": "<string>",
"receiptNumber": "<string>",
"amount": 123,
"transactionDate": "<string>",
"phoneNumber": "<string>"
}
}
}'
{
"success": true,
"data": {
"customerId": "<string>",
"object": "<string>",
"currency": "<string>",
"fee": "<string>",
"amount": "<string>",
"provider": "<string>",
"providerReference": "<string>",
"description": "<string>",
"status": "pending",
"type": "payment",
"metadata": "<string>",
"origin": "web",
"declineReason": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"refundedAt": "<string>",
"paidAt": "<string>",
"failedAt": "<string>",
"disputedAt": "<string>"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
Example:
"Bearer SECRET"
Body
application/json
The transaction to create
The body is of type object
.
Response
200
application/json
Create a Transaction
The response is of type object
.
curl --request POST \
--url https://api.mpesaflow.com/v1/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"customerId": "<string>",
"amount": "<string>",
"currency": "kes",
"provider": "mpesa",
"providerReference": "<string>",
"description": "<string>",
"status": "pending",
"type": "payment",
"origin": "api",
"metadata": {
"provider": "mpesa",
"initialRequest": {
"merchantRequestId": "<string>",
"checkoutRequestId": "<string>",
"responseCode": "<string>",
"responseDescription": "<string>",
"customerMessage": "<string>"
},
"callbackResult": {
"resultCode": 123,
"resultDescription": "<string>",
"receiptNumber": "<string>",
"amount": 123,
"transactionDate": "<string>",
"phoneNumber": "<string>"
}
}
}'
{
"success": true,
"data": {
"customerId": "<string>",
"object": "<string>",
"currency": "<string>",
"fee": "<string>",
"amount": "<string>",
"provider": "<string>",
"providerReference": "<string>",
"description": "<string>",
"status": "pending",
"type": "payment",
"metadata": "<string>",
"origin": "web",
"declineReason": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"refundedAt": "<string>",
"paidAt": "<string>",
"failedAt": "<string>",
"disputedAt": "<string>"
}
}