Skip to main content

Payment Service

Manages payment records for collection requests. Supports creating, listing, ingesting external payments, and managing payment lifecycle.

Create Payment

POST /v1/payments

Creates a new payment record associated with a collection request.

Request Body:

{
"account_id": "acc_mz12345",
"collection_request_id": "cr_abc12345",
"provider_id": "provider_mpesa",
"channel": "mobile_wallet",
"currency": "MZN",
"amount": 7500.00,
"status": "pending"
}
FieldTypeRequiredDescription
account_idstringYesAccount making the payment
collection_request_idstringNoAssociated collection request ID
provider_idstringNoPayment provider identifier
channelstringNoPayment channel (e.g., mobile_wallet, bank_transfer)
currencystringYesISO 4217 currency code (e.g., MZN)
amountdoubleYesPayment amount
statusstringYesPayment status: pending, failed, or confirmed

Response:

{
"object": "payment",
"payment": {
"id": "pm_abc12345",
"account_id": "acc_mz12345",
"collection_request_id": "cr_abc12345",
"provider_id": "provider_mpesa",
"channel": "mobile_wallet",
"amount": {
"currency": "MZN",
"value": 7500.00
},
"status": "pending",
"processed_at": null,
"confirmed_at": null,
"created_at": "2025-07-10T08:30:00Z",
"deleted_at": null
},
"error": null
}

List Payments

GET /v1/payments

Retrieves a paginated list of payments with optional filters.

Query Parameters:

ParameterTypeDefaultDescription
collection_request_idstring-Filter by collection request ID
statusstring-Filter by status: pending, failed, or confirmed
channelstring-Filter by payment channel
provider_idstring-Filter by provider ID
amount_mindouble-Minimum payment amount
amount_maxdouble-Maximum payment amount
fromstring-Date range start (ISO 8601 timestamp)
tostring-Date range end (ISO 8601 timestamp)
currencystring-Filter by ISO currency code
page_sizeinteger50Max results per page (max: 100)
page_tokenstring-Token for next page

Response:

{
"object": "list",
"items": [
{
"id": "pm_abc12345",
"account_id": "acc_mz12345",
"collection_request_id": "cr_abc12345",
"provider_id": "provider_mpesa",
"channel": "mobile_wallet",
"amount": {
"currency": "MZN",
"value": 7500.00
},
"status": "confirmed",
"processed_at": "2025-07-10T08:31:00Z",
"confirmed_at": "2025-07-10T08:31:05Z",
"created_at": "2025-07-10T08:30:00Z",
"deleted_at": null
},
{
"id": "pm_def67890",
"account_id": "acc_mz67890",
"collection_request_id": "cr_def67890",
"provider_id": "provider_emola",
"channel": "mobile_wallet",
"amount": {
"currency": "MZN",
"value": 3200.50
},
"status": "pending",
"processed_at": null,
"confirmed_at": null,
"created_at": "2025-07-10T09:15:00Z",
"deleted_at": null
}
],
"has_more": true,
"next_page_token": "token_xyz789",
"error": null
}

Ingest Payment

POST /v1/payments/ingest

Imports and reconciles an external payment into the system. Used for ingesting payments from external sources such as banks or payment gateways.

Request Body:

{
"id": "ext_pay_20250710_001",
"amount": 15000.00,
"currency": "MZN",
"status": "completed",
"payment_method_type": "SIMO_ERV",
"payment_method_details": {
"nib": "000100000012345678910",
"entity_number": "12345",
"reference_number": "REF-MZ-2025-00456"
},
"reference": "BCI-TRF-20250710-001",
"source": "Bank",
"processed_at": "2025-07-10T10:00:00Z"
}
FieldTypeRequiredDescription
idstringYesExternal payment ID from the source system
amountdoubleYesPayment amount
currencystringYesISO 4217 currency code (e.g., MZN)
statusstringYesPayment status: pending, completed, or failed
payment_method_typestringNoPayment method type (e.g., SIMO_ERV, INTERBANK)
payment_method_detailsobjectYesPayment method details (see below)
referencestringNoExternal reference identifier
sourcestringYesSource of the payment (e.g., Bank, Payment Gateway)
processed_atstringYesTimestamp when the payment was processed (ISO 8601)

Payment Method Details:

FieldTypeDescription
nibstringBank account NIB (Numero de Identificacao Bancaria)
entity_numberstringEntity number for the payment
reference_numberstringReference number for the transaction

Response:

{
"object": "payment_ingest",
"ingest_payment": {
"id": "ext_pay_20250710_001",
"amount": 15000.00,
"currency": "MZN",
"status": "completed",
"payment_method_type": "SIMO_ERV",
"payment_method_details": {
"nib": "000100000012345678910",
"entity_number": "12345",
"reference_number": "REF-MZ-2025-00456"
},
"reference": "BCI-TRF-20250710-001",
"source": "Bank",
"processed_at": "2025-07-10T10:00:00Z",
"updated_at": "2025-07-10T10:00:05Z",
"created_at": "2025-07-10T10:00:05Z",
"deleted_at": null
},
"error": null
}

Get Payment

GET /v1/payments/{id}

Retrieves details of a specific payment by ID.

Path Parameters:

ParameterTypeDescription
idstringPayment ID

Response:

{
"object": "payment",
"payment": {
"id": "pm_abc12345",
"account_id": "acc_mz12345",
"collection_request_id": "cr_abc12345",
"provider_id": "provider_mpesa",
"channel": "mobile_wallet",
"amount": {
"currency": "MZN",
"value": 7500.00
},
"status": "confirmed",
"processed_at": "2025-07-10T08:31:00Z",
"confirmed_at": "2025-07-10T08:31:05Z",
"created_at": "2025-07-10T08:30:00Z",
"deleted_at": null
},
"error": null
}

Update Payment

PUT /v1/payments/{id}

Updates an existing payment record. Only provided fields are updated.

Path Parameters:

ParameterTypeDescription
idstringPayment ID

Request Body:

{
"account_id": "acc_mz12345",
"collection_request_id": "cr_abc12345",
"provider_id": "provider_emola",
"channel": "bank_transfer",
"amount": 8000.00,
"currency": "MZN",
"status": "confirmed"
}
FieldTypeRequiredDescription
account_idstringYesAccount making the payment
collection_request_idstringNoAssociated collection request ID
provider_idstringNoPayment provider identifier
channelstringNoPayment channel
amountdoubleNoUpdated payment amount
currencystringNoISO 4217 currency code
statusstringNoUpdated payment status

Response:

{
"object": "payment",
"payment": {
"id": "pm_abc12345",
"account_id": "acc_mz12345",
"collection_request_id": "cr_abc12345",
"provider_id": "provider_emola",
"channel": "bank_transfer",
"amount": {
"currency": "MZN",
"value": 8000.00
},
"status": "confirmed",
"processed_at": "2025-07-10T08:31:00Z",
"confirmed_at": "2025-07-10T08:35:00Z",
"created_at": "2025-07-10T08:30:00Z",
"deleted_at": null
},
"error": null
}

Delete Payment

DELETE /v1/payments/{id}

Deletes a payment record from the system.

Path Parameters:

ParameterTypeDescription
idstringPayment ID (pattern: ^pm_[a-zA-Z0-9]+$)

Response:

{
"object": "payment",
"error": null
}

Payment Status Values

StatusDescription
pendingPayment created, awaiting processing
confirmedPayment successfully processed
failedPayment processing failed