Skip to content
Docs

E-invoices

POST/api/invoices

Create invoice

Create an invoice for your business.

Server-side request · headers mid + terminal-idTry it in Sandbox

Request body

FieldTypeDescription
invoice_noOptionalstring

Invoice number. If not provided, one is generated automatically.

e.g. UL1660650550504
customer_numberRequiredstring

Customer mobile number.

e.g. 971501234567
customer_emailRequiredstring

Customer email address.

e.g. aisha.rahman@example.com
customer_nameRequiredstring

Customer name.

e.g. Aisha Rahman
business_nameRequiredstring

Business name.

e.g. Example Trading LLC
business_addressRequiredstring

Business address.

e.g. Office 1204, Bay Square, Business Bay, Dubai, UAE
taxable_numberRequiredstring

Tax registration number, e.g. TRN in the UAE or GSTIN in India.

e.g. 1004c******
invoice_dateOptionalstring

Invoice date shown on the invoice, in ISO 8601 format. If not provided, today's date is used.

e.g. 2022-08-16 00:00:00.000
payment_modeRequiredstring

Payment mode of the invoice.

One of QRCODELINKCASH
receivedOptionalstring

The advance amount received from the customer.

e.g. 100
currency_codeRequiredstring

The three-letter ISO currency code.

Min length 3Max length 3e.g. AED
itemsRequiredarray of objects

Items or products on the invoice.

items[].nameRequiredstring

Item or product name.

e.g. Brand strategy workshop
items[].quantityRequiredstring

Quantity of the item.

e.g. 2
items[].unitRequiredstring

Item or product unit.

e.g. Session
items[].priceRequiredstring

Item or product price.

e.g. 1500
items[].discountRequiredstring

Discount on the item or product.

e.g. 0
items[].with_taxRequiredstring

Whether the price already includes tax.

e.g. false
items[].taxRequiredstring

Tax percentage on the item or product.

e.g. 5
emailOptionalobject

Sends the invoice to the customer by email.

email.subjectRequiredstring

Email subject.

e.g. Invoice INV-10482 from Example Trading LLC
email.messageRequiredstring

Email body.

e.g. Please find attached your invoice.
email.recipientsOptionalobject—
email.recipients.toRequiredarray of any

Recipient email addresses.

email.recipients.ccOptionalarray of any

CC recipient email addresses.

email.recipients.bccOptionalarray of any

BCC recipient email addresses.

smsOptionalobject

Sends the invoice to the customer's mobile number by SMS.

sms.invoice_urlRequiredboolean

Include the invoice link in the SMS.

Default falsee.g. true
sms.messageRequiredstring

SMS message body.

e.g. Your invoice from Example Trading LLC is ready.

Headers

FieldTypeDescription
midRequiredstring

Your MID, starts with ul-mid.

e.g. ul-mid-696f12de-46d0-48c4-a7c8-bb*********5
terminal-idRequiredstring

Your terminal id, starts with ul-tid.

e.g. ul-tid-6208df4ad7329e*********e

Responses

StatusDescription
200 OKSuccess
400 Bad requestBad Request
401 UnauthorizedUnauthorized
403 ForbiddenForbidden: the merchant account is inactive, suspended from collecting payments, or KYC isn't approved.

Response fields 200

FieldTypeDescription
statusOptionalboolean

Status of API request.

e.g. true
linkOptionalstring

Invoice link.

e.g. https://api.geturbanledger.com/api/image/show/UL1*********_*****_*****_28_10_2022.pdf
file_nameOptionalstring

Invoice file name.

e.g. UL1*********_*****_*****_28_10_2022.pdf
payment_linkOptionalstring

Payment link for QR Code or link.

e.g. https://api.geturbanledger.com/api/payment/request/qr/635b******************
POSThttps://sandbox.geturbanledger.com/api/invoices
curl -X POST "https://sandbox.geturbanledger.com/api/invoices" \
  -H "Content-Type: application/json" \
  -H "mid: sb-ul-mid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
  -H "terminal-id: ul-tid-xxxxxxxxxxxxxxxxxxxxxxxx" \
  -d '{
  "invoice_no": "UL1660650550504",
  "customer_number": "971501234567",
  "customer_email": "aisha.rahman@example.com",
  "customer_name": "Aisha Rahman",
  "business_name": "Example Trading LLC",
  "business_address": "Office 1204, Bay Square, Business Bay, Dubai, UAE",
  "taxable_number": "1004c******",
  "invoice_date": "2022-08-16 00:00:00.000",
  "payment_mode": "QRCODE",
  "received": 100,
  "currency_code": "AED",
  "items": [
    {
      "name": "Brand strategy workshop",
      "quantity": "2",
      "unit": "Session",
      "price": "1500",
      "discount": "0",
      "with_tax": "false",
      "tax": "5"
    }
  ],
  "email": {
    "subject": "Invoice INV-10482 from Example Trading LLC",
    "message": "Please find attached your invoice.",
    "recipients": {
      "to": [
        "aisha.rahman@example.com"
      ],
      "cc": [
        "finance@example.com"
      ],
      "bcc": [
        "accounts@example.com"
      ]
    }
  },
  "sms": {
    "invoice_url": true,
    "message": "Your invoice from Example Trading LLC is ready."
  }
}'
Response
200 OK · Success
{
  "status": true,
  "link": "https://api.geturbanledger.com/api/image/show/UL1*********_*****_*****_28_10_2022.pdf",
  "file_name": "UL1*********_*****_*****_28_10_2022.pdf",
  "payment_link": "https://api.geturbanledger.com/api/payment/request/qr/635b******************"
}
Talk to ustalk-to-us