Junipay API
    • JuniPay API Documentation
    • Authentication
      • Get Token for Payment Form (Unique Token + Secret)
        GET
    • Collections
      • Initiate Collection Payment
        POST
    • Disbursements
      • Transfer Funds
        POST
    • Remittance
      • Send Remittance
        POST
    • Transaction Status
      • Check Transaction Status
        POST
    • Verify Recipient
      • Verify Recipient
        GET
    • Webhooks
      • Webhook/Callback
        POST

    JuniPay API Documentation

    Base URL (Production): https://api.junipayments.com
    Base URL (Sandbox): https://sandbox.junipayments.com
    Content-Type: application/json
    Authentication: Bearer Token (JWT)

    1. Authentication#

    All API requests require authentication. Select the method that aligns with your integration requirements.

    1.1 Payment Form & Payment Links#

    Use Case: Quick integrations embedding JuniPay forms or sharing hosted payment links.
    Mechanism: Request a token from the token endpoint using your Client ID and Secret.
    Node.js
    PHP
    Python
    Response:
    {
      "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI...",
      "expires_in": 3600
    }
    

    1.2 Direct API Access#

    Use Case: Direct server-to-server operations, payment aggregators, payouts, and remittances.
    Mechanism: Sign JWT tokens locally on your server using your private key and the RS256 algorithm.
    Node.js
    PHP
    Python
    HTTP Header Requirements:

    2. Error Handling#

    JuniPay utilizes standard HTTP response status codes.
    CodeDescription
    200 OKRequest successful. Verify the response payload for specific transaction state.
    201 CreatedResource created successfully.
    400 Bad RequestMissing parameters or payload validation failed.
    401 UnauthorizedMissing, expired, or invalid authentication credentials.
    404 Not FoundThe requested resource does not exist.
    500–504 Server ErrorInternal API error. Contact support if issues persist.
    Error Response Payload:
    {
      "status": "error",
      "code": "INVALID_TOKEN",
      "message": "The token provided is expired or invalid."
    }
    

    3. Collections (Receiving Payments)#

    3.1 Payment Links#

    Generate shareable payment links directly from the JuniPay Dashboard.
    URL Format:

    3.2 Payment Form (Inline JS)#

    Embed the hosted payment modal directly into your front-end application.
    Integration Example:
    Form Configuration Parameters:
    ParameterTypeRequiredDescription
    keyStringYesToken generated using your secret key
    clientidStringYesClient ID from Dashboard
    emailStringYesCustomer email address
    amountDoubleYesAmount to debit customer
    total_amtDoubleYesTotal order amount
    descStringYesItem/service description
    colorStringNoModal background theme color
    customer_tokenStringNoExisting customer reference token
    foreignIDStringNoUnique merchant reference string
    callbackUrlStringYesAsynchronous POST notification URL
    redirectUrlStringYesFront-end browser redirection URL
    onCloseFunctionNoJavaScript callback trigger when modal is dismissed

    3.3 Collections API#

    Endpoint: POST /payment
    cURL
    Node.js
    PHP
    Python
    Header Parameters:
    ParameterTypeDescription
    AuthorizationStringBearer <YOUR_TOKEN>
    clientidStringClient ID from Dashboard
    Content-TypeStringapplication/json
    Body Parameters:
    ParameterTypeRequiredDescription
    channelStringYesPayment channel: mobile_money or card
    phoneNumberStringConditionalRequired for mobile_money channel
    providerStringConditionalNetwork provider: mtn, vodafone, or airteltigo
    amountDoubleYesBase amount in Cedis (GHS)
    tot_amntDoubleYesTotal processed amount in Cedis (GHS)
    senderEmailStringNoCustomer email for receipts
    descriptionStringYesTransaction memo
    foreignIDStringYesUnique merchant transaction reference
    callbackUrlStringYesWebhook endpoint for POST notifications
    Response Example:
    
    {
      "status": "pending",//failed||success
      "message": "TRANSACTION PENDING",//TRANSACTION FAILED||TRANSACTION SUCCESS
      "transID": "COL100002407990",
      "transID2": "87810835291",
      "foreignID": "91284735832382467",
      "reqToken": "COL100002407990"
    }
    
    Currency Note: All transaction amounts (amount, tot_amnt) are processed natively in Ghanaian Cedis (GHS).

    4. Disbursements (Sending Money)#

    Prerequisites#

    1.
    Compliance Verification: Your account must complete KYC/KYB approval.
    2.
    Direct API Access: Standard API access requested and enabled in Dashboard.
    3.
    Key Pair Setup: Public and Private RSA keys configured under Dashboard Settings.

    4.1 Verify Recipient#

    Validate customer account details prior to executing funds transfers.
    Endpoint: GET /resolve
    Node.js
    PHP
    Python
    Header Parameters:
    ParameterTypeDescription
    AuthorizationStringBearer <YOUR_TOKEN>
    clientidStringClient ID from Dashboard
    URL Query Parameters:
    ParameterTypeRequiredDescription
    channelStringYesTarget channel: mobile_money or bank
    phoneNumberStringConditionalRequired for mobile_money
    providerStringConditionalmtn, vodafone, or airteltigo
    account_numberStringConditionalRequired for bank transfer
    bank_codeStringConditionalValid 4-digit bank routing code
    Response Example:
    
    {
      "status": "success",
      "name": "GINA ABAN",
      "provider": "mtn"
    }
    

    4.2 Transfer Funds#

    Endpoint: POST /transfer
    cURL
    Node.js
    PHP
    Python
    Body Parameters:
    ParameterTypeRequiredDescription
    channelStringYesDestination target: mobile_money or bank
    phoneNumberStringConditionalTarget phone number (for mobile_money)
    providerStringConditionalMobile network operator (for mobile_money)
    account_numberStringConditionalDestination account number (for bank)
    bank_codeStringConditional4-digit bank identification code (for bank)
    amountDoubleYesAmount in Cedis (GHS)
    senderStringYesFull legal name of sender
    receiverStringYesFull legal name of recipient
    receiver_phoneStringNoRecipient contact phone number
    narrationStringNoTransfer payment context
    foreignIDStringYesUnique merchant transaction reference
    callbackUrlStringYesWebhook target for POST updates

    5. Remittance (Cross-Border Transfers)#

    Endpoint: POST /sendremittance
    cURL
    Node.js
    PHP
    Python

    6. Account Balance & Transaction Queries#

    6.1 Check Balance#

    Endpoint: POST /accountbalance
    cURL
    Node.js
    PHP
    Python
    Response Example:
    {
      "code": 200,
      "message": "success",
      "available_balance": 1500.00,
      "balance": 2000.00
    }
    

    6.2 Transaction Status Query#

    Endpoints:
    Collections: POST /checktranstatus
    Remittance: POST /checkremittancestatus
    cURL
    Node.js
    PHP
    Python
    Response Example:
    {
      "code": 200,
      "status": "SUCCESS",
      "info": {
        "status": "SUCCESS",
        "foreignID": "COL100002420223",
        "transID": "66a1697d-12be-4516-8a9e-20062b7dbbe0",
        "transID2": "87994952675",
        "partnerTransID": "78238387782872",
        "recipient": "0557079838",
        "provider": "mtn",
        "gateway": "mtn",
        "description": "TEST TRANSACTION"
      }
    }
    
    

    7. Webhooks & Callbacks#

    JuniPay dispatches real-time HTTP POST event payloads to the designated callbackUrl when processing state changes occur.

    Webhook Event Payloads#

    {
      "status": "success",
      "message": null,
      "trans_id": "COL100002377810",
      "foreignID": "1786697474738",
      "date": "2026-08-14 08:51:15",
      "amount": 150.00,
      "channel": "mobile_money",
      "provider": "mtn",
      "phoneNumber": "0557079838"
    }
    
    {
      "status": "failed",
      "message": "Insufficient funds or user cancelled",
      "trans_id": "COL100002377810",
      "foreignID": "1786697474738",
      "date": "2026-08-14 08:51:15",
      "amount": 150.00,
      "channel": "mobile_money",
      "provider": "mtn",
      "phoneNumber": "0557079838"
    }
    
    {
      "status": "pending",
      "message": "Awaiting customer approval",
      "trans_id": "COL100002377810",
      "foreignID": "1786697474738",
      "date": "2026-08-14 08:51:15",
      "amount": 150.00,
      "channel": "mobile_money",
      "provider": "mtn",
      "phoneNumber": "0557079838"
    }
    

    Delivery Guarantees & Receiver Response#

    Acknowledgement: Your server must respond with an HTTP 200 OK status code.
    Retry Policy: Notifications operate under an at-least-once delivery guarantee. If your endpoint returns non-2xx statuses or times out, JuniPay automatically queues retries.

    8. Settlement & Reporting#

    Historical activity logging, statement generation, and settlement reconciliations can be exported via the JuniPay Merchant Dashboard.

    9. Appendix: Bank Codes#

    CodeFinancial Institution
    2001Access Bank
    2002Absa Bank
    2003Agricultural Development Bank
    2004ARB Apex Bank Limited
    2005Bank of Africa
    2006Bank of Ghana
    2007CalBank PLC
    2008Consolidated Bank Ghana Limited
    2009Ecobank Ghana Limited
    2010Fidelity Bank Ghana Limited
    2011First Atlantic Bank Limited
    2012First National Bank (Ghana) Limited
    2013GCB Bank Limited
    2014Guaranty Trust Bank (Ghana) Limited
    2015National Investment Bank Limited
    2016Prudential Bank Limited
    2017Republic Bank (Ghana) PLC
    2018Stanbic Bank Ghana Limited
    2019Standard Chartered Bank (Ghana) Limited
    2020OmniBSIC Bank
    2021United Bank for Africa
    2022Universal Merchant Bank Limited
    2023Zenith Bank (Ghana) Limited
    2024First Bank of Nigeria
    2025Societe Generale Ghana

    10. Security & Operational Guidelines#

    Secret Key Protection: Keep API secrets and private keys within secure environment storage. Never expose credentials in client-side codebases or public repositories.
    Callback Validation: Validate processing callbacks by comparing incoming payload fields against transaction state records before fulfilling orders.
    Testing: Utilize the sandbox host https://sandbox.junipayments.com when integrating and executing initial end-to-end tests.
    Modified at 2026-08-24 12:11:06
    Next
    Authentication
    Built with