Create Payment Channel
curl --request POST \
--url https://charge-payment.com/v1/api/pgs/payment/v2/createPayment \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "<string>",
"userId": "<string>",
"amount": "<string>",
"currency": "<string>",
"callbackURL": "<string>",
"isV2": true
}
'import requests
url = "https://charge-payment.com/v1/api/pgs/payment/v2/createPayment"
payload = {
"reference": "<string>",
"userId": "<string>",
"amount": "<string>",
"currency": "<string>",
"callbackURL": "<string>",
"isV2": True
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference: '<string>',
userId: '<string>',
amount: '<string>',
currency: '<string>',
callbackURL: '<string>',
isV2: true
})
};
fetch('https://charge-payment.com/v1/api/pgs/payment/v2/createPayment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://charge-payment.com/v1/api/pgs/payment/v2/createPayment"
payload := strings.NewReader("{\n \"reference\": \"<string>\",\n \"userId\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"callbackURL\": \"<string>\",\n \"isV2\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://charge-payment.com/v1/api/pgs/payment/v2/createPayment")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"reference\": \"<string>\",\n \"userId\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"callbackURL\": \"<string>\",\n \"isV2\": true\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://charge-payment.com/v1/api/pgs/payment/v2/createPayment");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Basic <encoded-value>");
request.AddJsonBody("{\n \"reference\": \"<string>\",\n \"userId\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"callbackURL\": \"<string>\",\n \"isV2\": true\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"reference": 143379339129,
"clientId": "admintest7",
"paymentUrl": "https://sandbox.globalaccelerex.com:6038/pay/16661108ZjGG7aY39B",
"status": "CREATED",
"paymentChannel": "DEFAULT",
"paymentUrlReference": "16661108ZjGG7aY39B",
"externalPaymentReference": "16661108ZjGG7aY39B"
}{
"status": "Unexpected value sent for field paymentChannel"
}{
"responseMessage": "Unauthorised access to resource",
"responseCode": "01",
"responseStatus": "FAILED"
}API Reference
Create Payment Channel
This endpoint allows you to initiate a payment transaction. It is the first endpoint that is called regardless of payment method to be used.
POST
/
api
/
pgs
/
payment
/
v2
/
createPayment
Create Payment Channel
curl --request POST \
--url https://charge-payment.com/v1/api/pgs/payment/v2/createPayment \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "<string>",
"userId": "<string>",
"amount": "<string>",
"currency": "<string>",
"callbackURL": "<string>",
"isV2": true
}
'import requests
url = "https://charge-payment.com/v1/api/pgs/payment/v2/createPayment"
payload = {
"reference": "<string>",
"userId": "<string>",
"amount": "<string>",
"currency": "<string>",
"callbackURL": "<string>",
"isV2": True
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reference: '<string>',
userId: '<string>',
amount: '<string>',
currency: '<string>',
callbackURL: '<string>',
isV2: true
})
};
fetch('https://charge-payment.com/v1/api/pgs/payment/v2/createPayment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://charge-payment.com/v1/api/pgs/payment/v2/createPayment"
payload := strings.NewReader("{\n \"reference\": \"<string>\",\n \"userId\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"callbackURL\": \"<string>\",\n \"isV2\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://charge-payment.com/v1/api/pgs/payment/v2/createPayment")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"reference\": \"<string>\",\n \"userId\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"callbackURL\": \"<string>\",\n \"isV2\": true\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://charge-payment.com/v1/api/pgs/payment/v2/createPayment");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Basic <encoded-value>");
request.AddJsonBody("{\n \"reference\": \"<string>\",\n \"userId\": \"<string>\",\n \"amount\": \"<string>\",\n \"currency\": \"<string>\",\n \"callbackURL\": \"<string>\",\n \"isV2\": true\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"reference": 143379339129,
"clientId": "admintest7",
"paymentUrl": "https://sandbox.globalaccelerex.com:6038/pay/16661108ZjGG7aY39B",
"status": "CREATED",
"paymentChannel": "DEFAULT",
"paymentUrlReference": "16661108ZjGG7aY39B",
"externalPaymentReference": "16661108ZjGG7aY39B"
}{
"status": "Unexpected value sent for field paymentChannel"
}{
"responseMessage": "Unauthorised access to resource",
"responseCode": "01",
"responseStatus": "FAILED"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Response
Transaction Successful
Unique Transaction Reference Number
Example:
143379339129
Client unique ID
Example:
"admintest7"
Payment URL from the payment provider
Example:
"https://sandbox.globalaccelerex.com:6038/pay/16661108ZjGG7aY39B"
Payment Status
Example:
"CREATED"
Payment channel
Example:
"DEFAULT"
Payment unique reference
Example:
"16661108ZjGG7aY39B"
External payment unique reference
Example:
"16661108ZjGG7aY39B"