Schedule Payments›Create
Create - Electricity (weekly)
Schedule recurring electricity tokens. customer_id is the meter number (validated with the provider), code is the meter type (prepaid | postpaid). amount is ₦1,000 - ₦50,000 and must meet the meter's minimum vend.
Send your secret key in the
P-API-KEY header. Keep it on your server, never in an app or browser.Body (JSON)
-
service string RequiredExample:
electricity -
biller string RequiredExample:
ikeja-electric -
customer_id string RequiredExample:
45067198783 -
code string RequiredExample:
prepaid -
amount integer RequiredExample:
5000 -
frequency string RequiredExample:
weekly -
start_at string RequiredExample:
{{startAt}}
Request
curl --request POST \ --url 'https://api.paybeta.ng/v2/scheduled-payments' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'P-API-KEY: YOUR_SECRET_KEY' \ --data '{ "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" }'curl --request POST \ --url 'https://api.sandbox.paybeta.ng/v2/scheduled-payments' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'P-API-KEY: YOUR_SECRET_KEY' \ --data '{ "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" }'
<?php use Illuminate\Support\Facades\Http; $response = Http::withHeaders([ 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'P-API-KEY' => 'YOUR_SECRET_KEY', ])->post('https://api.paybeta.ng/v2/scheduled-payments', [ 'service' => 'electricity', 'biller' => 'ikeja-electric', 'customer_id' => '45067198783', 'code' => 'prepaid', 'amount' => 5000, 'frequency' => 'weekly', 'start_at' => '{{startAt}}', ]); $data = $response->json();<?php use Illuminate\Support\Facades\Http; $response = Http::withHeaders([ 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'P-API-KEY' => 'YOUR_SECRET_KEY', ])->post('https://api.sandbox.paybeta.ng/v2/scheduled-payments', [ 'service' => 'electricity', 'biller' => 'ikeja-electric', 'customer_id' => '45067198783', 'code' => 'prepaid', 'amount' => 5000, 'frequency' => 'weekly', 'start_at' => '{{startAt}}', ]); $data = $response->json();
const response = await fetch('https://api.paybeta.ng/v2/scheduled-payments', { method: 'POST', headers: { "Accept": "application/json", "Content-Type": "application/json", "P-API-KEY": "YOUR_SECRET_KEY", }, body: JSON.stringify({ "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" }), }); const data = await response.json();const response = await fetch('https://api.sandbox.paybeta.ng/v2/scheduled-payments', { method: 'POST', headers: { "Accept": "application/json", "Content-Type": "application/json", "P-API-KEY": "YOUR_SECRET_KEY", }, body: JSON.stringify({ "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" }), }); const data = await response.json();
import requests response = requests.request( "POST", "https://api.paybeta.ng/v2/scheduled-payments", headers={ "Accept": "application/json", "Content-Type": "application/json", "P-API-KEY": "YOUR_SECRET_KEY", }, json={ "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" }, ) data = response.json()import requests response = requests.request( "POST", "https://api.sandbox.paybeta.ng/v2/scheduled-payments", headers={ "Accept": "application/json", "Content-Type": "application/json", "P-API-KEY": "YOUR_SECRET_KEY", }, json={ "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" }, ) data = response.json()
POST /v2/scheduled-payments HTTP/1.1 Host: api.paybeta.ng Accept: application/json Content-Type: application/json P-API-KEY: YOUR_SECRET_KEY { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" }POST /v2/scheduled-payments HTTP/1.1 Host: api.sandbox.paybeta.ng Accept: application/json Content-Type: application/json P-API-KEY: YOUR_SECRET_KEY { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" }
import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; String body = """ { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } """; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.paybeta.ng/v2/scheduled-payments")) .header("Accept", "application/json") .header("Content-Type", "application/json") .header("P-API-KEY", "YOUR_SECRET_KEY") .method("POST", HttpRequest.BodyPublishers.ofString(body)) .build(); HttpResponse<String> response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body());import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; String body = """ { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } """; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.sandbox.paybeta.ng/v2/scheduled-payments")) .header("Accept", "application/json") .header("Content-Type", "application/json") .header("P-API-KEY", "YOUR_SECRET_KEY") .method("POST", HttpRequest.BodyPublishers.ofString(body)) .build(); HttpResponse<String> response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body());
using System.Net.Http; using System.Text; using var client = new HttpClient(); var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.paybeta.ng/v2/scheduled-payments"); request.Headers.TryAddWithoutValidation("Accept", "application/json"); request.Headers.TryAddWithoutValidation("P-API-KEY", "YOUR_SECRET_KEY"); request.Content = new StringContent( """ { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } """, Encoding.UTF8, "application/json"); var response = await client.SendAsync(request); var data = await response.Content.ReadAsStringAsync(); Console.WriteLine(data);using System.Net.Http; using System.Text; using var client = new HttpClient(); var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.sandbox.paybeta.ng/v2/scheduled-payments"); request.Headers.TryAddWithoutValidation("Accept", "application/json"); request.Headers.TryAddWithoutValidation("P-API-KEY", "YOUR_SECRET_KEY"); request.Content = new StringContent( """ { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } """, Encoding.UTF8, "application/json"); var response = await client.SendAsync(request); var data = await response.Content.ReadAsStringAsync(); Console.WriteLine(data);
package main import ( "fmt" "io" "net/http" "strings" ) func main() { req, _ := http.NewRequest("POST", "https://api.paybeta.ng/v2/scheduled-payments", strings.NewReader(`{ "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" }`)) req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.Header.Set("P-API-KEY", "YOUR_SECRET_KEY") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() data, _ := io.ReadAll(res.Body) fmt.Println(string(data)) }package main import ( "fmt" "io" "net/http" "strings" ) func main() { req, _ := http.NewRequest("POST", "https://api.sandbox.paybeta.ng/v2/scheduled-payments", strings.NewReader(`{ "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" }`)) req.Header.Set("Accept", "application/json") req.Header.Set("Content-Type", "application/json") req.Header.Set("P-API-KEY", "YOUR_SECRET_KEY") res, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer res.Body.Close() data, _ := io.ReadAll(res.Body) fmt.Println(string(data)) }
require "net/http" require "json" uri = URI("https://api.paybeta.ng/v2/scheduled-payments") request = Net::HTTP::Post.new(uri) request["Accept"] = "application/json" request["Content-Type"] = "application/json" request["P-API-KEY"] = "YOUR_SECRET_KEY" request.body = <<~'JSON' { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } JSON response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http| http.request(request) end data = JSON.parse(response.body)require "net/http" require "json" uri = URI("https://api.sandbox.paybeta.ng/v2/scheduled-payments") request = Net::HTTP::Post.new(uri) request["Accept"] = "application/json" request["Content-Type"] = "application/json" request["P-API-KEY"] = "YOUR_SECRET_KEY" request.body = <<~'JSON' { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } JSON response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http| http.request(request) end data = JSON.parse(response.body)
import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody.Companion.toRequestBody val client = OkHttpClient() val body = """ { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } """.trimIndent().toRequestBody("application/json".toMediaType()) val request = Request.Builder() .url("https://api.paybeta.ng/v2/scheduled-payments") .method("POST", body) .addHeader("Accept", "application/json") .addHeader("Content-Type", "application/json") .addHeader("P-API-KEY", "YOUR_SECRET_KEY") .build() client.newCall(request).execute().use { response -> println(response.body?.string()) }import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.RequestBody.Companion.toRequestBody val client = OkHttpClient() val body = """ { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } """.trimIndent().toRequestBody("application/json".toMediaType()) val request = Request.Builder() .url("https://api.sandbox.paybeta.ng/v2/scheduled-payments") .method("POST", body) .addHeader("Accept", "application/json") .addHeader("Content-Type", "application/json") .addHeader("P-API-KEY", "YOUR_SECRET_KEY") .build() client.newCall(request).execute().use { response -> println(response.body?.string()) }
import Foundation var request = URLRequest(url: URL(string: "https://api.paybeta.ng/v2/scheduled-payments")!) request.httpMethod = "POST" request.setValue("application/json", forHTTPHeaderField: "Accept") request.setValue("application/json", forHTTPHeaderField: "Content-Type") request.setValue("YOUR_SECRET_KEY", forHTTPHeaderField: "P-API-KEY") request.httpBody = #""" { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } """#.data(using: .utf8) let (data, _) = try await URLSession.shared.data(for: request) print(String(data: data, encoding: .utf8)!)import Foundation var request = URLRequest(url: URL(string: "https://api.sandbox.paybeta.ng/v2/scheduled-payments")!) request.httpMethod = "POST" request.setValue("application/json", forHTTPHeaderField: "Accept") request.setValue("application/json", forHTTPHeaderField: "Content-Type") request.setValue("YOUR_SECRET_KEY", forHTTPHeaderField: "P-API-KEY") request.httpBody = #""" { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } """#.data(using: .utf8) let (data, _) = try await URLSession.shared.data(for: request) print(String(data: data, encoding: .utf8)!)
import 'package:http/http.dart' as http; final response = await http.post( Uri.parse('https://api.paybeta.ng/v2/scheduled-payments'), headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'P-API-KEY': 'YOUR_SECRET_KEY', }, body: r''' { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } ''', ); print(response.body);import 'package:http/http.dart' as http; final response = await http.post( Uri.parse('https://api.sandbox.paybeta.ng/v2/scheduled-payments'), headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'P-API-KEY': 'YOUR_SECRET_KEY', }, body: r''' { "service": "electricity", "biller": "ikeja-electric", "customer_id": "45067198783", "code": "prepaid", "amount": 5000, "frequency": "weekly", "start_at": "{{startAt}}" } ''', ); print(response.body);
Response
No example response yet.