To create a payment link, start by initializing a payment with our API. You will have to complete this transaction with the link created.

There are 3 steps to ensure that you have successfully initiated and complete an transaction.

  1. initialize transaction
  2. complete transaction
  3. verify transaction status

To initialize a transaction, when you make a POST request to the endpoint /v1/pay. you will be required to pass the required request parameters listed below.

Initialize transaction

Request
curl --request POST \
  --url https://adapter.cepta.co/api/v1/pay \
  --header 'Authorization: <SECRET_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
    {
        "amount": 100,
        "currency": "NGN",
        "description": "Purchase of goods",
        "pageName": "Checkout Page",
        "transactionReference": "ABC123XYZ",
        "customerEmail": "[email protected]",
        "customUrl": "https://example.com/thank-you",
        "expiryDate": "2024-11-29T12:03:11.391Z"
    }
  '

ExpiryDate must be in a valid ISO 8601 format and should not be in the past. If you do not pass a expiryDate as part of your request parameters, we automatically set a 24hrs expiration hours to all initialize transaction.

order
object
required

Account reference

amount
number
required

The payment amount to be paid by customer (must be greater than 0)

currency
string
required

The currency code (e.g., “USD”, “NGN”)

description
string
required

Description of the transaction

pageName
string
required

Name of the payment page

transactionReference
string
required

Unique identifier for the transaction

customerEmail
string
required

The customer email address.

customUrl
string

URL to redirect after payment

expiryDate
string (ISO 8601)
required

Expiry date for the payment link.

Complete transaction

An example response body of a transaction.

Success response
{
  "status": true,
  "message": "Payment link created successfully.",
  "data": {
    "transactionRef": "ABC123XYZ",
    "paymentUrl": " https://app.cepta.co/payment?paymentRef=861b1cb7-c9ec-4d5b-82ef-c60bb67a51f0&Mode=0"
  }
}

When you successfully initialize a transaction, the response returned will include a data object that contains transactionRef and paymentUrl. This URL will serve as a link to an external page to complete the transaction.

Handling Initialize Transaction response body

status
boolean

Indicates if the request was successful.

message
string

Descriptive message about the request result.

data
object
transactionRef
string

Reference for the created transaction.

paymentUrl
string

URL to the payment page

Verify transaction status

When you complete a payment, you will be redirect to the customUrl you set when initializing a transaction. Then can then proceed to learn how to verify a transaction status here

CustomUrl is optional but recommended to improve user experience post-payment.