Faturalama API

i18n etiketleri, esnek tarihler ve katı doğrulama ile PDF faturalar, proformalar, borç/alacak dekontları ve makbuzlar oluşturun.

Ne yapabilirsiniz?
Yüksek kaliteli PDF'ler

Birden fazla tasarım temasıyla DomPDF aracılığıyla A4 çıktı.

i18n hazır

İki harfli dil kodu + sözlük (ör. en, bg).

KDV'li kargo

Kargoyu net + KDV oranı olarak ekleyin; toplamlar otomatik ayarlanır.

Esnek tarihler

Y-m-d, d/m/Y, d-m-Y, m/d/Y vb. kabul eder; Y-m-d'ye normalleştirilir.

Canlı Dene
99.9 % Çalışma Süresi
580.7ms Yanıt
10 req/s
0.5 Kredi / istek

Create Pro‑forma

POST https://api.yeb.to/v1/invoicing/proforma
Parameter Type Required Description
api_key string yes Your API key
lang string(2) opt Language code (default: en)
design enum opt classic|modern|elegant|minimal
currency string opt Currency sign (default: )
currency_side enum opt before or after (default: after)
seller object yes Seller block
seller.namestringyesSeller name
seller.addressstringyesStreet, city, country
seller.emailemailyesBilling email
seller.vat_numberstringoptVAT ID
seller.company_numberstringoptRegistry ID
seller.logourloptLogo URL
seller.phonestringoptContact
buyer object yes Buyer block
buyer.namestringyesBuyer name
buyer.addressstringyesBilling address
buyer.emailemailyesEmail
buyer.vat_numberstringoptVAT ID
buyer.company_numberstringoptRegistry ID
buyer.phonestringoptContact
items array<object> opt Line items (required fields when present)
items[].namestringyes*Item name
items[].descriptionstringoptItem description
items[].quantitynumberyes*Quantity
items[].unit_pricenumberyes*Unit price (net)
items[].vat_ratenumberyes*VAT rate %
items[].total_pricenumberyes*Gross line total
shipping object opt Shipping as net + VAT rate
shipping.pricenumberyes*Shipping net
shipping.vat_ratenumberyes*VAT rate % (0..100)
issue_date date yes Accepted formats; normalized to Y-m-d
valid_due_date date yes Offer valid until (accepted formats; normalized to Y-m-d)
extras array<object> opt Extra rows printed at bottom
extras[].labelstringyes*Left cell
extras[].valuestringoptRight cell

Example

curl -X POST https://api.yeb.to/v1/invoicing/proforma \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_KEY",
    "lang": "en",
    "design": "elegant",
    "currency": "€",
    "currency_side": "after",
    "seller": {"name":"My Company Ltd.","address":"1 Seller St, City, Country","email":"[email protected]","vat_number":"BG123456789"},
    "buyer":  {"name":"Client Inc.","address":"2 Buyer Rd, City, Country","email":"[email protected]","vat_number":"DE987654321"},
    "issue_date": "2025-07-23",
    "valid_due_date": "2025-08-06",
    "items": [
      {"name":"Consulting Session","description":"Remote IT consulting (2h)","quantity":2,"unit_price":100,"vat_rate":20,"total_price":240},
      {"name":"Software License","description":"1-year subscription","quantity":1,"unit_price":200,"vat_rate":20,"total_price":240}
    ],
    "shipping": {"price":25,"vat_rate":20},
    "extras":[{"label":"Notes","value":"Pro‑forma valid for 14 days"}]
  }'

Integrations

curl -X POST https://api.yeb.to/v1/invoicing/proforma -H "Content-Type: application/json" -d '{"api_key":"YOUR_KEY","seller":{"name":"My Company Ltd.","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client Inc.","address":"2 Buyer Rd","email":"[email protected]"},"issue_date":"2025-07-23","valid_due_date":"2025-08-06","items":[{"name":"Consulting","quantity":2,"unit_price":100,"vat_rate":20,"total_price":240}]}'
$r = Http::post('https://api.yeb.to/v1/invoicing/proforma', [
  'api_key' => 'YOUR_KEY',
  'seller' => ['name'=>'My Company Ltd.','address'=>'1 Seller St','email'=>'[email protected]'],
  'buyer'  => ['name'=>'Client Inc.','address'=>'2 Buyer Rd','email'=>'[email protected]'],
  'issue_date' => '2025-07-23',
  'valid_due_date' => '2025-08-06',
  'items' => [['name'=>'Consulting','quantity'=>2,'unit_price'=>100,'vat_rate'=>20,'total_price'=>240]],
  'shipping' => ['price'=>25,'vat_rate'=>20]
]); echo $r->json();
fetch('https://api.yeb.to/v1/invoicing/proforma',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({api_key:'YOUR_KEY',seller:{name:'My Company Ltd.',address:'1 Seller St',email:'[email protected]'},buyer:{name:'Client Inc.',address:'2 Buyer Rd',email:'[email protected]'},issue_date:'2025-07-23',valid_due_date:'2025-08-06',items:[{name:'Consulting',quantity:2,unit_price:100,vat_rate:20,total_price:240}],shipping:{price:25,vat_rate:20}})}).then(r=>r.json()).then(console.log);
import requests, json
payload = {"api_key":"YOUR_KEY",
  "seller":{"name":"My Company Ltd.","address":"1 Seller St","email":"[email protected]"},
  "buyer":{"name":"Client Inc.","address":"2 Buyer Rd","email":"[email protected]"},
  "issue_date":"2025-07-23","valid_due_date":"2025-08-06",
  "items":[{"name":"Consulting","quantity":2,"unit_price":100,"vat_rate":20,"total_price":240}],
  "shipping":{"price":25,"vat_rate":20}}
