vellTRDocs

Fatura Oluştur

POST/v1/invoicesOptional

Taslak bir fatura oluşturur. lineItems toplamı amountMinor değerine eşit olmalıdır. İsteğe bağlı bir Idempotency-Key başlığını destekler.

Kimlik Doğrulama

İmza Deseni

HMAC-SHA256(secretKey, "{timestamp}\nPOST\n/v1/invoices\n{sha256(body)}")
BaşlıkDeğerAçıklama
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)

İstek Parametreleri

AdTürZorunluAçıklama
storeIdstringZorunluStore the invoice belongs to
customerIdstringİsteğe BağlıBind the invoice to a customer
amountMinorintegerZorunluTotal in kuruş (must equal sum of lineItems)
currencystringZorunluAlways "TRY"
lineItemsarrayZorunlu[{name, qty, unitPriceMinor, lineTotalMinor}]
buyerEmailstringİsteğe BağlıRequired before /send (email delivery)
buyerNamestringİsteğe BağlıBuyer display name
dueDatestringİsteğe BağlıISO 8601 due date
expiresAtstringİsteğe BağlıISO 8601 link expiry
notesstringİsteğe BağlıFree-text note on the invoice

İstek Örneği

JSONİstek Gövdesi
{
  "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"
}

Yanıt Parametreleri

AlanTürÖrnek
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"

Yanıt Örneği

JSONYanıt
{
  "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"
}

Durum Kodları

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