{
  "openapi": "3.1.0",
  "info": {
    "title": "Hubtel Direct Send Money API",
    "version": "1.0.0",
    "summary": "Pay out from your disbursement account to a mobile money wallet, and check a payout's status.",
    "description": "Pay out from your disbursement account to a mobile money wallet, and check a payout's status.\n\nThis reference describes the production **v1** API.",
    "x-hubtel-service": {
      "slug": "send-money",
      "group": "Payouts",
      "availability": [
        "business"
      ],
      "allowlist": true,
      "thirdParty": null
    },
    "x-hubtel-response-codes": [
      {
        "source": "business/api_documentation/payment_apis/4.direct_send_money.md",
        "columns": [
          "Response Code",
          "Description",
          "Required Action"
        ],
        "rows": [
          [
            "0000",
            "The transaction has been processed successfully.",
            "None"
          ],
          [
            "0001",
            "Request has been accepted. A callback will be sent on final state",
            "None"
          ],
          [
            "2001",
            "Transaction failed due to an error with the Payment Processor. Please review your request or retry in a few minutes Unable to verify if this is a valid Mobile Money Number. Please try again in a few minutes. Transaction not honoured.Denied by Rule : do not honour : HT-S0001 : Ensures there are no duplicates in Client Reference",
            "Inspect your request and try again later."
          ],
          [
            "3050",
            "Mobile Number is not registered for Mobile Payment.",
            "Ensure to pass the appropriate payment channel."
          ],
          [
            "4000",
            "Validation errors",
            "Validation errors. Something is not quite right with this request. Please check again."
          ],
          [
            "4075",
            "Insufficient prepaid balance",
            "You don't have enough funds in your Disbursement Account to send money to your customers. You can top-up your Disbursement Account by transferring funds from your available balance or bank deposit."
          ],
          [
            "5000",
            "Something went wrong while processing this request. Please try again later. We're working to resolve this.",
            "Inspect your request and try again or contact your Retail Systems Engineer for support"
          ]
        ]
      }
    ]
  },
  "servers": [
    {
      "url": "https://smp.hubtel.com",
      "description": "Production"
    },
    {
      "url": "https://developers.hubtel.com/sandbox/v1/smp",
      "description": "Hubtel Sandbox (test keys)"
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "tags": [
    {
      "name": "Direct Send Money",
      "description": "Pay out from your disbursement account to a mobile money wallet, and check a payout's status."
    }
  ],
  "paths": {
    "/api/merchants/{accountNumber}/send/mobilemoney": {
      "post": {
        "operationId": "sendMobileMoney",
        "summary": "Pay out to a mobile money wallet",
        "description": "Sends money from your disbursement account to a mobile money wallet. The response is pending; the final result is POSTed to `PrimaryCallbackUrl`. Your disbursement balance must cover the amount plus fees. If no callback arrives within 5 minutes, call **Check a payout's status**.",
        "tags": [
          "Direct Send Money"
        ],
        "parameters": [
          {
            "name": "accountNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your **disbursement account number** (prepaid), which funds payouts and purchases. Find it in your Hubtel merchant account under [Programmable keys → Account ID](/dashboard/account-ids). In the sandbox, use the disbursement account in Workbench."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "RecipientName": {
                    "type": "string",
                    "description": "The name on the recipient’s mobile money wallet. Recipient msisdn can be used instead if name is unknown."
                  },
                  "RecipientMsisdn": {
                    "type": "string",
                    "description": "The recipient’s mobile money number. This should be in the international format. E.g.: \"233249111411\""
                  },
                  "CustomerEmail": {
                    "type": "string",
                    "description": "The mobile money recipient’s email address."
                  },
                  "Channel": {
                    "type": "string",
                    "description": "The mobile money channel provider. Available channels are: mtn-gh, vodafone-gh, tigo-gh."
                  },
                  "Amount": {
                    "type": "number",
                    "description": "The amount to send, with at most 2 decimal places, for example 0.50."
                  },
                  "PrimaryCallbackURL": {
                    "type": "string",
                    "description": "URL expected to receive callback payload of Send Money transactions from Hubtel. Callbacks are sent for transactions with 0001 response code."
                  },
                  "Description": {
                    "type": "string",
                    "description": "A brief description of the transaction."
                  },
                  "ClientReference": {
                    "type": "string",
                    "description": "The reference provided by the API user and must be unique for every transaction and preferably be alphanumeric characters. Maximum length is 36 characters."
                  }
                },
                "required": [
                  "RecipientName",
                  "RecipientMsisdn",
                  "Channel",
                  "Amount",
                  "PrimaryCallbackURL",
                  "Description",
                  "ClientReference"
                ]
              },
              "example": {
                "RecipientName": "Joe Doe",
                "RecipientMsisdn": "233200000000",
                "CustomerEmail": "username@example.com",
                "Channel": "vodafone-gh",
                "Amount": 10,
                "PrimaryCallbackURL": "https://webhook.site/b503d1a9-e726-f315254a6ede",
                "Description": "Union Dues",
                "ClientReference": "25335r45pch53544044"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Business result in ResponseCode: `0001`, `2001`, `4000`, `4075`, `4101`, `4103`. See the response code table.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ResponseCode": {
                      "type": "string",
                      "description": "The unique response code on the status of the transaction."
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "AmountDebited": {
                          "type": "number",
                          "description": "The actual amount that is charged from your Disbursement Account before transaction is completed."
                        },
                        "TransactionId": {
                          "type": "string",
                          "description": "The unique ID used to identify a Hubtel transaction (from Hubtel)."
                        },
                        "Description": {
                          "type": "string",
                          "description": "The description of the ResponseCode received from the request."
                        },
                        "ClientReference": {
                          "type": "string",
                          "description": "The reference ID that is initially provided by the client/API user in the request payload (from merchant)."
                        },
                        "ExternalTransactionId": {
                          "type": "string",
                          "description": "The transaction reference from the mobile money provider (from Telco)."
                        },
                        "Amount": {
                          "type": "number",
                          "description": "Amount to be sent during the transaction."
                        },
                        "Charges": {
                          "type": "number",
                          "description": "The charge/fee for the transaction."
                        },
                        "Meta": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "description": "Additional transaction metadata. Can be null."
                        },
                        "RecipientName": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The name of the recipient of the transaction before the transaction is complete. Could be null."
                        }
                      },
                      "description": "An object containing the required data response from the API."
                    }
                  }
                },
                "examples": {
                  "example1": {
                    "summary": "SAMPLE RESPONSE",
                    "value": {
                      "ResponseCode": "0001",
                      "Data": {
                        "AmountDebited": 0,
                        "TransactionId": "8a545e5c7357714b80b65f76",
                        "Description": "Your request has been accepted. We will notify you when the transaction is completed.",
                        "ClientReference": "25335r45pch53544044",
                        "ExternalTransactionId": "",
                        "Amount": 10,
                        "Charges": 0,
                        "Meta": null,
                        "RecipientName": null
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "callbacks": {
          "finalStatus": {
            "{$request.body#/PrimaryCallbackUrl}": {
              "post": {
                "summary": "Final status callback",
                "description": "Hubtel sends the final result to this URL in a POST request. Callbacks aren't signed: accept them only from Hubtel's callback address and confirm with a status check. See /docs/callbacks.",
                "requestBody": {
                  "content": {
                    "application/json": {
                      "schema": {
                        "type": "object",
                        "properties": {
                          "ResponseCode": {
                            "type": "string"
                          },
                          "Data": {
                            "type": "object",
                            "properties": {
                              "AmountDebited": {
                                "type": "number"
                              },
                              "TransactionId": {
                                "type": "string"
                              },
                              "ClientReference": {
                                "type": "string"
                              },
                              "Description": {
                                "type": "string"
                              },
                              "ExternalTransactionId": {
                                "type": "string"
                              },
                              "Amount": {
                                "type": "integer"
                              },
                              "Charges": {
                                "type": "number"
                              },
                              "Meta": {},
                              "RecipientName": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      },
                      "examples": {
                        "successful": {
                          "summary": "SAMPLE CALLBACK (Successful)",
                          "value": {
                            "ResponseCode": "0000",
                            "Data": {
                              "AmountDebited": 10.1,
                              "TransactionId": "8a545e5c7357714b80b65f76",
                              "ClientReference": "25335r45pch53544044",
                              "Description": "The MTN Mobile Money payment has been approved and processed successfully.",
                              "ExternalTransactionId": "6654233478",
                              "Amount": 10,
                              "Charges": 0.1,
                              "Meta": null,
                              "RecipientName": "John Doe"
                            }
                          }
                        },
                        "failed": {
                          "summary": "SAMPLE CALLBACK (Failed)",
                          "value": {
                            "ResponseCode": "4075",
                            "Data": {
                              "AmountDebited": 14,
                              "TransactionId": "813723564a42bdb516392edf2ead5c",
                              "ClientReference": "dfb4B863C4C69",
                              "Description": "Insufficient prepaid balance.",
                              "ExternalTransactionId": null,
                              "Amount": 13.5,
                              "Charges": 0.5,
                              "Meta": null,
                              "RecipientName": "233241234567"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "responses": {
                  "200": {
                    "description": "Acknowledged."
                  }
                }
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://smp.hubtel.com",
            "description": "Production"
          },
          {
            "url": "https://developers.hubtel.com/sandbox/v1/smp",
            "description": "Hubtel Sandbox (test keys)"
          }
        ],
        "x-hubtel": {
          "host": "smp.hubtel.com",
          "alias": "smp",
          "service": "send-money",
          "review": "curated",
          "simulated": true,
          "allowlist": true,
          "responseCodes": [
            "0001",
            "2001",
            "4000",
            "4075",
            "4101",
            "4103"
          ],
          "idempotency": "ClientReference must be unique per payout.",
          "legacySources": [
            "business/api_documentation/payment_apis/4.direct_send_money.md",
            "business/api_documentation/lending_apis/8.direct_send_money.md"
          ]
        }
      }
    },
    "/api/merchants/{accountNumber}/transactions/status": {
      "get": {
        "operationId": "getPayoutStatus",
        "summary": "Check a payout's status",
        "description": "Returns the current status of a mobile money or bank payout by `clientReference`. Use it when no final callback has arrived within 5 minutes.",
        "tags": [
          "Direct Send Money"
        ],
        "parameters": [
          {
            "name": "accountNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your **disbursement account number** (prepaid), which funds payouts and purchases. Find it in your Hubtel merchant account under [Programmable keys → Account ID](/dashboard/account-ids). In the sandbox, use the disbursement account in Workbench."
          },
          {
            "name": "clientReference",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "3jL2KlUy3vt21",
            "description": "The clientReference of the transaction specified in the request payload."
          }
        ],
        "responses": {
          "200": {
            "description": "Business result in ResponseCode: `0000`, `4000`. See the response code table.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ResponseCode": {
                      "type": "string"
                    },
                    "Data": {
                      "type": "object",
                      "properties": {
                        "TransactionId": {
                          "type": "string"
                        },
                        "networkTransactionId": {
                          "type": "string"
                        },
                        "Amount": {
                          "type": "number"
                        },
                        "Fees": {
                          "type": "number"
                        },
                        "ClientReference": {
                          "type": "string"
                        },
                        "Channel": {
                          "type": "string"
                        },
                        "CustomerNumber": {
                          "type": "string"
                        },
                        "transactionStatus": {
                          "type": "string"
                        },
                        "CreatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "example1": {
                    "summary": "SAMPLE RESPONSE",
                    "value": {
                      "ResponseCode": "success",
                      "Data": {
                        "TransactionId": "09f84e20a283942e807128e8c21d0303",
                        "networkTransactionId": "142116938399",
                        "Amount": 0.8,
                        "Fees": 0.01,
                        "ClientReference": "3jL2KlUy3vt21",
                        "Channel": "vodafone-gh",
                        "CustomerNumber": "233200000000",
                        "transactionStatus": "success",
                        "CreatedAt": "2021-08-23 11:31:06"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "servers": [
          {
            "url": "https://smrsc.hubtel.com",
            "description": "Production"
          },
          {
            "url": "https://developers.hubtel.com/sandbox/v1/smrsc",
            "description": "Hubtel Sandbox (test keys)"
          }
        ],
        "x-hubtel": {
          "host": "smrsc.hubtel.com",
          "alias": "smrsc",
          "service": "send-money",
          "review": "curated",
          "simulated": true,
          "allowlist": true,
          "responseCodes": [
            "0000",
            "4000"
          ],
          "idempotency": null,
          "legacySources": [
            "business/api_documentation/payment_apis/4.direct_send_money.md",
            "business/api_documentation/payment_apis/5.direct_sendtobank.md",
            "business/api_documentation/lending_apis/8.direct_send_money.md"
          ]
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Base64 of `API ID:API Key`."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid credentials.",
        "content": {
          "application/json": {
            "example": {
              "Message": "Client request keys do not match API keys on business",
              "ResponseCode": "4101",
              "Data": ""
            }
          }
        }
      },
      "Forbidden": {
        "description": "The caller's IP is not allowlisted for this service (production may time out instead), or a sandbox key lacks the scope.",
        "content": {
          "application/json": {
            "example": {
              "ResponseCode": "4030",
              "Message": "Requests from <your-ip> are not allowed for this service. Add the IP in Workbench → IP allowlist.",
              "code": "ip_not_allowlisted",
              "your_ip": "<your-ip>"
            }
          }
        }
      }
    }
  }
}