Authorize invoice

Allows an application server to define invoice line items and other invoice-related information that will be stored in Tilia's system for retrieval when a client calls create invoice with the returned ID.

Securitytilia_auth
Request
Request Body schema: application/json
required

Authorize invoice request object

required
Array of objects (LineItemsRequest)

The line items to be purchased.

account_id
required
string <= 36 characters

The buyer's Tilia Account ID.

invoice_mechanism
required
string

Defines how the invoice will be sent to the user. One of the following values: api, widget.

Value Description
api Used by non-browser/non-widget flows.
widget Used only in the widget transaction flow.
tilia_hosted Used to generate a tilia hosted checkout URL.
is_escrow
boolean

If this invoice is intended to be an escrow invoice, this should be set to true

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.

tax_inclusive
boolean
Default: false

An optional boolean flag indicating whether taxes should be calculated. If exclusive (false), the tax amount will be added to each line item amount. If inclusive (true), the line item amount you pass in is inclusive of the tax amount. For example, consider the following invoice of 1000 USD and 10% tax:

  • Tax exclusive: 1100 USD total (1000 USD net + 100 tax)
  • Tax inclusive: 1000 USD total (909 USD net + 91 tax)
object

An optional object used for tax determination calculation. If none is provided, the address associated with a user's account details or payment method will be used.

metadata
object

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

Responses
200

Successfully authorized invoice.

400

Validation errors

401

Unauthorized access.

403

Disallowed from transacting.

500

Service unavailable or server error.

post/v2/authorize/invoice
Request samples
application/json
{
  • "line_items": [
    ],
  • "account_id": "acct_2TiDFXHVFMlAuyy7ovvz3YPKv9b",
  • "invoice_mechanism": "string",
  • "is_escrow": true,
  • "reference_type": "Acme order number",
  • "reference_id": "8987749",
  • "description": "Digital product order",
  • "tax_inclusive": false,
  • "location": {
    },
  • "metadata": {
    }
}
Response samples
application/json
{}