Submit payment through the hosted checkout page
curl --request POST \
--url https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Checkout-Token: <x-checkout-token>' \
--data '
{
"rail": "mobile_money",
"customer": {
"phone_number": "+265991234567"
}
}
'import requests
url = "https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit"
payload = {
"rail": "mobile_money",
"customer": { "phone_number": "+265991234567" }
}
headers = {
"X-Checkout-Token": "<x-checkout-token>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Checkout-Token': '<x-checkout-token>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({rail: 'mobile_money', customer: {phone_number: '+265991234567'}})
};
fetch('https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rail' => 'mobile_money',
'customer' => [
'phone_number' => '+265991234567'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Checkout-Token: <x-checkout-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit"
payload := strings.NewReader("{\n \"rail\": \"mobile_money\",\n \"customer\": {\n \"phone_number\": \"+265991234567\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Checkout-Token", "<x-checkout-token>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit")
.header("X-Checkout-Token", "<x-checkout-token>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rail\": \"mobile_money\",\n \"customer\": {\n \"phone_number\": \"+265991234567\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Checkout-Token"] = '<x-checkout-token>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rail\": \"mobile_money\",\n \"customer\": {\n \"phone_number\": \"+265991234567\"\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "e3d4b5c6-...",
"status": "collection_bound",
"collection_id": "a1b2c3d4-...",
"collection_status": "pending"
}Checkout
Submit payment through the hosted checkout page
POST
/
v1
/
checkout
/
sessions
/
by-token
/
{token}
/
submit
Submit payment through the hosted checkout page
curl --request POST \
--url https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Checkout-Token: <x-checkout-token>' \
--data '
{
"rail": "mobile_money",
"customer": {
"phone_number": "+265991234567"
}
}
'import requests
url = "https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit"
payload = {
"rail": "mobile_money",
"customer": { "phone_number": "+265991234567" }
}
headers = {
"X-Checkout-Token": "<x-checkout-token>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Checkout-Token': '<x-checkout-token>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({rail: 'mobile_money', customer: {phone_number: '+265991234567'}})
};
fetch('https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rail' => 'mobile_money',
'customer' => [
'phone_number' => '+265991234567'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Checkout-Token: <x-checkout-token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit"
payload := strings.NewReader("{\n \"rail\": \"mobile_money\",\n \"customer\": {\n \"phone_number\": \"+265991234567\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Checkout-Token", "<x-checkout-token>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit")
.header("X-Checkout-Token", "<x-checkout-token>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rail\": \"mobile_money\",\n \"customer\": {\n \"phone_number\": \"+265991234567\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.eqxpay.io/v1/checkout/sessions/by-token/{token}/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Checkout-Token"] = '<x-checkout-token>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rail\": \"mobile_money\",\n \"customer\": {\n \"phone_number\": \"+265991234567\"\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "e3d4b5c6-...",
"status": "collection_bound",
"collection_id": "a1b2c3d4-...",
"collection_status": "pending"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Session token from checkout URL
Path Parameters
Body
application/json
Get public session data for the checkout page (no auth required)
Previous
Get a checkout session by ID (integrator-scoped)
Next
⌘I