Payment (Payin)

Payment (Payin)

Purpose

The POST /v1/payin/sessions endpoint allows a merchant to create a secure payment session between their system and the payment platform. This session corresponds to a payment intent: it does not charge the customer until they confirm or validate the transaction.

Request Details

ElementDescription
MethodPOST
Endpoint/v1/payin/sessions
AuthAuthorization: Basic base64(api_key:api_client)
IdempotenceX-Idempotency-Key required to avoid duplicates
Payload Typeapplication/json

Request Parameters

FieldTypeDescriptionRequired
referencestringUnique transaction identifier on the merchant side (UUID recommended).
accountIdstringMerchant account or sub-account identifier to debit/credit.
amountnumberAmount to pay (in whole units, no decimals).
msisdnstringCustomer's phone number (E.164 format).
customerNamestringName of the customer initiating the payment.
countrystringCountry ISO code (CI, CM).

Request Example

{
  "reference": "{{$randomUUID}}",
  "accountId": "merchant_9923lkdz",
  "amount": 300,
  "msisdn": "+2250702968786",
  "customerName": "John Doe",
  "country": "CI"
}

Response Example

{
  "type": "payin",
  "fee": 6,
  "reference": "tr_fhchi842jyimwiugjgszcxvb8n",
  "phoneNumber": "+2250700000000",
  "amount": 300,
  "chargedAmount": 306,
  "status": "processing",
  "currency": "XOF",
  "customerReference": "ef76fb64-af0b-4c37-8729-bf61d85721fd",
  "confirmationRequired": true,
  "confirmationStatus": "none",
  "paymentUrl": "https://link.novasend.app/link/{shortCode}",
  "createdAt": "2025-08-22T01:34:48.189Z"
}

Response Interpretation

FieldDescription
typeOperation type — here "payin", for an incoming payment.
feeService fees applied to the transaction.
referenceAPI-side system reference for the transaction.
phoneNumberCustomer's phone number.
amountGross payment amount.
chargedAmountTotal charged amount (amount + fees).
statusInitial payment status (processing, processed, expired, etc.).
currencyCurrency used, e.g., "XOF".
customerReferenceRequest identifier generated or transmitted by the merchant.
confirmationRequiredIndicates if the customer must confirm the payment before execution.
confirmationStatusCustomer confirmation status (see table below).
paymentUrlWeb link (deep link) allowing the customer to confirm payment via a mobile or web interface.
createdAtSession creation date.

The confirmationRequired and confirmationStatus Attributes

confirmationRequired

  • Type: boolean
  • Possible values:
    • true → the customer must confirm the payment (e.g., OTP entry, approval in their mobile wallet, or click on a secure link).
    • false → the payment is automatically validated (case of internal transfers or instant payments).
  • Role: Allows the merchant to know if they must wait for a customer action before considering the payment complete.

    Example:

    • If confirmationRequired = true, the system sends a validation link (paymentUrl) to the customer.
    • The payment then goes to "processing" status until the customer responds.

confirmationStatus

  • Type: string

  • Possible values:

    ValueDescription
    noneNo response from the customer (initial status).
    acceptedThe customer confirmed the payment (OTP validated, or clicked "Accept").
    declinedThe customer explicitly refused the payment.
    expiredConfirmation deadline exceeded (timeout).
  • Role: Provides the current state of the customer validation process. This status evolves dynamically based on customer actions and can be tracked via:

    • Webhook (payin.confirmed, payin.declined)
    • Or via a GET /v1/payin/{reference} request.

Obligation

  • Always store reference and customerReference to track the transaction.
  • Display the paymentUrl link to the customer for validation if confirmationRequired = true.
  • If confirmationStatus = declined or expired, the payment should be considered invalid.

Payment Status

Purpose

This endpoint allows you to check the status of a payment initiated via the Merchant API at any time.

It is particularly useful for:

  • Verifying customer confirmation (accepted or declined).
  • Getting the final payment status (success, failure, pending).
  • Accessing enriched information about the transaction processed by the Core System (in the transaction field).

Request Details

ElementDescription
MethodGET
Endpoint/v1/payin/{reference}
Auth✅ Requires Authorization: Basic base64(api_key:api_client) header
Parameterreference → unique payment identifier (generated during POST /v1/payin/sessions)
PayloadNone

How It Works

When a merchant initiates a payment (POST /v1/payin/sessions), the API returns an initial status of processing or processed.

The payment then goes through several internal stages:

StageDescription
processingConfirmation in progress or technical validation
processedPayment validated by the customer (But does not define the final transaction status)
expiredConfirmation deadline exceeded

This endpoint allows you to check the complete progress of a payment from its reference.

Response Example

{
  "type": "payin",
  "fee": 6,
  "reference": "mtr_fhscgaywizujwjyymlge1hncaq",
  "phoneNumber": "+2250700000000",
  "customerName": "John Doe",
  "amount": 300,
  "chargedAmount": 306,
  "status": "processed",
  "currency": "XOF",
  "customerReference": "55a4e677-5700-4ed0-9a2a-9300db894ddb",
  "confirmationRequired": true,
  "confirmationStatus": "none",
  "createdAt": "2025-08-22T02:00:16.026Z",
  "transaction": {
    "reference": "tr_dkjd5ljficphlqmt",
    "status": "completed",
    "customerName": "dd soûl",
    "processedAt": "2025-11-05T16:12:42.096Z",
    "phoneNumber": "+2250700000000",
    "amount": "153.00",
    "fees": "0.00",
    "chargedAmount": "153.00",
    "currency": "XOF"
  },
  "failure": null
}

Response Interpretation

KeyDescription
typeOperation type (payin)
feeApplied fee amount
referenceInternal payment reference
phoneNumberPhone number of the customer who made the payment
customerNameName associated with the payer account
amountInitial payment amount
chargedAmountTotal charged amount (amount + fees)
statusOverall payment status (processing, processed)
currencyTransaction currency (XOF, USD, etc.)
customerReferenceOriginal reference provided by the merchant
confirmationRequiredIndicates if the customer must confirm (OTP, mobile validation, etc.)
confirmationStatusCurrent confirmation status (none, pending, accepted, declined)
createdAtPayment session creation date
failureError details in case of failure (null if successful)

transaction Key

The transaction field represents the final transaction recorded in the Core System once the payment is validated or rejected.

KeyDescription
transaction.referenceCore System internal identifier
transaction.statusActual processing status (completed, failed, pending)
transaction.customerNameName of the debited account holder
transaction.phoneNumberAccount number that performed the operation
transaction.amountActually processed amount
transaction.feesFees applied at the processor level
transaction.chargedAmountTotal charged amount
transaction.currencyCurrency used
transaction.processedAtExact timestamp of final processing

Reading Example

  • If status = "processed" and transaction.status = "completed" → ✅ Payment successful and confirmed.
  • If status = "processed" but transaction.status = "failed" → ⚠️ Payment recorded but refused by customer.
  • If transaction is null or {} in this case, the payment has not yet been confirmed by the customer.
  • If failure contains an object → error information will be present (code, message, etc.).

Obligation

  • Always store the reference and customerReference for correlation.
  • The transaction.status field is the final source of truth on the settlement system side.