Create Payment

Creates an invoice, a payment record, initiates the Smart Contract payout, and returns a hosted payment URL for the payer. This is the primary server-to-server operation documented in this guide.

Endpoint

Property
Value

Method

POST

Path

/sdk/server/create-payment

Content-Type

application/json

Full URL: <Sandbox-environment>/sdk/server/create-payment (see Base URL & environments).

Authentication & policy

This endpoint requires all of the following:

Middleware order on the server: invalid-auth rate limit → merchant authentication → per-key rate limit → signature verification → idempotency → controller.

Request headers

Header
Required
Description

Authorization or X-API-Key

Yes

API key (Bearer <apiKey> or raw header).

X-Secret-Key

Yes

Secret paired with the API key.

X-API-Key

Yes

Must match the authenticated API key; required for signing (avoids ambiguity with Authorization).

X-Timestamp

Yes

Unix time in seconds (digits only).

X-Signature

Yes

HMAC-SHA256 hex digest of the signature base.

X-Idempotency-Key

Yes

Opaque unique key per logical operation.

Content-Type

Yes

application/json

Request body

Top-level fields

Field
Type
Required
Description

source

string

Yes

Label or origin for this invoice (e.g. storefront or product name).

clientEmail

string

Yes

Valid email; used for payer-facing communications.

clientName

string

Yes

Display name for the payer.

clientWalletAddress

string

Yes

Ethereum address: 0x followed by 40 hexadecimal characters.

countryCode

string

Yes

Country code for your integration.

countryName

string

Yes

Country name.

invoiceCurrency

string

Yes

Must be one of the allowed values (see below).

paymentCurrency

string

Yes

Same allowed set as invoiceCurrency.

items

array

Yes

At least one line item (see Line items).

isSelfIncurredFee

boolean

Yes

If true, fee semantics follow self-incurred configuration in Kollect.

dueDate

string

No

Defaults to today’s date (YYYY-MM-DD) if omitted.

invoiceNumber

string

No

Defaults to INV-<timestamp>. Must be unique per merchant; duplicates return 409.

notes

string

No

Defaults to empty string.

interface

string

No

One of kollect-app, kollect-sdk, kollect-server. Defaults to kollect-server. Use kollect-server for merchant webhooks.

Allowed currency values

invoiceCurrency and paymentCurrency must each be one of:

  • USDC-mainnet

  • USDT-mainnet

  • USDT-matic

  • USDCn-matic

  • fUSDC-sepolia

  • fUSDT-sepolia

Line items

Each element of items must include:

Field
Type
Constraints

description

string

Required.

quantity

number

Required; minimum 1.

price

number

Required.

Invoice amount is computed server-side as the sum of price × quantity across items.

Success response

HTTP status: 200

Field
Description

paymentUrl

Hosted checkout URL. Built from the deployment’s FRONTEND_URL and the payment UUID.

paymentId

UUID for the payment record (id field).

invoiceId

Invoice document identifier (MongoDB _id).

invoiceNumber

Human-readable invoice number stored on the invoice.

Error responses

Errors use the standard Kollect error envelope.

Example request body

cURL example

Adjust openssl output parsing if your platform prints a different digest line format; the signature must be lowercase hex matching the server implementation.

Last updated

Was this helpful?