Create Payment
curl --request POST \
--url https://api.creptapay.com/v1/payment \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890"
},
"items": [
{
"name": "Item Name",
"amount": 10.5,
"quantity": 2
}
],
"description": "Invoice Payment",
"expires_at": "2026-07-24T14:40:15Z"
}
'import requests
url = "https://api.creptapay.com/v1/payment"
payload = {
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890"
},
"items": [
{
"name": "Item Name",
"amount": 10.5,
"quantity": 2
}
],
"description": "Invoice Payment",
"expires_at": "2026-07-24T14:40:15Z"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com',
phone: '+1234567890'
},
items: [{name: 'Item Name', amount: 10.5, quantity: 2}],
description: 'Invoice Payment',
expires_at: '2026-07-24T14:40:15Z'
})
};
fetch('https://api.creptapay.com/v1/payment', 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.creptapay.com/v1/payment",
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([
'customer' => [
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'phone' => '+1234567890'
],
'items' => [
[
'name' => 'Item Name',
'amount' => 10.5,
'quantity' => 2
]
],
'description' => 'Invoice Payment',
'expires_at' => '2026-07-24T14:40:15Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.creptapay.com/v1/payment"
payload := strings.NewReader("{\n \"customer\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+1234567890\"\n },\n \"items\": [\n {\n \"name\": \"Item Name\",\n \"amount\": 10.5,\n \"quantity\": 2\n }\n ],\n \"description\": \"Invoice Payment\",\n \"expires_at\": \"2026-07-24T14:40:15Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.creptapay.com/v1/payment")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+1234567890\"\n },\n \"items\": [\n {\n \"name\": \"Item Name\",\n \"amount\": 10.5,\n \"quantity\": 2\n }\n ],\n \"description\": \"Invoice Payment\",\n \"expires_at\": \"2026-07-24T14:40:15Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creptapay.com/v1/payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+1234567890\"\n },\n \"items\": [\n {\n \"name\": \"Item Name\",\n \"amount\": 10.5,\n \"quantity\": 2\n }\n ],\n \"description\": \"Invoice Payment\",\n \"expires_at\": \"2026-07-24T14:40:15Z\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Successfully created payment",
"data": {
"id": "60d0fe4f5311236168a109ca",
"reference": "CP-A1B2C3D4E5",
"customer": {
"id": "60d0fe4f5311236168a109c9",
"first_name": "Chidera",
"last_name": "Okonkwo",
"company_name": "Okonkwo Stores",
"email": "chidera@example.com",
"phone": "+2348012345678",
"business": "60d0fe4f5311236168a109c8",
"environment": "production",
"createdAt": "2026-07-24T14:08:52.000Z",
"updatedAt": "2026-07-24T14:08:52.000Z"
},
"currency": "USD",
"crypto_currency": "USDC",
"network": "BASE",
"rate": 1,
"crypto_amount": 21.21,
"amount_paid": 0,
"amount": 21,
"address": "0x1234567890123456789012345678901234567890",
"fees": 0.21,
"total": 21.21,
"description": "Order #1042",
"line_items": [
{
"name": "Ankara shirt",
"amount": 10.5,
"quantity": 2
}
],
"status": "pending",
"type": "api",
"subscription": null,
"billing_period_start": null,
"billing_period_end": null,
"business": "60d0fe4f5311236168a109c8",
"allowed_currencies": [
"USDC"
],
"checkout_url": "https://pay.creptapay.com/CP-A1B2C3D4E5",
"redirect_url": "https://yourshop.com/thanks",
"metadata": {
"order_id": "1042"
},
"tx_hash": null,
"confirmations": 0,
"required_confirmations": 12,
"expires_at": "2026-07-24T14:23:52.000Z",
"createdAt": "2026-07-24T14:08:52.000Z",
"updatedAt": "2026-07-24T14:08:52.000Z"
}
}{
"message": "A grace period can't be longer than 30 days",
"data": null
}{
"message": "Invalid API key",
"data": null
}Payments
Create Payment
Initialize a new checkout payment transaction. Requires a public key starting with pk_.
POST
/
payment
Create Payment
curl --request POST \
--url https://api.creptapay.com/v1/payment \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890"
},
"items": [
{
"name": "Item Name",
"amount": 10.5,
"quantity": 2
}
],
"description": "Invoice Payment",
"expires_at": "2026-07-24T14:40:15Z"
}
'import requests
url = "https://api.creptapay.com/v1/payment"
payload = {
"customer": {
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890"
},
"items": [
{
"name": "Item Name",
"amount": 10.5,
"quantity": 2
}
],
"description": "Invoice Payment",
"expires_at": "2026-07-24T14:40:15Z"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com',
phone: '+1234567890'
},
items: [{name: 'Item Name', amount: 10.5, quantity: 2}],
description: 'Invoice Payment',
expires_at: '2026-07-24T14:40:15Z'
})
};
fetch('https://api.creptapay.com/v1/payment', 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.creptapay.com/v1/payment",
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([
'customer' => [
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'phone' => '+1234567890'
],
'items' => [
[
'name' => 'Item Name',
'amount' => 10.5,
'quantity' => 2
]
],
'description' => 'Invoice Payment',
'expires_at' => '2026-07-24T14:40:15Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.creptapay.com/v1/payment"
payload := strings.NewReader("{\n \"customer\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+1234567890\"\n },\n \"items\": [\n {\n \"name\": \"Item Name\",\n \"amount\": 10.5,\n \"quantity\": 2\n }\n ],\n \"description\": \"Invoice Payment\",\n \"expires_at\": \"2026-07-24T14:40:15Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.creptapay.com/v1/payment")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+1234567890\"\n },\n \"items\": [\n {\n \"name\": \"Item Name\",\n \"amount\": 10.5,\n \"quantity\": 2\n }\n ],\n \"description\": \"Invoice Payment\",\n \"expires_at\": \"2026-07-24T14:40:15Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creptapay.com/v1/payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phone\": \"+1234567890\"\n },\n \"items\": [\n {\n \"name\": \"Item Name\",\n \"amount\": 10.5,\n \"quantity\": 2\n }\n ],\n \"description\": \"Invoice Payment\",\n \"expires_at\": \"2026-07-24T14:40:15Z\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Successfully created payment",
"data": {
"id": "60d0fe4f5311236168a109ca",
"reference": "CP-A1B2C3D4E5",
"customer": {
"id": "60d0fe4f5311236168a109c9",
"first_name": "Chidera",
"last_name": "Okonkwo",
"company_name": "Okonkwo Stores",
"email": "chidera@example.com",
"phone": "+2348012345678",
"business": "60d0fe4f5311236168a109c8",
"environment": "production",
"createdAt": "2026-07-24T14:08:52.000Z",
"updatedAt": "2026-07-24T14:08:52.000Z"
},
"currency": "USD",
"crypto_currency": "USDC",
"network": "BASE",
"rate": 1,
"crypto_amount": 21.21,
"amount_paid": 0,
"amount": 21,
"address": "0x1234567890123456789012345678901234567890",
"fees": 0.21,
"total": 21.21,
"description": "Order #1042",
"line_items": [
{
"name": "Ankara shirt",
"amount": 10.5,
"quantity": 2
}
],
"status": "pending",
"type": "api",
"subscription": null,
"billing_period_start": null,
"billing_period_end": null,
"business": "60d0fe4f5311236168a109c8",
"allowed_currencies": [
"USDC"
],
"checkout_url": "https://pay.creptapay.com/CP-A1B2C3D4E5",
"redirect_url": "https://yourshop.com/thanks",
"metadata": {
"order_id": "1042"
},
"tx_hash": null,
"confirmations": 0,
"required_confirmations": 12,
"expires_at": "2026-07-24T14:23:52.000Z",
"createdAt": "2026-07-24T14:08:52.000Z",
"updatedAt": "2026-07-24T14:08:52.000Z"
}
}{
"message": "A grace period can't be longer than 30 days",
"data": null
}{
"message": "Invalid API key",
"data": null
}Initialize a new checkout payment transaction. This endpoint generates a unique blockchain wallet address for the transaction.
Request authentication
This endpoint requires a Public Key (pk_...) passed in either the x-api-key header or as a Bearer token in the Authorization header.
Request parameters
object
required
array
required
string
A description of the payment transaction.
string
ISO 8601 date-time string when the payment link expires. Defaults to 30 minutes from creation.
Authorizations
Body
application/json