r = requests.post('https://api.yeb.to/v1/invoicing/proforma', headers={'Content-Type':'application/json'}, data=json.dumps(payload))
print(r.json())

Response Example

{
  "result": {
    "doc_type": "proforma",
    "file_url": "https://cdn.yourcdn.com/invoices/uuid.pdf",
    "expires": "2025-08-01 10:05:00"
  }
}
{
  "error": "valid_due_date is required for a pro‑forma invoice.",
  "code": 422
}

Yanıt Kodları

KodAçıklama
200 Successİstek başarıyla işlendi.
400 Bad RequestGiriş doğrulama başarısız.
401 UnauthorizedEksik / yanlış API anahtarı.
403 ForbiddenAnahtar etkin değil veya izin verilmiyor.
429 Rate LimitÇok fazla istek.
500 Server ErrorBeklenmeyen hata.

Pro-Forma

invoicing/proforma 0.5000 credits

Parameters

API Key
body · string · required
Language
body · string
Design theme
body · string
Currency sign
body · string
Currency placement
body · string
Seller
body · string · required
Buyer
body · string · required
Items
body · string
Shipping
body · string
Issue date
body · string · required
Valid until
body · string · required
Extras
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Create Invoice

POST https://api.yeb.to/v1/invoicing/invoice
Parameter Type Required Description
api_key string yes Your API key
lang string(2) opt Language code (default: en)
design enum opt classic|modern|elegant|minimal
currency string opt Currency sign (default: )
currency_side enum opt before or after (default: after)
seller object yes Seller block
seller.name string yes Seller name
seller.address string yes Street, city, country
seller.email email yes Billing email
seller.vat_number string opt VAT ID
seller.company_number string opt Registry ID
seller.logo url opt Logo URL
seller.phone string opt Contact
buyer object yes Buyer block
buyer.name string yes Buyer name
buyer.address string yes Billing address
buyer.email email yes Email
buyer.vat_number string opt VAT ID
buyer.company_number string opt Registry ID
buyer.phone string opt Contact
items array<object> opt Line items (required fields when present)
items[].namestringyes*Item name
items[].descriptionstringoptItem description
items[].quantitynumberyes*Quantity
items[].unit_pricenumberyes*Unit price (net)
items[].vat_ratenumberyes*VAT rate %
items[].total_pricenumberyes*Gross line total
shipping object opt Shipping as net + VAT rate
shipping.pricenumberyes*Shipping net
shipping.vat_ratenumberyes*VAT rate % (0..100)
invoice_number string yes Invoice ID/number
issue_date date yes Accepted formats; normalized to Y-m-d
tax_event_date date yes Tax event date
subtotal number yes Net subtotal (items + shipping)
vat_total number yes Total VAT
total_amount_due number yes Grand total (gross)
payment_methods array<object> opt Payment instructions
payment_methods[].methodstringyes*e.g., bank transfer, PayPal, card
payment_methods[].detailsobjectoptFree‑shape key/value (IBAN, etc.)
extras array<object> opt Extra rows printed at bottom
extras[].labelstringyes*Left cell
extras[].valuestringoptRight cell

Example

curl -X POST https://api.yeb.to/v1/invoicing/invoice \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_KEY",
    "lang": "bg",
    "design": "elegant",
    "currency": "$",
    "currency_side": "before",
    "seller": {"name":"My Company Ltd.","address":"1 Seller St, City, Country","email":"[email protected]","vat_number":"BG123456789"},
    "buyer":  {"name":"Client Inc.","address":"2 Buyer Rd, City, Country","email":"[email protected]","vat_number":"DE987654321"},
    "invoice_number": "INV-2025-002",
    "issue_date": "2025-07-23",
    "tax_event_date": "2025-07-23",
    "items": [
      {"name":"Consulting Session","description":"Remote IT consulting (2h)","quantity":2,"unit_price":100,"vat_rate":20,"total_price":240},
      {"name":"Software License","description":"1-year subscription","quantity":1,"unit_price":200,"vat_rate":20,"total_price":240}
    ],
    "shipping": {"price":25,"vat_rate":20},
    "subtotal": 425,
    "vat_total": 85,
    "total_amount_due": 510,
    "payment_methods": [
      {"method":"bank transfer","details":{"bank_name":"First Bank","iban":"BG00BANK00000000000000","bic":"BANKBGSF"}},
      {"method":"PayPal","details":{"email":"[email protected]"}}
    ],
    "extras":[{"label":"Notes","value":"Pay within 14 days"}]
  }'

Integrations

