Create a new invoice

Creates a draft invoice. Once created, the invoice can be paid using the /pay endpoint. See our purchase flow developer guide for more info on how to construct different invoices.

Request
Security:
tilia_auth (write_invoices)
Request Body schema: application/json

Invoice resource

account_id
required
string <UUID4>

The buyer's Tilia Pay Account ID.

reference_type
string

A type for your reference_id.

reference_id
string

Your own reference ID.

description
string

A user-facing description for this invoice. May be used in receipts and transaction history pages, and viewed by support agents.

metadata
string

An arbitrary data structure associated with this invoice. POSTed back to your webhook upon invoice completion.

Array of objects

The buyer's payment method to use for purchase. NOTE: if the line items are priced in real currency, this field is required.

required
Array of objects (LineItems)

The line items to be purchased. NOTE: If line items are priced in virtual currency, the payment method section should be omitted, as Tilia will handle it for you.

Responses
201

Successfully created invoice.

400

Invalid input

401

Unauthorized access.

500

Service unavailable or server error.

post/v2/invoice
Request samples
application/json
{
  • "account_id": "b2ba9a0f-3d75-44e0-968d-be299cda5d80",
  • "reference_type": "Acme order number",
  • "reference_id": "8987749",
  • "description": "Digital product order",
  • "metadata": "{“key1”: {“key2”: 3}}",
  • "payment_methods": [
    ],
  • "line_items": [
    ]
}
Response samples
application/json
{
  • "status": "Success",
  • "message": null,
  • "codes": null,
  • "payload": {
    }
}