CreddotDocsCreddot Docs

Create a hosted checkout session

Creates a single-use hosted checkout in the API key environment. Redirect the customer to checkoutUrl. Card details are collected only by Creddot checkout; they never pass through the merchant server.

POST
/api/v1/checkout/sessions

Creates a single-use hosted checkout in the API key environment. Redirect the customer to checkoutUrl. Card details are collected only by Creddot checkout; they never pass through the merchant server.

Authorization

api-key
headerx-api-key<token>

Your API key: ck_test_... for test mode, ck_live_... for live. Send it with x-api-secret (or Authorization: Bearer ).

Header Parameters

x-api-secret?string

Recommended: API secret sent over HTTPS. You may send it as Authorization: Bearer instead. If supplied, x-timestamp and x-signature are not required.

x-timestamp?string

Legacy signed mode: Unix time in milliseconds; maximum clock skew five minutes.

x-signature?string

Legacy signed mode: HMAC-SHA256(secret, timestamp.METHOD.url.idempotencyKey.bodyHash).

x-idempotency-key*string

1–128 letters/digits or ._:-. Same key and payload replay for 24 hours; conflicting, in-flight, or expired keys return 409. Never change a key to retry an uncertain payment.

Request Body

application/json
  1. body
amountMinor*string

Amount in positive integer minor units.

currency*string
reference*string

Your unique reference for this checkout.

Lengthlength <= 80
description?string
Lengthlength <= 160
customerName?string
Lengthlength <= 120
customerEmail?string
redirectUrl?string

HTTPS destination returned after successful payment.

expiresAt?string

Defaults to 30 minutes from creation.

Formatdate-time

Response Body

application/json
  1. response
id*string
reference*string
amountMinor*string
currency*string
checkoutUrl*string
Formaturi
checkoutPath*string
expiresAt*string
Formatdate-time
Example Request
curl -X POST 'https://api.creddot.com/api/v1/checkout/sessions' \  -H 'x-idempotency-key: string' \  -H 'Content-Type: application/json' \  -d '{  "amountMinor": "125000",  "currency": "NGN",  "reference": "ORDER-10042"}'
Example Response
{  "id": "string",  "reference": "string",  "amountMinor": "string",  "currency": "string",  "checkoutUrl": "http://example.com",  "checkoutPath": "string",  "expiresAt": "2019-08-24T14:15:22Z"}