curl -X POST https://api.yeb.to/v1/invoicing/invoice -H "Content-Type: application/json" -d '{"api_key":"YOUR_KEY","seller":{"name":"My Company Ltd.","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client Inc.","address":"2 Buyer Rd","email":"[email protected]"},"invoice_number":"INV-2025-002","issue_date":"2025-07-23","tax_event_date":"2025-07-23","items":[{"name":"Consulting","quantity":2,"unit_price":100,"vat_rate":20,"total_price":240}],"shipping":{"price":25,"vat_rate":20},"subtotal":225,"vat_total":45,"total_amount_due":270}'
$r = Http::post('https://api.yeb.to/v1/invoicing/invoice', [
  'api_key' => 'YOUR_KEY',
  'seller' => ['name'=>'My Company Ltd.','address'=>'1 Seller St','email'=>'[email protected]'],
  'buyer'  => ['name'=>'Client Inc.','address'=>'2 Buyer Rd','email'=>'[email protected]'],
  'invoice_number' => 'INV-2025-002',
  'issue_date' => '2025-07-23',
  'tax_event_date' => '2025-07-23',
  'items' => [['name'=>'Consulting','quantity'=>2,'unit_price'=>100,'vat_rate'=>20,'total_price'=>240]],
  'shipping' => ['price'=>25,'vat_rate'=>20],
  'subtotal' => 225, 'vat_total' => 45, 'total_amount_due' => 270
]); echo $r->json();
fetch('https://api.yeb.to/v1/invoicing/invoice',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({api_key:'YOUR_KEY',seller:{name:'My Company Ltd.',address:'1 Seller St',email:'[email protected]'},buyer:{name:'Client Inc.',address:'2 Buyer Rd',email:'[email protected]'},invoice_number:'INV-2025-002',issue_date:'2025-07-23',tax_event_date:'2025-07-23',items:[{name:'Consulting',quantity:2,unit_price:100,vat_rate:20,total_price:240}],shipping:{price:25,vat_rate:20},subtotal:225,vat_total:45,total_amount_due:270})}).then(r=>r.json()).then(console.log);
import requests, json
payload = {"api_key":"YOUR_KEY",
  "seller":{"name":"My Company Ltd.","address":"1 Seller St","email":"[email protected]"},
  "buyer":{"name":"Client Inc.","address":"2 Buyer Rd","email":"[email protected]"},
  "invoice_number":"INV-2025-002","issue_date":"2025-07-23","tax_event_date":"2025-07-23",
  "items":[{"name":"Consulting","quantity":2,"unit_price":100,"vat_rate":20,"total_price":240}],
  "shipping":{"price":25,"vat_rate":20},"subtotal":225,"vat_total":45,"total_amount_due":270}
r = requests.post('https://api.yeb.to/v1/invoicing/invoice', headers={'Content-Type':'application/json'}, data=json.dumps(payload))
print(r.json())

Response Example

{
  "result": {
    "doc_type": "invoice",
    "file_url": "https://cdn.yourcdn.com/invoices/uuid.pdf",
    "expires": "2025-08-01 10:05:00"
  }
}
{
  "error": "invoice_number is required for an invoice.",
  "code": 422
}

Yanıt Kodları

KodAçıklama
200 Successİstek başarıyla işlendi.
400 Bad RequestGiriş doğrulama başarısız.
401 UnauthorizedEksik / yanlış API anahtarı.
403 ForbiddenAnahtar etkin değil veya izin verilmiyor.
429 Rate LimitÇok fazla istek.
500 Server ErrorBeklenmeyen hata.

Invoice

invoicing/invoice 0.6000 credits

Parameters

API Key
query · string · required
Language
query · string
Design
query · string
Currency
query · string
Currency side
query · string
Seller
query · string · required
Buyer
query · string · required
Items
query · string
Shipping
query · string
Invoice number
query · string · required
Issue date
query · string · required
Tax event date
query · string · required
Subtotal
query · string · required
VAT total
query · string · required
Total amount due
query · string · required
Payment methods
query · string
Extras
query · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Create Debit Note

POST https://api.yeb.to/v1/invoicing/debit-note
ParameterTypeRequiredDescription
seller objectyesSeller
seller.namestringyesName
seller.addressstringyesAddress
seller.emailemailyesEmail
buyer objectyesBuyer
buyer.namestringyesName
buyer.addressstringyesAddress
buyer.emailemailyesEmail
items array<object>optLines for the note
items[].namestringyes*Item name
items[].quantitynumberyes*Qty
items[].unit_pricenumberyes*Unit (net)
items[].vat_ratenumberyes*VAT %
items[].total_pricenumberyes*Gross
debit_amountnumberoptUsed when no items are provided
debit_note_numberstringyesNote number
invoice_numberstringyesRelated invoice
issue_datedateyesDate (multi‑format)
reasonstringyesWhy the debit
payment_methods array<object>optHow to pay
payment_methods[].methodstringyes*Method
payment_methods[].detailsobjectoptDetails (IBAN, etc.)

Example

curl -X POST https://api.yeb.to/v1/invoicing/debit-note \
 -H "Content-Type: application/json" \
 -d '{"api_key":"YOUR_KEY","seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},"debit_note_number":"DN-2025-003","invoice_number":"INV-2025-002","issue_date":"2025-07-25","reason":"Additional billable hours (3h)","items":[{"name":"Extra Consulting","description":"On-site work","quantity":3,"unit_price":40,"vat_rate":20,"total_price":144}]}'
