Leepa Africa API

Sections

Theme switcher

Create A Purchase Session

The Create endpoint allows you to create a new payment request and retrieve URLs for making and monitoring payments.

If the request is associated with an agreement, the system first checks whether it can be automatically processed according to the agreement rules. If it cannot be processed automatically, a unique payment URL will be generated where the user can complete the payment manually.

In production, the minimum scheduling frequency for recurring payments is once per day. In the test environment, you can schedule as frequently as once per minute for development and testing.


Field descriptions
  • name (string) — Display name for the payment request (e.g., product or service name).
  • details (string) — Additional description of the payment request.
  • currency (string) — Payment currency (e.g., USDC).
  • recurring (boolean) — Whether the payment is recurring.
  • amount (number) — Payment amount.
  • metadata (object) — Arbitrary key-value pairs you provide. Returned in every webhook for both success and failure events. Example: set customerId from your system to tie all webhook events to a single customer.
  • success_url (string) — Redirect URL after a successful payment.
  • cancel_url (string) — Redirect URL if the customer cancels the payment.
  • interval (string) — Interval unit for recurring payments (e.g., Minute, Hour, Day, Month).
  • frequency (string) — Number of intervals between each recurring charge (e.g., "2" with interval: "Minute" → every 2 minutes).
  • duration (string) — Number of intervals the subscription will run before ending. "0" means no fixed end.
  • expires_in_hours (number) — Number of hours before the payment request expires. After expiration, no purchase requests or signature submission requests will be processed.

Header Parameters

Content-Typestring
API-Keystring Required
Merchant-IDstring Required

Body Parameters

namestring Required

Shown to payer on payment screen.

detailsstring Required

Shown to payer on payment screen.

currencystring

Defaults to USD. Can use another currency type.

amountnumber Required

Amount of currency.

metadataobject

Optional json data (e.g., invoice number, product ID).

Show child attributes

success_urlstring

The url to redirect your payer upon successful payment.

cancel_urlstring

This url to redirect the payer to if they cancel the payment process.

recurringboolean

Set as true if used for subscription. Defaults to false

durationstring

Required if recurring is set as true. If user provides a number, it will represent the number of recurring payments

intervalstring

Required if recurring is set as true.

Enum values:
DayWeekMonthYear
frequencystring

Required if recurring is set a true. Defaults to 0 if not provided

Enum values:
EveryEvery OtherEvery ThirdEvery FourthEvery FifthEvery SixthEvery Seventh

Response

200
Object

Response Attributes

dataobject

Show child attributes

statusnumber
401
Object

Response Attributes

errorstring

A human-readable text providing additional information, intended to aid the client developer in understanding the error that occurred. This field is optional and should be avoided if there is a concern that it could leak sensitive information.

statusinteger

A code indicating the type of error that occurred. For client authentication failures, invalid_client is commonly used.

400
Object
Invalid

Response Attributes

errorstring

A human-readable text providing additional information, intended to aid the client developer in understanding the error that occurred. This field is optional and should be avoided if there is a concern that it could leak sensitive information.

statusinteger

A code indicating the type of error that occurred. For client authentication failures, invalid_client is commonly used.

500
Object

Response Attributes

errorstring

A human-readable text providing additional information, intended to aid the client developer in understanding the error that occurred. This field is optional and should be avoided if there is a concern that it could leak sensitive information.

statusinteger

A code indicating the type of error that occurred. For client authentication failures, invalid_client is commonly used.

Was this section helpful?

What made this section unhelpful for you?

POST

/

Select
1

Response

Was this section helpful?

What made this section unhelpful for you?