Terraswitch
  • Terraswitch - Get Started
  • Test & Live Environments
  • Onboarding as a Business
  • GUIDES
    • 🎾Authentication
    • 🧀Webhooks
    • 🫓Status & Responses
    • 🏉API Rate Limits
    • 🚀Transactions & Destinations
    • 🍊Testing Credentials
    • 🚐Crafting Metadata
  • API ENDPOINTS
    • Account
      • Get Account Details
      • Get Banks
      • Get Beneficiaries
      • Add Bank
      • Change Settlement Bank
    • Wallet
      • Get Wallet Details
      • Get Wallet Transactions
    • Collections
      • Checkout
        • Initialize Transaction
      • Transfer
        • Generate Account
      • Charge
        • Create Charge
        • Authorize Charge
        • Charge Authorization
      • Bank
        • Pay with Opay
    • Payout
      • Bank Transfer
      • Withdraw Money
    • Products
      • List Products
      • Search Products
      • Filter Products
      • Fetch Product
      • Create Product
      • Update Product
    • Subaccounts
      • List Subaccounts
      • Search Subaccounts
      • Filter Subaccounts
      • Fetch Subaccount
      • Create Subaccount
      • Update Subaccount
    • Payment Links
      • List Payment Links
      • List Payment Link Transactions
      • Search Payment Links
      • Filter Payment Links
      • Fetch Payment Link
      • Create Payment Link
      • Update Payment Link
      • Attach Payment Resource
      • Remove Subaccount
      • Enable Payment Link
      • Disable Payment Link
    • Invoices
      • List Invoices
      • Search Invoices
      • Filter Invoices
      • Fetch Invoice
      • Create Invoice
      • Update Invoice
      • Remove Invoice Item
    • Transactions
      • List Transactions
      • Search Transactions
      • Filter Transactions
      • Verify Transaction
    • Refunds
      • List Refunds
      • Fetch Refund
      • Create Refund
    • Bills Payment
      • List Mobile Networks
      • List Bill Categories
      • List Bill Sub-Categories
      • List Mobile Data Plans
      • Validate Biller
      • Validate Bill Status
      • Validate Top-Up Status
      • Buy Airtime
      • Buy Data
      • Pay Bill
    • Resources
      • List Banks
      • List Countries
      • Resolve Bank Account
Powered by GitBook
On this page
  1. API ENDPOINTS
  2. Bills Payment

Pay Bill

Pay electricity or cableTv bills

POST {{ BASE_URL }}/v1/corporate/bill

Body Parameters

Property
Data Type
Description
Example
Required

type

string

The label of the bill category you get from List Bill Categories endpoint.

"cable"

Yes

amount

number

The airtime amount you want to buy

2000

Yes

phoneNumber

string

The recipient 11-digit phone number.

"08137031202"

Yes

phoneCode

string

The recipient phone number country call code.

"+234"

Yes

itemId

string or number

The bill item id from the List Bill Sub-Categories endpoint

1465

Yes

customerId

string

The customer id for the specific bill category. Use cable: 7032691481 for testing purposes

"7032691481"

Yes

billerId

string

The biller id you get from List Bill Sub-Categories endpoint

"1456"

Yes

pin

string

Your 4-digit transaction PIN

"0000"

Yes

reference

string

Your preferred transaction reference

"txref_0937638BCC"

No

import Axios from 'axios';

// set the api url
const API_URL = `${BASE_URL}/v1/corporate/bill`;

// define request data
const data = {
    amount:4150.00,
    phoneNumber: "08137031202",
    phoneCode: "+234",
    itemId: 1465,
    pin:"3662",
    customerId: "7032691481",
    type: "cable",
    billerId: "1465",
    reference: "txref_0937638BCC"
}

// make request using axios
Axios({
    method: "POST",
    url: `${API_URL}`,
    headers: {
        lg: 'en',
        ch: 'web'
        Authorization: `Bearer ${API_KEY}`,
        'Content-Type': 'application/json',
    },
    data: data
}).then((resp) => {
    console.log(resp)
}).catch((err) => {
    console.log(err)
})
{
    "error": false,
    "errors": [],
    "data": {
        "amount": 4150,
        "reference": "VPXc3731ffc-7c9d4e3a"
    },
    "message": "successful",
    "status": 200
}
PreviousBuy DataNextResources

Last updated 5 months ago