B2G MBES API Documentation

FIRS MBS e-Invoicing Integration

Version 1.0 Last Updated: 2025

Overview

Base URL: https://api.piis-ng.com/b2g-mbes/v1

This API allows for the integration of Enterprise Resource Planning (ERP) and accounting systems with the PIIS B2G MBES platform to generate, manage, and submit e-Invoices to the Federal Inland Revenue Service (FIRS) MBS system in compliance with Nigerian tax regulations.

The API facilitates real-time and batch processing of invoice data, IRN (Invoice Registration Number) issuance, and provides status updates.

Real-time Processing

Submit invoices and receive IRNs in real-time

Secure & Compliant

Fully compliant with FIRS MBS standards

Batch Operations

Process multiple invoices efficiently

Authentication & Security

All API requests must be authenticated using a multi-layered security approach.

Important Security Notes

  • API Key: An X-API-Key header must be included with every request.
  • Bearer Token: A JWT token obtained via the authentication endpoint.
  • Encryption: All data in transit uses TLS 1.2+.
  • Data at Rest: Stored data is encrypted using AES-256.

Get Authentication Token

This is a server-to-server authentication flow. The API Key is provided during initial system provisioning.

POST /auth/token
// Request Headers
Content-Type: application/json
X-API-Key: your_provisioned_api_key

// Request Body
{
  "clientId": "your_client_id"
}

// Response
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}

E-Invoice Management

Generate e-Invoice & IRN

This endpoint submits invoice data to the B2G MBES platform, which validates it, generates a compliant e-Invoice, submits it to the FIRS MBS, and returns the FIRS-generated IRN.

POST /einvoices
// Request Headers
Authorization: Bearer <your_access_token>
X-API-Key: your_provisioned_api_key
Content-Type: application/json

// Request Body
{
  "invoiceHeader": {
    "invoiceNumber": "INV-2025-001",
    "issueDate": "2025-11-18",
    "dueDate": "2025-12-18",
    "currency": "NGN",
    "taxAmount": 15000.00,
    "totalAmount": 115000.00
  },
  "seller": {
    "taxIdentificationNumber": "12345678-0001",
    "name": "Named Client Ltd.",
    "address": "123 Business Ave, Lagos"
  },
  "buyer": {
    "taxIdentificationNumber": "87654321-0001",
    "name": "Buyer Company Ltd.",
    "address": "456 Customer St, Abuja"
  },
  "lineItems": [
    {
      "description": "Software Development Services",
      "quantity": 1,
      "unitPrice": 100000.00,
      "taxAmount": 15000.00
    }
  ]
}

// Response (201 Created)
{
  "id": "einv_piis_abc123def456",
  "clientInvoiceId": "INV-2025-001",
  "firsIrn": "FIRSNG.IRN.20251118.ABC123XYZ",
  "status": "SUCCESS",
  "submittedAt": "2025-11-18T14:30:00Z",
  "qrCodeUrl": "https://api.piis-ng.com/qr/FIRSNG.IRN.20251118.ABC123XYZ"
}

Get e-Invoice Status

GET /einvoices/{e_invoice_id}

Cancel e-Invoice

POST /einvoices/{e_invoice_id}/cancel

System Health & Synchronization

Check System Status

Check the operational status of the B2G MBES API and its connection to the FIRS MBS.

GET /system/health
// Response
{
  "status": "OPERATIONAL",
  "version": "1.0.0",
  "firsConnectivity": true,
  "lastChecked": "2025-11-18T16:45:10Z"
}

Sync Status (Webhook)

To ensure data consistency, the B2G MBES platform can send webhook notifications to a pre-configured endpoint in your ERP system for critical status updates.

// Webhook Payload Example
{
  "eventType": "EINVOICE_STATUS_UPDATED",
  "resourceId": "einv_piis_abc123def456",
  "timestamp": "2025-11-18T14:31:05Z",
  "data": {
    "newStatus": "SUCCESS",
    "firsIrn": "FIRSNG.IRN.20251118.ABC123XYZ"
  }
}

Error Handling

Standard HTTP status codes are used. In case of an error, the response body will contain details.

// Error Response Example (400 Bad Request)
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "The provided invoice data failed validation.",
    "details": [
      "Buyer TIN is not in a valid format."
    ]
  }
}
Code Description
400 Bad Request (Invalid input data)
401 Unauthorized (Invalid/Missing API Key or Token)
403 Forbidden (Insufficient permissions)
429 Too Many Requests (Rate limit exceeded)
500 Internal Server Error
502 Bad Gateway (Temporary issue with FIRS MBS)

Service Level Agreement (SLA) Summary

Uptime

99.5%

monthly availability

Scheduled Maintenance

≤ 4 hours

per month with 24-hour notice

Support Response Times

Severity Description Response Time Resolution Time
Critical (P1) System outage or e-Invoice transmission failure 30 minutes Within 4 hours
High (P2) Delayed IRN generation, integration lag, or data mismatch 1 hour Within 8 hours
Medium (P3) Functional error, interface glitch, or app connectivity downtime 4 hours Within 24 hours
Low (P4) Minor ERP connectivity issues, UI or documentation issues 8 hours Within 48 hours

Compliance & Data Protection

This API and the B2G MBES service are designed to be fully compliant with:

FIRS MBS Standards

E-invoicing schema & IRN validation

NDPA 2023

Nigeria Data Protection Act

AWS Infrastructure

Secure, redundant hosting

Copyright © 2025 PIIS NG. All rights reserved.