cURL
curl --request POST \
--url https://api.paycashless.com/v1/payments \
--header 'Content-Type: application/json' \
--header 'Request-Signature: <request-signature>' \
--header 'Request-Timestamp: <request-timestamp>' \
--data '
{
"reference": "<string>",
"paymentMethod": "pay_with_transfer",
"amount": {
"value": 50001,
"currency": "NGN"
},
"customer": {
"email": "[email protected]",
"name": "<string>"
},
"expiresIn": 1800,
"callbackUrl": "<string>",
"metadata": {}
}
'import requests
url = "https://api.paycashless.com/v1/payments"
payload = {
"reference": "<string>",
"paymentMethod": "pay_with_transfer",
"amount": {
"value": 50001,
"currency": "NGN"
},
"customer": {
"email": "[email protected]",
"name": "<string>"
},
"expiresIn": 1800,
"callbackUrl": "<string>",
"metadata": {}
}
headers = {
"Request-Signature": "<request-signature>",
"Request-Timestamp": "<request-timestamp>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Request-Signature': '<request-signature>',
'Request-Timestamp': '<request-timestamp>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
reference: '<string>',
paymentMethod: 'pay_with_transfer',
amount: {value: 50001, currency: 'NGN'},
customer: {email: '[email protected]', name: '<string>'},
expiresIn: 1800,
callbackUrl: '<string>',
metadata: {}
})
};
fetch('https://api.paycashless.com/v1/payments', 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://api.paycashless.com/v1/payments",
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([
'reference' => '<string>',
'paymentMethod' => 'pay_with_transfer',
'amount' => [
'value' => 50001,
'currency' => 'NGN'
],
'customer' => [
'email' => '[email protected]',
'name' => '<string>'
],
'expiresIn' => 1800,
'callbackUrl' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Request-Signature: <request-signature>",
"Request-Timestamp: <request-timestamp>"
],
]);
$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://api.paycashless.com/v1/payments"
payload := strings.NewReader("{\n \"reference\": \"<string>\",\n \"paymentMethod\": \"pay_with_transfer\",\n \"amount\": {\n \"value\": 50001,\n \"currency\": \"NGN\"\n },\n \"customer\": {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\"\n },\n \"expiresIn\": 1800,\n \"callbackUrl\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Request-Signature", "<request-signature>")
req.Header.Add("Request-Timestamp", "<request-timestamp>")
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://api.paycashless.com/v1/payments")
.header("Request-Signature", "<request-signature>")
.header("Request-Timestamp", "<request-timestamp>")
.header("Content-Type", "application/json")
.body("{\n \"reference\": \"<string>\",\n \"paymentMethod\": \"pay_with_transfer\",\n \"amount\": {\n \"value\": 50001,\n \"currency\": \"NGN\"\n },\n \"customer\": {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\"\n },\n \"expiresIn\": 1800,\n \"callbackUrl\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paycashless.com/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Request-Signature"] = '<request-signature>'
request["Request-Timestamp"] = '<request-timestamp>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference\": \"<string>\",\n \"paymentMethod\": \"pay_with_transfer\",\n \"amount\": {\n \"value\": 50001,\n \"currency\": \"NGN\"\n },\n \"customer\": {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\"\n },\n \"expiresIn\": 1800,\n \"callbackUrl\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"reference": "<string>",
"accountName": "<string>",
"accountNumber": "<string>",
"bankName": "<string>",
"amount": {
"value": 123,
"currency": "<string>"
},
"customer": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"address": "<string>",
"reference": "<string>",
"isBlacklisted": true,
"liveMode": true
},
"liveMode": true,
"expiresAt": "2023-11-07T05:31:56Z",
"metadata": {}
}Payments
Initiate a payment
Initiate a payment
POST
/
v1
/
payments
cURL
curl --request POST \
--url https://api.paycashless.com/v1/payments \
--header 'Content-Type: application/json' \
--header 'Request-Signature: <request-signature>' \
--header 'Request-Timestamp: <request-timestamp>' \
--data '
{
"reference": "<string>",
"paymentMethod": "pay_with_transfer",
"amount": {
"value": 50001,
"currency": "NGN"
},
"customer": {
"email": "[email protected]",
"name": "<string>"
},
"expiresIn": 1800,
"callbackUrl": "<string>",
"metadata": {}
}
'import requests
url = "https://api.paycashless.com/v1/payments"
payload = {
"reference": "<string>",
"paymentMethod": "pay_with_transfer",
"amount": {
"value": 50001,
"currency": "NGN"
},
"customer": {
"email": "[email protected]",
"name": "<string>"
},
"expiresIn": 1800,
"callbackUrl": "<string>",
"metadata": {}
}
headers = {
"Request-Signature": "<request-signature>",
"Request-Timestamp": "<request-timestamp>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Request-Signature': '<request-signature>',
'Request-Timestamp': '<request-timestamp>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
reference: '<string>',
paymentMethod: 'pay_with_transfer',
amount: {value: 50001, currency: 'NGN'},
customer: {email: '[email protected]', name: '<string>'},
expiresIn: 1800,
callbackUrl: '<string>',
metadata: {}
})
};
fetch('https://api.paycashless.com/v1/payments', 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://api.paycashless.com/v1/payments",
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([
'reference' => '<string>',
'paymentMethod' => 'pay_with_transfer',
'amount' => [
'value' => 50001,
'currency' => 'NGN'
],
'customer' => [
'email' => '[email protected]',
'name' => '<string>'
],
'expiresIn' => 1800,
'callbackUrl' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Request-Signature: <request-signature>",
"Request-Timestamp: <request-timestamp>"
],
]);
$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://api.paycashless.com/v1/payments"
payload := strings.NewReader("{\n \"reference\": \"<string>\",\n \"paymentMethod\": \"pay_with_transfer\",\n \"amount\": {\n \"value\": 50001,\n \"currency\": \"NGN\"\n },\n \"customer\": {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\"\n },\n \"expiresIn\": 1800,\n \"callbackUrl\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Request-Signature", "<request-signature>")
req.Header.Add("Request-Timestamp", "<request-timestamp>")
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://api.paycashless.com/v1/payments")
.header("Request-Signature", "<request-signature>")
.header("Request-Timestamp", "<request-timestamp>")
.header("Content-Type", "application/json")
.body("{\n \"reference\": \"<string>\",\n \"paymentMethod\": \"pay_with_transfer\",\n \"amount\": {\n \"value\": 50001,\n \"currency\": \"NGN\"\n },\n \"customer\": {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\"\n },\n \"expiresIn\": 1800,\n \"callbackUrl\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paycashless.com/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Request-Signature"] = '<request-signature>'
request["Request-Timestamp"] = '<request-timestamp>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference\": \"<string>\",\n \"paymentMethod\": \"pay_with_transfer\",\n \"amount\": {\n \"value\": 50001,\n \"currency\": \"NGN\"\n },\n \"customer\": {\n \"email\": \"[email protected]\",\n \"name\": \"<string>\"\n },\n \"expiresIn\": 1800,\n \"callbackUrl\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"reference": "<string>",
"accountName": "<string>",
"accountNumber": "<string>",
"bankName": "<string>",
"amount": {
"value": 123,
"currency": "<string>"
},
"customer": {
"id": "<string>",
"name": "<string>",
"email": "<string>",
"phoneNumber": "<string>",
"address": "<string>",
"reference": "<string>",
"isBlacklisted": true,
"liveMode": true
},
"liveMode": true,
"expiresAt": "2023-11-07T05:31:56Z",
"metadata": {}
}Headers
SHA-512 HMAC signature of the request payload using the API secret
Minimum string length:
1Example:
"5e73d044c44d733fcf819ad3409aaaddca840d421b69cb0b04e2c750fc62ece7526d36296237663ad1f06f62a730c0466516507196b3ce6567493cc52a7cf63d"
UNIX timestamp when the request was created (in seconds)
Pattern:
^\d{10}$Example:
"1712336881"
Body
application/json
Available options:
pay_with_transfer Show child attributes
Show child attributes
Show child attributes
Show child attributes
The time in minutes before the payment expires (in seconds)
Example:
1800
Show child attributes
Show child attributes
Response
200 - application/json
Initiate a payment with transfer
⌘I