cGrate

API Endpoint

cGrate is a Zambian integrator of electronic vouchers that BroadPay have used to provide various products. See https://543.cgrate.co.zm/

Electricity

Electricity

POST /zm-cgrate-broadpay/electricity
Requestsexample 1
Headers
Content-Type: application/json
X-Nomanini-Organisation: nomanini
Authorization: Bearer 6518bce32048dfd1b9c205b9bb635b14
Body
{
  "meter_number": "12345678901",
  "amount": 150,
  "source_reference": "2396ef29085f25e559e04ad9ff975282"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "meter_number": {
      "type": "string",
      "minLength": 11,
      "maxLength": 11,
      "description": "The meter number used to uniquely identify an electricity meter"
    },
    "amount": {
      "type": "number",
      "multipleOf": 0.01,
      "minimum": 0,
      "exclusiveMinimum": true,
      "description": "The amount of electricity to buy"
    },
    "source_reference": {
      "type": "string",
      "maxLength": 50,
      "description": "A unique identifier for this transaction used for deduplication."
    }
  },
  "additionalProperties": false,
  "required": [
    "meter_number",
    "amount",
    "source_reference"
  ]
}
Responses201
Body
{
  "external_transaction_id": "EX4A3MV15",
  "token": "49715748115165069899",
  "serial_number": "1519289086988"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "external_transaction_id": {
      "type": "string",
      "description": "The cGrate systems identifier for this purchase."
    },
    "token": {
      "type": "string",
      "description": "The number that is typed in to the electricity meter to redeem the value."
    },
    "serial_number": {
      "type": "string",
      "description": "Serial number of the purchase returned by the electricity provider, Zesco."
    }
  },
  "additionalProperties": false,
  "required": [
    "external_transaction_id",
    "token",
    "serial_number"
  ]
}

Electricity
POST/zm-cgrate-broadpay/electricity

Request a Zesco prepaid electricity token for the meter and amount specified.

Permissions: cgrate:admin


Airtime

Direct topup

POST /zm-cgrate-broadpay/directtopup
Requestsexample 1
Headers
Content-Type: application/json
X-Nomanini-Organisation: nomanini
Authorization: Bearer 6518bce32048dfd1b9c205b9bb635b14
Body
{
  "msisdn": "+254123456789",
  "amount": 100,
  "provider": "zamtel",
  "source_reference": "2396ef29085f25e559e04ad9ff975282"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "msisdn": {
      "type": "string",
      "pattern": "^\\+[1-9]{1}[0-9]{3,14}$",
      "description": "MSISDN (telephone) number that should receive the airtime topup."
    },
    "amount": {
      "type": "number",
      "description": "The amount to recharge."
    },
    "provider": {
      "type": "string",
      "enum": [
        "zamtel"
      ],
      "description": "The network provider that this MSISDN belongs to. They will provide the topup to the customer MSISDN."
    },
    "source_reference": {
      "type": "string",
      "description": "A unique identifier for this transaction used for deduplication."
    }
  },
  "additionalProperties": false,
  "required": [
    "msisdn",
    "amount",
    "provider",
    "source_reference"
  ]
}
Responses201
Body
{
  "external_transaction_id": "EX4A3MV15",
  "serial_number": "1519289086988"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "external_transaction_id": {
      "type": "string",
      "description": "The cGrate identifier for this purchase."
    },
    "serial_number": {
      "type": "string",
      "description": "Serial number of the purchase returned by the airtime provider."
    }
  },
  "additionalProperties": false,
  "required": [
    "external_transaction_id",
    "serial_number"
  ]
}

Direct topup
POST/zm-cgrate-broadpay/directtopup

Perform a top up of a specific amount to the telephone number (MSISDN) supplied. The MSISDN must be part of the providers network.

Permissions: cgrate:admin


Balance

Balance

GET /zm-cgrate-broadpay/balance
Requestsexample 1
Headers
Content-Type: application/json
X-Nomanini-Organisation: nomanini
Authorization: Bearer 6518bce32048dfd1b9c205b9bb635b14
Responses200
Body
{
  "balance": 1050.2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "balance": {
      "type": "number",
      "multipleOf": 0.01,
      "description": "The current balance of the cGrate trading account."
    }
  },
  "additionalProperties": false,
  "required": [
    "balance"
  ]
}

Query current balance
GET/zm-cgrate-broadpay/balance

Get the last known balance of our cGrate trading account.

Permissions: sales:view


Generated by aglio on 07 Jun 2018