vellTRDocs
API ReferenceInvoicesCreate Invoice

Create Invoice

POST/v1/invoicesOptional

Create a draft invoice. lineItems must sum to amountMinor. Accepts an optional Idempotency-Key header.

Authentication

Signature Pattern

HMAC-SHA256(secretKey, "{timestamp}\nPOST\n/v1/invoices\n{sha256(body)}")
HeaderValueDescription
X-Api-Keypk_live_a1b2c3d4e5f6g7h8Merchant public API key
X-Signature{hmac_sha256_hex}Hex HMAC-SHA256 request signature
X-Timestamp2026-04-13T10:00:00ZISO 8601 UTC request time (±5 min)

Request Parameters

NameTypeRequiredDescription
storeIdstringRequiredStore the invoice belongs to
customerIdstringOptionalBind the invoice to a customer
amountMinorintegerRequiredTotal in kuruş (must equal sum of lineItems)
currencystringRequiredAlways "TRY"
lineItemsarrayRequired[{name, qty, unitPriceMinor, lineTotalMinor}]
buyerEmailstringOptionalRequired before /send (email delivery)
buyerNamestringOptionalBuyer display name
dueDatestringOptionalISO 8601 due date
expiresAtstringOptionalISO 8601 link expiry
notesstringOptionalFree-text note on the invoice

Request Example

JSONRequest Body
{
  "storeId": "sto_5a6b7c8d",
  "amountMinor": 50000,
  "currency": "TRY",
  "lineItems": [
    {
      "name": "Monthly subscription",
      "qty": 1,
      "unitPriceMinor": 50000,
      "lineTotalMinor": 50000
    }
  ],
  "buyerEmail": "buyer@example.com",
  "dueDate": "2026-04-20T12:00:00Z"
}

Response Parameters

FieldTypeExample
idstring"inv_7a8b9c0d1e2f"
merchantIdstring"mrc_8a1b2c3d4e5f"
storeIdstring"sto_5a6b7c8d"
publicHashstring"aB3xK9mN2pQ7rS1tV5wY8z"
statusstring"draft"
amountMinorinteger50000
currencystring"TRY"
lineItemsarray[…]
lineItems[].namestring"Monthly subscription"
lineItems[].qtyinteger1
lineItems[].unitPriceMinorinteger50000
lineItems[].lineTotalMinorinteger50000
buyerEmailstring"buyer@example.com"
urlstring"https://pay.kvell.group/invoice/aB3xK9mN…
createdAtstring"2026-04-13T10:00:00Z"

Response Example

JSONResponse
{
  "id": "inv_7a8b9c0d1e2f",
  "merchantId": "mrc_8a1b2c3d4e5f",
  "storeId": "sto_5a6b7c8d",
  "publicHash": "aB3xK9mN2pQ7rS1tV5wY8z",
  "status": "draft",
  "amountMinor": 50000,
  "currency": "TRY",
  "lineItems": [
    {
      "name": "Monthly subscription",
      "qty": 1,
      "unitPriceMinor": 50000,
      "lineTotalMinor": 50000
    }
  ],
  "buyerEmail": "buyer@example.com",
  "url": "https://pay.kvell.group/invoice/aB3xK9mN2pQ7rS1tV5wY8z",
  "createdAt": "2026-04-13T10:00:00Z"
}

Status Codes

200Success
201Created
400Bad Request
401Unauthorized
404Not Found
429Rate Limited
Try itMock
POSThttps://api.pay.sandbox.kvell.group