Invoicing API — Генериране на PDF документи | YEB

Генерирайте PDF фактури, проформа фактури, дебитни/кредитни известия и разписки с i18n етикети, гъвкави формати за дати, множество дизайн теми и стриктна валидация чрез един REST API.

Какво можете да правите?
Висококачествени PDF-и

A4 изход чрез DomPDF с множество дизайн теми.

Готов за i18n

Двубуквен езиков код + речник (напр. en, bg).

Доставка с ДДС

Добавете доставка като нето + ДДС ставка; общите суми се коригират автоматично.

Гъвкави формати за дати

Приема Y-m-d, d/m/Y, d-m-Y, m/d/Y и др.; нормализира се до Y-m-d.

Изпробвай на живо
99.9 % Време на работа
580.7ms Отговор
10 req/s
0.5 Кредити / заявка

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
}

Кодове на отговор

КодОписание
200 SuccessЗаявката е обработена успешно.
400 Bad RequestНеуспешна валидация на входните данни.
401 UnauthorizedЛипсващ / грешен API ключ.
403 ForbiddenКлючът е неактивен или без достъп.
429 Rate LimitТвърде много заявки.
500 Server ErrorНеочаквана грешка.

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
}

Кодове на отговор

КодОписание
200 SuccessЗаявката е обработена успешно.
400 Bad RequestНеуспешна валидация на входните данни.
401 UnauthorizedЛипсващ / грешен API ключ.
403 ForbiddenКлючът е неактивен или без достъп.
429 Rate LimitТвърде много заявки.
500 Server ErrorНеочаквана грешка.

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}

Кодове на отговор

КодОписание
200 SuccessЗаявката е обработена успешно.
400 Bad RequestНеуспешна валидация на входните данни.
401 UnauthorizedЛипсващ / грешен API ключ.
403 ForbiddenКлючът е неактивен или без достъп.
429 Rate LimitТвърде много заявки.
500 Server ErrorНеочаквана грешка.

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}

Кодове на отговор

КодОписание
200 SuccessЗаявката е обработена успешно.
400 Bad RequestНеуспешна валидация на входните данни.
401 UnauthorizedЛипсващ / грешен API ключ.
403 ForbiddenКлючът е неактивен или без достъп.
429 Rate LimitТвърде много заявки.
500 Server ErrorНеочаквана грешка.

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}

Кодове на отговор

КодОписание
200 SuccessЗаявката е обработена успешно.
400 Bad RequestНеуспешна валидация на входните данни.
401 UnauthorizedЛипсващ / грешен API ключ.
403 ForbiddenКлючът е неактивен или без достъп.
429 Rate LimitТвърде много заявки.
500 Server ErrorНеочаквана грешка.

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.

Често задавани въпроси

Фактури, проформа фактури, дебитни известия, кредитни известия и разписки.

Изпратете обект "shipping" с "price" (нетна цена) и "vat_rate" (%). Той се включва в междинната сума и общото ДДС.

Y-m-d, d-m-Y, d/m/Y, d/m/y, m/d/Y, m/d/y. API-то ги нормализира до Y-m-d.

Не. Полето "receipt.invoice_number" е незадължително.

Да. Подайте двубуквен "lang" iso2 код и сървърът използва съответния речник с резервен вариант на английски.

Да. Всяка заявка, дори тази с грешка, изразходва кредити. Това е така, защото кредитите ви са обвързани с броя заявки, независимо от успеха или неуспеха. Ако грешката е ясно по наша вина, ще възстановим засегнатите кредити (без парично възстановяване).

Свържете се с нас на [email protected]. Приемаме обратната връзка сериозно — ако докладът ви за бъг или заявката за функционалност е смислена, можем да поправим или подобрим API-то бързо и да ви предоставим 50 безплатни кредита като благодарност.

Зависи от API-то и понякога дори от конкретната крайна точка. Някои крайни точки използват данни от външни източници, които може да имат по-строги ограничения. Ние също налагаме лимити за предотвратяване на злоупотреби и поддържане стабилността на платформата. Проверете документацията за конкретния лимит на всяка крайна точка.

Работим на кредитна система. Кредитите са предплатени, невъзстановими единици, които изразходвате за API извиквания и инструменти. Кредитите се изразходват FIFO (първи закупен, първи използван) и са валидни 12 месеца от датата на покупка. Таблото показва датата на покупка и изтичането на всяка покупка.

Да. Всички закупени кредити (включително дробни баланси) са валидни 12 месеца от покупката. Неизползваните кредити автоматично изтичат и се изтриват окончателно в края на периода на валидност. Изтеклите кредити не могат да бъдат възстановени или конвертирани в пари или друга стойност. Преходно правило: кредити, закупени преди 22 септ. 2025 г., се третират като закупени на 22 септ. 2025 г. и изтичат на 22 септ. 2026 г. (освен ако не е посочено по-ранно изтичане при покупката).

Да — в рамките на периода им на валидност. Неизползваните кредити остават налични и се прехвърлят от месец на месец, докато не изтекат 12 месеца след покупката.

Кредитите са невъзстановими. Купувайте само каквото ви трябва — винаги можете да заредите по-късно. Ако грешка от наша страна причини неуспешно таксуване, може да възстановим засегнатите кредити след проверка. Без парично възстановяване.

Цените са определени в кредити, не в долари. Всяка крайна точка посочва собствената си цена — вижте бадж „Кредити / заявка" по-горе. Винаги ще знаете точно колко изразходвате.
← Обратно към API-тата