curl -X POST https://api.yeb.to/v1/invoicing/debit-note -H "Content-Type: application/json" -d '{"api_key":"YOUR_KEY","seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},"debit_note_number":"DN-2025-003","invoice_number":"INV-2025-002","issue_date":"2025-07-25","reason":"Additional billable hours (3h)","debit_amount":144}'
$r = Http::post('https://api.yeb.to/v1/invoicing/debit-note', {
    "api_key": "YOUR_KEY",
    "seller": {
        "name": "My Co",
        "address": "1 Seller St",
        "email": "[email protected]"
    },
    "buyer": {
        "name": "Client",
        "address": "2 Buyer Rd",
        "email": "[email protected]"
    },
    "debit_note_number": "DN-2025-003",
    "invoice_number": "INV-2025-002",
    "issue_date": "2025-07-25",
    "reason": "Additional billable hours (3h)",
    "debit_amount": 144
});
echo $r->json();
fetch('https://api.yeb.to/v1/invoicing/debit-note', { method:'POST', headers:{'Content-Type':'application/json'}, body: JSON.stringify({"api_key":"YOUR_KEY","seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},"debit_note_number":"DN-2025-003","invoice_number":"INV-2025-002","issue_date":"2025-07-25","reason":"Additional billable hours (3h)","debit_amount":144}) })
  .then(r => r.json()).then(console.log);
import requests, json
payload = {
    "api_key": "YOUR_KEY",
    "seller": {
        "name": "My Co",
        "address": "1 Seller St",
        "email": "[email protected]"
    },
    "buyer": {
        "name": "Client",
        "address": "2 Buyer Rd",
        "email": "[email protected]"
    },
    "debit_note_number": "DN-2025-003",
    "invoice_number": "INV-2025-002",
    "issue_date": "2025-07-25",
    "reason": "Additional billable hours (3h)",
    "debit_amount": 144
}
                r = requests.post('https://api.yeb.to/v1/invoicing/debit-note', headers={'Content-Type':'application/json'}, data=json.dumps(payload))
print(r.json())

Response Example

{"result":{"doc_type":"debit-note","file_url":"https://cdn/.../uuid.pdf","expires":"2025-08-01 10:05:00"}}
{"error":"debit_note_number is required for a debit note.","code":422}

Yanıt Kodları

KodAçıklama
200 Successİstek başarıyla işlendi.
400 Bad RequestGiriş doğrulama başarısız.
401 UnauthorizedEksik / yanlış API anahtarı.
403 ForbiddenAnahtar etkin değil veya izin verilmiyor.
429 Rate LimitÇok fazla istek.
500 Server ErrorBeklenmeyen hata.

Debit Note

invoicing/debit-note 0.5000 credits

Parameters

API Key
body · string · required
Language
body · string
Design theme
body · string
Currency sign
body · string
Currency placement
body · string
Seller
body · string · required
Seller name
body · string · required
Seller address
body · string · required
Seller email
body · string · required
Seller VAT
body · string
Seller registry
body · string
Seller logo
body · string
Seller phone
body · string
Buyer
body · string · required
Buyer name
body · string · required
Buyer address
body · string · required
Buyer email
body · string · required
Buyer VAT
body · string
Buyer registry
body · string
Buyer phone
body · string
Items
body · string
Item name
body · string
Item description
body · string
Quantity
body · string
Unit price
body · string
VAT rate %
body · string
Gross total
body · string
Debit amount
body · string
Debit note number
body · string · required
Related invoice
body · string · required
Issue date
body · string · required
Reason
body · string · required
Payment methods
body · string
Payment method
body · string
Payment details
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Create Credit Note

POST https://api.yeb.to/v1/invoicing/credit-note
ParameterTypeRequiredDescription
seller objectyesSeller
seller.namestringyesName
seller.addressstringyesAddress
seller.emailemailyesEmail
buyer objectyesBuyer
buyer.namestringyesName
buyer.addressstringyesAddress
buyer.emailemailyesEmail
items array<object>optLines to credit
items[].namestringyes*Name
items[].quantitynumberyes*Qty
items[].unit_pricenumberyes*Unit (net)
items[].vat_ratenumberyes*VAT %
items[].total_pricenumberyes*Gross
credit_amountnumberoptWhen no items
credit_note_numberstringyesNote number
invoice_numberstringyesRelated invoice
issue_datedateyesDate (multi‑format)
reasonstringyesWhy the credit
payment_methods array<object>optRefund details
payment_methods[].methodstringyes*Method
payment_methods[].detailsobjectoptDetails

Example

curl -X POST https://api.yeb.to/v1/invoicing/credit-note \
 -H "Content-Type: application/json" \
 -d '{"api_key":"YOUR_KEY","seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},"credit_note_number":"CN-2025-001","invoice_number":"INV-2025-002","issue_date":"2025-07-26","reason":"Refund for unused support hours","items":[{"name":"Support Hours","description":"Unused","quantity":1,"unit_price":200,"vat_rate":20,"total_price":240}]}'
curl -X POST https://api.yeb.to/v1/invoicing/credit-note -H "Content-Type: application/json" -d '{"api_key":"YOUR_KEY","seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},"credit_note_number":"CN-2025-001","invoice_number":"INV-2025-002","issue_date":"2025-07-26","reason":"Refund for unused support hours","credit_amount":240}'
$r = Http::post('https://api.yeb.to/v1/invoicing/credit-note', {
    "api_key": "YOUR_KEY",
    "seller": {
        "name": "My Co",
        "address": "1 Seller St",
        "email": "[email protected]"
    },
    "buyer": {
        "name": "Client",
        "address": "2 Buyer Rd",
        "email": "[email protected]"
    },
    "credit_note_number": "CN-2025-001",
    "invoice_number": "INV-2025-002",
    "issue_date": "2025-07-26",
    "reason": "Refund for unused support hours",
    "credit_amount": 240
});
echo $r->json();
fetch('https://api.yeb.to/v1/invoicing/credit-note', { method:'POST', headers:{'Content-Type':'application/json'}, body: JSON.stringify({"api_key":"YOUR_KEY","seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},"credit_note_number":"CN-2025-001","invoice_number":"INV-2025-002","issue_date":"2025-07-26","reason":"Refund for unused support hours","credit_amount":240}) })
  .then(r => r.json()).then(console.log);
import requests, json
payload = {
    "api_key": "YOUR_KEY",
    "seller": {
        "name": "My Co",
        "address": "1 Seller St",
        "email": "[email protected]"
    },
    "buyer": {
        "name": "Client",
        "address": "2 Buyer Rd",
        "email": "[email protected]"
    },
    "credit_note_number": "CN-2025-001",
    "invoice_number": "INV-2025-002",
    "issue_date": "2025-07-26",
    "reason": "Refund for unused support hours",
    "credit_amount": 240
}
                r = requests.post('https://api.yeb.to/v1/invoicing/credit-note', headers={'Content-Type':'application/json'}, data=json.dumps(payload))
print(r.json())

Response Example

{"result":{"doc_type":"credit-note","file_url":"https://cdn/.../uuid.pdf","expires":"2025-08-01 10:05:00"}}
{"error":"credit_note_number is required for a credit note.","code":422}

Yanıt Kodları

KodAçıklama
200 Successİstek başarıyla işlendi.
400 Bad RequestGiriş doğrulama başarısız.
401 UnauthorizedEksik / yanlış API anahtarı.
403 ForbiddenAnahtar etkin değil veya izin verilmiyor.
429 Rate LimitÇok fazla istek.
500 Server ErrorBeklenmeyen hata.

Credit Note

invoicing/credit-note 0.5000 credits

Parameters

API Key
body · string · required
Language
body · string
Design theme
body · string
Currency sign
body · string
Currency placement
body · string
Seller
body · string · required
Buyer
body · string · required
Items
body · string
Credit amount
body · string
Credit note number
body · string · required
Related invoice
body · string · required
Issue date
body · string · required
Reason
body · string · required
Payment methods
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Create Receipt

POST https://api.yeb.to/v1/invoicing/receipt
ParameterTypeRequiredDescription
seller objectyesSeller
seller.namestringyesName
seller.addressstringyesAddress
seller.emailemailyesEmail
buyer objectyesBuyer
buyer.namestringyesName
buyer.addressstringyesAddress
buyer.emailemailyesEmail
items array<object>opt Receipt lines; if missing, use amount_paid
items[].namestringyes*Name
items[].quantitynumberyes*Qty
items[].unit_pricenumberyes*Unit (net)
items[].vat_ratenumberyes*VAT %
items[].total_pricenumberyes*Gross
amount_paidnumberoptUsed when no items
receipt_numberstringyesReceipt no.
payment_datedateyesDate (multi‑format)
invoice_numberstringoptRelated invoice (optional)
payment_methodstringoptShort method label
payment_methods array<object>optDetailed method objects
payment_methods[].methodstringyes*Method
payment_methods[].detailsobjectoptDetails

Example

curl -X POST https://api.yeb.to/v1/invoicing/receipt \
 -H "Content-Type: application/json" \
 -d '{"api_key":"YOUR_KEY","seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},"receipt_number":"RCPT-2025-010","payment_date":"2025-07-25","invoice_number":"INV-2025-002","items":[{"name":"Consulting","quantity":2,"unit_price":100,"vat_rate":20,"total_price":240}],"payment_methods":[{"method":"card","details":{"brand":"Visa","last4":"1234"}}]}'
curl -X POST https://api.yeb.to/v1/invoicing/receipt -H "Content-Type: application/json" -d '{"api_key":"YOUR_KEY","seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},"receipt_number":"RCPT-2025-010","payment_date":"2025-07-25","amount_paid":200,"payment_method":"cash"}'
$r = Http::post('https://api.yeb.to/v1/invoicing/receipt', {
    "api_key": "YOUR_KEY",
    "seller": {
        "name": "My Co",
        "address": "1 Seller St",
        "email": "[email protected]"
    },
    "buyer": {
        "name": "Client",
        "address": "2 Buyer Rd",
        "email": "[email protected]"
    },
    "receipt_number": "RCPT-2025-010",
    "payment_date": "2025-07-25",
    "amount_paid": 200,
    "payment_method": "cash"
});
echo $r->json();
fetch('https://api.yeb.to/v1/invoicing/receipt', { method:'POST', headers:{'Content-Type':'application/json'}, body: JSON.stringify({"api_key":"YOUR_KEY","seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},"buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},"receipt_number":"RCPT-2025-010","payment_date":"2025-07-25","amount_paid":200,"payment_method":"cash"}) })
  .then(r => r.json()).then(console.log);
import requests, json
payload = {
    "api_key": "YOUR_KEY",
    "seller": {
        "name": "My Co",
        "address": "1 Seller St",
        "email": "[email protected]"
    },
    "buyer": {
        "name": "Client",
        "address": "2 Buyer Rd",
        "email": "[email protected]"
    },
    "receipt_number": "RCPT-2025-010",
    "payment_date": "2025-07-25",
    "amount_paid": 200,
    "payment_method": "cash"
}
                r = requests.post('https://api.yeb.to/v1/invoicing/receipt', headers={'Content-Type':'application/json'}, data=json.dumps(payload))
print(r.json())

Response Example

{"result":{"doc_type":"receipt","file_url":"https://cdn/.../uuid.pdf","expires":"2025-08-01 10:05:00"}}
{"error":"payment_date is required for a receipt.","code":422}

Yanıt Kodları

KodAçıklama
200 Successİstek başarıyla işlendi.
400 Bad RequestGiriş doğrulama başarısız.
401 UnauthorizedEksik / yanlış API anahtarı.
403 ForbiddenAnahtar etkin değil veya izin verilmiyor.
429 Rate LimitÇok fazla istek.
500 Server ErrorBeklenmeyen hata.

Receipt

invoicing/receipt 0.3000 credits

Parameters

API Key
body · string · required
Seller
body · string · required
Seller name
body · string · required
Seller address
body · string · required
Seller email
body · string · required
Buyer
body · string · required
Buyer name
body · string · required
Buyer address
body · string · required
Buyer email
body · string · required
Items
body · string
Item name
body · string
Item description
body · string
Quantity
body · string
Unit price
body · string
VAT rate %
body · string
Gross total
body · string
Amount paid
body · string
Receipt number
body · string · required
Payment date
body · string · required
Related invoice
body · string
Payment method (short)
body · string
Payment methods
body · string
Payment method
body · string
Payment details
body · string

Code Samples


                
                
                
            

Response

Status:
Headers

                
Body

                

Invoicing APIs — Practical Guide

A hands-on guide to creating Pro-forma Invoices, Invoices, Debit Notes, Credit Notes, and Receipts with a single, consistent API. We’ll focus on real-world use: when to use each document, what to send, how to read responses, and gotchas to avoid.

#What these endpoints solve

One family of endpoints, five document types. Send your parties (seller/buyer), optional items and shipping, and document-specific fields. You get a ready-to-send PDF URL plus an expiry time. All messages and validation feedback are in English.

  • Pro-forma — a price quote / payment request before issuing a formal invoice.
  • Invoice — a formal tax document for goods/services delivered.
  • Debit Note — add charges to an issued invoice (e.g., extra billable hours).
  • Credit Note — reduce or refund part/all of an invoice (e.g., returns, discounts).
  • Receipt — acknowledge payment (with or without linking to an invoice).

#The practical field model

Each endpoint accepts a common core with some extras. Think in blocks:

BlockShapeRequiredNotes that matter
seller object { name, address?, email?, vat_number?, company_number?, logo?, phone? } Yes At minimum, send name. Add VAT/registration for compliance; logo is a URL.
buyer object { name, address?, email?, vat_number?, company_number?, phone? } Yes name is required. Email is printed for delivery/records.
items array<object> with when present, all required: { name, quantity, unit_price (net), vat_rate %, total_price (gross), description? } No* If you include items, each line must be complete. Use when you want line-level detail in the PDF.
shipping object { price (net), vat_rate % } No If present, both price and vat_rate are required. Treated like a separate line.
payment_methods array<object> { method, details?: object } No For “how to pay” or “how refunded”. Keep labels short (method ≤ 20 chars). details is key/value (IBAN, BIC, email…).
extras array<object> { label, value? } No Small rows printed at the bottom (“Notes”, “PO #123”, etc.).
Amounts & VAT: unit_price is net, total_price is gross. vat_rate is a percent (0–100). shipping.price is net. If you don’t need line-level detail, skip items and use the document’s summary/amount fields (see below).

#When to use which endpoint

EndpointWhen to useMust-have fields (besides seller/buyer)Shortcut (no items)
POST https://api.yeb.to/v1/invoicing/proforma Quote or pay-first flow before tax invoice. issue_date, valid_due_date Just set total_amount_due (optional for pro-forma if you show only lines; still recommended).
POST https://api.yeb.to/v1/invoicing/invoice Formal tax invoice after delivery. invoice_number, issue_date, tax_event_date, total_amount_due Provide total_amount_due; subtotal/vat_total are optional.
POST https://api.yeb.to/v1/invoicing/debit-note Charge more against an invoice (extras, corrections). debit_note_number, invoice_number, issue_date, reason Use debit_amount instead of items.
POST https://api.yeb.to/v1/invoicing/credit-note Reduce/refund an existing invoice. credit_note_number, invoice_number, issue_date, reason Use credit_amount instead of items.
POST https://api.yeb.to/v1/invoicing/receipt Confirm a payment (optionally reference an invoice). receipt_number, payment_date Use amount_paid (or send item lines if you need detail).

#Dates we accept (and how we normalize)

The API accepts common formats and normalizes to YYYY-MM-DD internally:

  • Y-m-d (2025-01-09)
  • d-m-Y (09-01-2025), d/m/Y (09/01/2025), d/m/y (09/01/25)
  • m/d/Y (01/09/2025), m/d/y (01/09/25)

If a date can’t be parsed, you’ll get a clear validation error listing allowed formats.

#Minimal, production-ready payloads

#Pro-forma

curl -X POST "https://api.yeb.to/v1/invoicing/proforma" -H "Content-Type: application/json" -d '{
  "api_key": "YOUR_KEY",
  "seller": {"name":"My Company","address":"1 Seller St","email":"[email protected]"},
  "buyer":  {"name":"Client Inc.","address":"2 Buyer Rd","email":"[email protected]"},
  "issue_date": "2025-07-23",
  "valid_due_date": "2025-08-06",
  "items": [{"name":"Consulting","quantity":2,"unit_price":100,"vat_rate":20,"total_price":240}],
  "extras": [{"label":"Notes","value":"Valid for 14 days"}]
}'

#Invoice

curl -X POST "https://api.yeb.to/v1/invoicing/invoice" -H "Content-Type: application/json" -d '{
  "api_key": "YOUR_KEY",
  "seller": {"name":"My Company","address":"1 Seller St","email":"[email protected]"},
  "buyer":  {"name":"Client Inc.","address":"2 Buyer Rd","email":"[email protected]"},
  "invoice_number": "INV-2025-002",
  "issue_date": "2025-07-23",
  "tax_event_date": "2025-07-23",
  "items": [{"name":"Consulting","quantity":2,"unit_price":100,"vat_rate":20,"total_price":240}],
  "shipping": {"price":25,"vat_rate":20},
  "total_amount_due": 270
}'

#Debit Note

curl -X POST "https://api.yeb.to/v1/invoicing/debit-note" -H "Content-Type: application/json" -d '{
  "api_key":"YOUR_KEY",
  "seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},
  "buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},
  "debit_note_number":"DN-2025-003",
  "invoice_number":"INV-2025-002",
  "issue_date":"2025-07-25",
  "reason":"Additional billable hours (3h)",
  "debit_amount":144
}'

#Credit Note

curl -X POST "https://api.yeb.to/v1/invoicing/credit-note" -H "Content-Type: application/json" -d '{
  "api_key":"YOUR_KEY",
  "seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},
  "buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},
  "credit_note_number":"CN-2025-001",
  "invoice_number":"INV-2025-002",
  "issue_date":"2025-07-26",
  "reason":"Refund for unused support hours",
  "credit_amount":240,
  "payment_methods":[{"method":"bank transfer","details":{"iban":"BG00...","bic":"BANKBGSF"}}]
}'

#Receipt

curl -X POST "https://api.yeb.to/v1/invoicing/receipt" -H "Content-Type: application/json" -d '{
  "api_key":"YOUR_KEY",
  "seller":{"name":"My Co","address":"1 Seller St","email":"[email protected]"},
  "buyer":{"name":"Client","address":"2 Buyer Rd","email":"[email protected]"},
  "receipt_number":"RCPT-2025-010",
  "payment_date":"2025-07-25",
  "amount_paid":200,
  "payment_method":"card"
}'

#Presentation options that actually matter

  • Design: classic|modern|elegant|minimal. If a chosen design isn’t available, the API attempts to use classic; if neither exists you’ll get 400 "Design not found."
  • Language: lang is a 2-letter code for labels/text in the PDF (default en).
    Supported languages:
    • 🇬🇧 — English (en)
    • 🇧🇬 — Bulgarian (bg)
    • 🇫🇷 — French (fr)
    • 🇩🇪 — German (de)
    • 🇬🇷 — Greek (el)
    • 🇮🇹 — Italian (it)
    • 🇪🇸 — Spanish (es)
    • 🇵🇹 — Portuguese (pt)
    • 🇷🇺 — Russian (ru)
    • 🇹🇷 — Turkish (tr)
    • 🇵🇱 — Polish (pl)
    • 🇨🇿 — Czech (cs)
    • 🇷🇴 — Romanian (ro)
    • 🇳🇱 — Dutch (nl)
    • 🇸🇪 — Swedish (sv)
    • 🇳🇴 — Norwegian (no)
    • 🇫🇮 — Finnish (fi)
    • 🇮🇸 — Icelandic (is)
    • 🇺🇦 — Ukrainian (uk)
    • 🇸🇦 — Arabic (ar)
    • 🇩🇰 — Danish (da)
    • 🇷🇸 — Serbian (Latin) (sr)
  • Currency: Use currency (symbol or code) and currency_side (before or after, default after).

#What you get back (and what to do next)

{
  "result": {
    "doc_type": "invoice|proforma|debit-note|credit-note|receipt",
    "file_url": "https://cdn.../uuid.pdf",
    "expires": "2025-08-01 10:05:00"
  }
}
  • file_url — a direct PDF link. Best practice: download and store on your side; links expire after 7 days.
  • doc_type — echoes the type you created. Use for auditing/notifications.
  • expires — we recommend background jobs to archive PDFs before expiry.

#Common errors & quick fixes

{"error":"invoice_number is required for an invoice.","code":422}
{"error":"shipping.vat_rate is required when shipping is provided.","code":422}
{"error":"Design “elegant” not found.","code":400}
  • 422 validation: Provide all must-have fields for your endpoint; if you send items, each line must include name, quantity, unit_price, vat_rate, total_price.
  • Dates: If parsing fails you’ll get a helpful message listing accepted formats.
  • Design 400: Switch to classic or check your theme availability.

#Field recipes & integration tips

  1. No line items? For debit/credit notes and receipts, use the single amount fields (debit_amount, credit_amount, amount_paid).
  2. Totals: On invoices, you must send total_amount_due. subtotal and vat_total are optional (the PDF will still render correctly).
  3. Payment instructions: Prefer payment_methods[] to show bank transfer/PayPal/card with details. For receipts, you can also set a simple payment_method label.
  4. Branding: Send design, logo, and currency_side to match your brand style and region conventions.
  5. Compliance: Include VAT/registration IDs for both parties when applicable. Keep reason fields (reason) clear for credit/debit notes.

#API Changelog

2026-03-07
Item-level VAT. Added support for per-item VAT via items[].vat_rate. If omitted, the previous global VAT logic applies as before.
2026-03-07
Items payload normalized. Improved parsing and stability of items[] fields: tolerant to minor key order differences and documented a recommended field order for more predictable results.
2026-03-07
Templates polished. All document themes (classic, modern, elegant, minimal) received visual/layout refinements and improved typography.
2026-03-07
Invoice totals simplified. subtotal and vat_total became optional; total_amount_due remains required.
2026-02-28
Date normalization improved. The API now accepts multiple common formats and normalizes to YYYY-MM-DD before validation, with clearer error messages on failure.
2026-02-21
Receipts streamlined. Added payment_method (short label) in addition to payment_methods[] for quick receipts without details.
2026-02-14
Design & currency UX. currency_side (before|after) introduced; if a chosen design isn’t available we attempt classic (else 400). PDFs render with Unicode-safe fonts by default.

Sıkça Sorulan Sorular

Faturalar, proforma faturalar, borç dekontları, alacak dekontları ve makbuzlar.

"shipping" nesnesini "price" (net) ve "vat_rate" (%) ile gönderin. Alt toplam ve KDV toplamlarına dahil edilir.

Y-m-d, d-m-Y, d/m/Y, d/m/y, m/d/Y, m/d/y. API bunları Y-m-d'ye normalleştirir.

Hayır. "receipt.invoice_number" isteğe bağlıdır.

Evet. 2 harfli "lang" iso2 kodu gönderin, sunucu İngilizce yedekli eşleşen sözlüğü kullanır.

Evet. Hata ile sonuçlananlar dahil her istek kredi tüketir. Kredileriniz başarı veya başarısızlıktan bağımsız olarak istek sayısına bağlıdır. Hata açıkça bizim tarafımızdaki bir platform sorunundaysa, etkilenen kredileri geri yükleriz (nakit iade yapılmaz).

[email protected] adresinden bize ulaşın. Geri bildirimleri ciddiye alıyoruz—hata raporunuz veya özellik isteğiniz anlamlıysa, API'yi hızla düzeltebilir veya geliştirebilir ve teşekkür olarak size 50 ücretsiz kredi verebiliriz.

API'ye ve bazen endpoint'e bağlıdır. Bazı endpoint'ler daha katı limitlere sahip olabilecek harici kaynaklardan veri kullanır. Ayrıca kötüye kullanımı önlemek ve platformumuzu stabil tutmak için limitler uyguluyoruz. Her endpoint'in belirli limiti için belgelere bakın.

Kredi sistemiyle çalışıyoruz. Krediler, API çağrıları ve araçlar için harcadığınız ön ödemeli, iade edilemez birimlerdir. Krediler FIFO (en eski önce) sırasıyla tüketilir ve satın alma tarihinden itibaren 12 ay geçerlidir. Kontrol paneli her satın alma tarihini ve son kullanma tarihini gösterir.

Evet. Satın alınan tüm krediler (kesirli bakiyeler dahil) satın almadan itibaren 12 ay geçerlidir. Kullanılmayan krediler geçerlilik süresinin sonunda otomatik olarak sona erer ve kalıcı olarak silinir. Süresi dolan krediler geri yüklenemez veya nakde ya da başka bir değere dönüştürülemez. Geçiş kuralı: 22 Eyl 2025 öncesi satın alınan krediler 22 Eyl 2025'te satın alınmış olarak kabul edilir ve 22 Eyl 2026'da sona erer (satın alma sırasında daha erken bir son kullanma tarihi belirtilmedikçe).

Evet—geçerlilik süreleri içinde. Kullanılmayan krediler mevcut kalır ve satın almadan 12 ay sonra sona erene kadar aydan aya devredilir.

Krediler iade edilemez. Sadece ihtiyacınız olanı satın alın—her zaman daha sonra yükleyebilirsiniz. Bir platform hatası başarısız bir ücretlendirmeye neden olursa, soruşturma sonrası etkilenen kredileri geri yükleyebiliriz. Nakit iade yapılmaz.

Fiyatlar dolar değil kredi olarak belirlenir. Her endpoint'in kendi maliyeti vardır—yukarıdaki "Kredi / istek" rozetine bakın. Her zaman tam olarak ne harcadığınızı bilirsiniz.
← API'lere Dön