Collection API (Advance)

Implement collection using our RESTFul JSON API

Use the collection API if you prefer to automatically trigger payment collection requests from your backend e.g Python, Java, PHP, and Go.

Use the Website Integration option for card payments support. Note it is already 3D enabled.

How to send Payment Collection Request

post
M-Pesa request

https://sandbox.intasend.com/api/v1/payment/collection/
Send an M-Pesa STK push payment request
Request
Response
Request
Body Parameters
public_key
required
string
Your account public key. Found under settings.
currency
required
string
KES
method
required
string
M-PESA
amount
required
number
Billing amount
api_ref
optional
string
Your transaction reference/tracking code
name
optional
string
Customer name
phone_number
required
string
Prefix with country code e.g 2547..
email
optional
string
Required for card payments
Response
200: OK
{
"invoice": {
"id": 150,
"state": "PENDING",
"provider": "M-PESA",
"value": "10.00",
"account": "[email protected]",
"api_ref": null,
"failed_reason": null,
"created_at": "2020-06-26T13:24:47.040822+03:00",
"updated_at": "2020-06-26T13:24:47.040849+03:00"
}
}

‚Äč

post
Check payment status

https://sandbox.intasend.com/api/v1/payment/status/
Check payment status
Request
Response
Request
Body Parameters
public_key
required
string
Account public key. Found under settings
invoice_id
required
number
Invoice ID returned in the payment request
Response
200: OK
Sample response returned
{
"invoice": {
"id": 10,
"state": "PENDING",
"provider": "CARD-PAYMENT",
"charges": "0.00",
"net_amount": 10.36,
"currency": "KES",
"value": "10.36",
"account": "[email protected]",
"api_ref": "ISL_faa26ef9-eb08-4353-b125-ec6a8f022815",
"host": "https://sandbox.intasend.com",
"failed_reason": null,
"created_at": "2021-04-11T08:37:15.781977+03:00",
"updated_at": "2021-04-11T08:37:15.782011+03:00"
},
"meta": {
"id": "5aec8e0b-8d96-429b-98b7-5361198160bd",
"customer": {
"id": 61,
"phone_number": "",
"email": "[email protected]",
"first_name": "FELIX",
"last_name": "CHERUIYOT",
"country": "KE",
"address": "Westlands",
"city": "Nairobi",
"state": "Nairobi",
"zipcode": "2020",
"provider": "CARD-PAYMENT",
"created_at": "2020-08-06T16:24:06.247397+03:00",
"updated_at": "2021-04-11T08:37:15.755013+03:00"
},
"payment_link": {
"id": "faa26ef9-eb08-4353-b125-ec6a8f022815",
"title": "Test Billing Page",
"is_active": true,
"redirect_url": null,
"amount": null,
"usage_limit": null,
"qrcode_file": "https://intasend-staging.s3.amazonaws.com/qrcodes/...",
"currency": "KES",
"mobile_tarrif": "CUSTOMER-PAYS",
"card_tarrif": "CUSTOMER-PAYS",
"created_at": "2020-06-26T08:11:24.644509+03:00",
"updated_at": "2020-10-05T16:45:59.757353+03:00"
},
"customer_comment": "",
"created_at": "2021-04-11T08:37:15.810438+03:00",
"updated_at": "2021-04-11T08:37:15.810475+03:00"
}
}