Create a checkout session
Starts checkout for one agreement. Call this from your server with your secret key.
What is agreed. title and description (both required) say what is being bought;
images show it (the first is the cover on checkout, in messages and on the escrow);
attachments hold documents such as a brief, a contract or title papers. KetaPay copies
all of it when the session is created and keeps that copy with the escrow as evidence
for any dispute, so later changes to your listing or record don’t change what was
agreed.
Milestones. Pass milestones to split the payment into stages released one at a
time, in order. Leave it out for a single payment: KetaPay creates one milestone for
the whole amount. When you pass milestones, their amounts must add up to amount.
Release. release.method is buyer_confirms (the buyer releases each delivered
milestone) or release_code (in person: the seller enters the buyer’s code).
release.auto_release_hours releases a delivered milestone when the buyer neither
releases nor reports a problem in that time; leave it null where silence should never
pay the seller, such as legal or property work.
Parties. The buyer and the seller are people, each identified by an email address, a Nigerian phone number, or both. At least one is required; send both when you have them, because KetaPay messages people on every channel it knows (release codes and dispute deadlines are easy to miss in one inbox).
KetaPay matches each party to a KetaPay account by email first, then phone. Someone
without an account gets one from what you send and claims it with a one-time code to
that email or phone, so neither side has to install KetaPay. If the email and phone
belong to two different KetaPay accounts, the request fails with
party_identity_conflict; send just one. The buyer and seller must be different
people (parties_must_differ). You
never send the seller’s bank details: the seller adds them, with their own one-time
code, on KetaPay’s pages or through POST /payout_accounts.
Fees. The buyer pays the amount plus KetaPay’s fee and VAT on that fee. The seller’s
fee and your commission come out of each release. Nothing is charged to the seller or
earned by you on money refunded to the buyer. The response shows every figure in fees.
Limits. Amounts above the buyer’s verification level are allowed here; the buyer is asked to verify their identity before paying (the hosted checkout does this for you).
Authorizations
Authorization: Bearer <secret key>. Secret keys belong to your organisation, are shown
once when created in the dashboard, and are scoped (see x-required-scope on each
operation). Keep them on your server. Live keys are issued after your business is
verified. Publishable keys (pk_) are only for @ketapay/checkout and don't work here.
Headers
Unique key for this operation. Retries with the same key return the first result.
255"7f3e2a10-6c4d-4b8e-9a1f-2d5c8e7b6a40"
Body
The full agreed price in kobo, before KetaPay's fee. Must equal the sum of milestones when given.
x >= 145000000
What is being bought, in a few words
1 - 120"Company website"
What was agreed, in enough detail for someone else to judge a dispute: condition, specification, scope of work, what is included. Shown to both sides.
20 - 2000At least one of email and phone. Both is better.
- Option 1
- Option 2
NGN What kind of deal this is. KetaPay uses it for risk checks and dispute handling.
goods, services, property, vehicle, digital, other Photos of what is being bought. The first is the cover image.
10Send either file (an id from POST /files with purpose agreement) or url (an HTTPS
link KetaPay copies). JPEG, PNG, HEIC or WebP. Responses carry KetaPay's own url plus a
small thumbnail_url.
- Option 1
- Option 2
Documents, such as a brief, a contract, an invoice or property papers
10Send either file (an id from POST /files) or url (an HTTPS link KetaPay copies, so
it survives your copy being deleted). Responses always carry KetaPay's own url.
- Option 1
- Option 2
The listing, project or deal on your site
Stages released one at a time, in this order. Leave out for a single payment.
1 - 20 elementsWho gets paid. Leave it out when you sell your own goods: your business is the seller, by its name, and each release is paid into your KetaPay balance.
- Option 1
- Option 2
Your cut, taken from the seller's side of each release. Never charged on money refunded
to the buyer. rate_bps is basis points (500 = 5%). min_amount and max_amount apply
to the whole escrow; each milestone's release carries its share. Must be within the
maximum rate in your KetaPay agreement. Not allowed when you sell your own goods (no
seller): commission_not_allowed.
When the session stops accepting payment. Between 15 minutes and 7 days from now; defaults to 24 hours.
Where the buyer goes after paying. KetaPay appends ?checkout_session_id=<id>.
Where the buyer goes if they leave without paying
Your own id for this object, for example your order or project id. Filterable.
255"proj_4471"
Your own key-value pairs. KetaPay stores them and never reads them.
Response
Checkout session created
"checkout_session"open: waiting for payment. complete: paid, escrow_id is set. expired: not paid by
expires_at. cancelled: you cancelled it.
open, complete, expired, cancelled The hosted checkout. Open it with @ketapay/checkout or redirect the buyer to it.
"https://app.ketapay.com/checkout/2c9a7f4e-1b3d-4e6a-8f2c-5d7b9e1a3c60"
Amount in kobo
x >= 045000000
"NGN"Totals for the whole escrow, in kobo. buyer_total = amount + buyer_fee + buyer_vat and
seller_payout = amount - seller_fee - commission. Until everything is released these
are what will apply; each milestone shows its own share.
What kind of deal this is. KetaPay uses it for risk checks and dispute handling.
goods, services, property, vehicle, digital, other KetaPay's copies, in order; the first is the cover
Send either file (an id from POST /files with purpose agreement) or url (an HTTPS
link KetaPay copies). JPEG, PNG, HEIC or WebP. Responses carry KetaPay's own url plus a
small thumbnail_url.
- Option 1
- Option 2
Send either file (an id from POST /files) or url (an HTTPS link KetaPay copies, so
it survives your copy being deleted). Responses always carry KetaPay's own url.
- Option 1
- Option 2
The plan. One entry for a single payment.
At least one of email and phone. Both is better.
- Option 1
- Option 2
The seller as you sent them, or your business when you sent none
- Option 1
- Option 2
- Option 3
Your cut, taken from the seller's side of each release. Never charged on money refunded
to the buyer. rate_bps is basis points (500 = 5%). min_amount and max_amount apply
to the whole escrow; each milestone's release carries its share. Must be within the
maximum rate in your KetaPay agreement. Not allowed when you sell your own goods (no
seller): commission_not_allowed.
Set once the buyer has paid
Your own id for this object, for example your order or project id. Filterable.
255"proj_4471"
Your own key-value pairs. KetaPay stores them and never reads them.
The url you sent at creation