HubtelDevelopers
API referenceRecurring Invoice

Create a recurring invoice

POST
/api/proxy/{accountNumber}/create-invoice

Starts a recurring mobile-money invoice. The response is pending (0001) with a requestId and otpPrefix; the OTP lands on the Virtual Phone. After Verify a recurring invoice and the customer approves the prompt, the initial debit result is POSTed to callbackUrl. Use the same test numbers as Receive Money.

Authorization

basicAuth
AuthorizationBasic <token>

Base64 of API ID:API Key.

In: header

Path Parameters

accountNumber*string

Your collection account number (POS sales), where customer payments land. Find it in your Hubtel merchant account under Programmable keys → Account ID. In the sandbox, use the collection account in Workbench.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/proxy/string/create-invoice" \  -H "Content-Type: application/json" \  -d '{    "orderDate": "2022-01-28T08:57:00",    "invoiceEndDate": "2022-01-31T08:57:00",    "description": "My recurring service",    "startTime": "14:00",    "paymentInterval": "DAILY",    "customerMobileNumber": "233240000000",    "paymentOption": "MobileMoney",    "channel": "mtn_gh_rec",    "customerName": "Joe Doe",    "recurringAmount": 0.1,    "totalAmount": 0.1,    "initialAmount": 0.1,    "currency": "GHS",    "callbackUrl": "https://webhook.site/b503d1a9-e726-f315254a6ede"  }'
{  "responseCode": "0001",  "message": "Your request has been processed successfully.",  "data": {    "recurringInvoiceId": "0f84e20a2839482e807128e8c21d08d6",    "requestId": "a6487bc44eae44849fd80326a0dd802a",    "otpPrefix": "OQDM"  }}