Account Line Items

An AccountLineItem is a single line item in the accounting ledger for a billing account. These include payments and invoices.

List Invoices

Endpoint

GET/invoices

Return Object

AccountLineItem[]

Authorization Requirement

Available to all authenticated keys or sessions.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/invoices.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "amount": "1.0",
    "balance": "1.0",
    "created_at": "2000-01-01T01:00:00Z",
    "currency": "USD",
    "download_uri": "https://url...",
    "invoice_line_items": [
      {
        "id": 1,
        "amount": "1.0",
        "created_at": "2000-01-01T01:00:00Z",
        "description": "Service from 2019-01-01 through 2019-12-31",
        "type": "invoice",
        "service_end_at": "2000-01-01T01:00:00Z",
        "service_start_at": "2000-01-01T01:00:00Z",
        "plan": "Enterprise",
        "site": "My site",
        "prepaid_bytes": 1,
        "prepaid_bytes_expire_at": "2000-01-01T01:00:00Z",
        "prepaid_bytes_used": 1,
        "prepaid_bytes_available": 1
      }
    ],
    "method": "paypal",
    "payment_line_items": [
      {
        "amount": "1.0",
        "created_at": "2000-01-01T01:00:00Z",
        "invoice_id": 1,
        "payment_id": 1
      }
    ],
    "payment_reversed_at": "2000-01-01T01:00:00Z",
    "payment_type": "example",
    "site_name": "My Site",
    "type": "invoice"
  }
]

List Payments

Endpoint

GET/payments

Return Object

AccountLineItem[]

Authorization Requirement

Available to all authenticated keys or sessions.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/payments.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "amount": "1.0",
    "balance": "1.0",
    "created_at": "2000-01-01T01:00:00Z",
    "currency": "USD",
    "download_uri": "https://url...",
    "invoice_line_items": [
      {
        "id": 1,
        "amount": "1.0",
        "created_at": "2000-01-01T01:00:00Z",
        "description": "Service from 2019-01-01 through 2019-12-31",
        "type": "invoice",
        "service_end_at": "2000-01-01T01:00:00Z",
        "service_start_at": "2000-01-01T01:00:00Z",
        "plan": "Enterprise",
        "site": "My site",
        "prepaid_bytes": 1,
        "prepaid_bytes_expire_at": "2000-01-01T01:00:00Z",
        "prepaid_bytes_used": 1,
        "prepaid_bytes_available": 1
      }
    ],
    "method": "paypal",
    "payment_line_items": [
      {
        "amount": "1.0",
        "created_at": "2000-01-01T01:00:00Z",
        "invoice_id": 1,
        "payment_id": 1
      }
    ],
    "payment_reversed_at": "2000-01-01T01:00:00Z",
    "payment_type": "example",
    "site_name": "My Site",
    "type": "invoice"
  }
]

Show Invoice

Endpoint

GET/invoices/{id}

Return Object

AccountLineItem

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
id
int64
Required
Invoice ID.

Example Request

curl https://app.files.com/api/rest/v1/invoices/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "amount": "1.0",
  "balance": "1.0",
  "created_at": "2000-01-01T01:00:00Z",
  "currency": "USD",
  "download_uri": "https://url...",
  "invoice_line_items": [
    {
      "id": 1,
      "amount": "1.0",
      "created_at": "2000-01-01T01:00:00Z",
      "description": "Service from 2019-01-01 through 2019-12-31",
      "type": "invoice",
      "service_end_at": "2000-01-01T01:00:00Z",
      "service_start_at": "2000-01-01T01:00:00Z",
      "plan": "Enterprise",
      "site": "My site",
      "prepaid_bytes": 1,
      "prepaid_bytes_expire_at": "2000-01-01T01:00:00Z",
      "prepaid_bytes_used": 1,
      "prepaid_bytes_available": 1
    }
  ],
  "method": "paypal",
  "payment_line_items": [
    {
      "amount": "1.0",
      "created_at": "2000-01-01T01:00:00Z",
      "invoice_id": 1,
      "payment_id": 1
    }
  ],
  "payment_reversed_at": "2000-01-01T01:00:00Z",
  "payment_type": "example",
  "site_name": "My Site",
  "type": "invoice"
}

Show Payment

Endpoint

GET/payments/{id}

Return Object

AccountLineItem

Authorization Requirement

Available to all authenticated keys or sessions.

Request Parameters

ParameterDescription
id
int64
Required
Payment ID.

Example Request

curl https://app.files.com/api/rest/v1/payments/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "amount": "1.0",
  "balance": "1.0",
  "created_at": "2000-01-01T01:00:00Z",
  "currency": "USD",
  "download_uri": "https://url...",
  "invoice_line_items": [
    {
      "id": 1,
      "amount": "1.0",
      "created_at": "2000-01-01T01:00:00Z",
      "description": "Service from 2019-01-01 through 2019-12-31",
      "type": "invoice",
      "service_end_at": "2000-01-01T01:00:00Z",
      "service_start_at": "2000-01-01T01:00:00Z",
      "plan": "Enterprise",
      "site": "My site",
      "prepaid_bytes": 1,
      "prepaid_bytes_expire_at": "2000-01-01T01:00:00Z",
      "prepaid_bytes_used": 1,
      "prepaid_bytes_available": 1
    }
  ],
  "method": "paypal",
  "payment_line_items": [
    {
      "amount": "1.0",
      "created_at": "2000-01-01T01:00:00Z",
      "invoice_id": 1,
      "payment_id": 1
    }
  ],
  "payment_reversed_at": "2000-01-01T01:00:00Z",
  "payment_type": "example",
  "site_name": "My Site",
  "type": "invoice"
}

The AccountLineItem Object

Some of the endpoints above return a AccountLineItem object. The attributes of this object are listed below.

AttributeDescription
id
int64
Line item Id
amount
decimal
Line item amount
balance
decimal
Line item balance
created_at
date-time
Line item created at
currency
string
Line item currency
download_uri
string
Line item download uri
invoice_line_items
array(object)
Associated invoice line items
method
string
Line item payment method
payment_line_items
array(object)
Associated payment line items
payment_reversed_at
date-time
Date/time payment was reversed if applicable
payment_type
string
Type of payment if applicable
site_name
string
Site name this line item is for
type
string
Type of line item, either payment or invoice

Example AccountLineItem Object

{
  "id": 1,
  "amount": "1.0",
  "balance": "1.0",
  "created_at": "2000-01-01T01:00:00Z",
  "currency": "USD",
  "download_uri": "https://url...",
  "invoice_line_items": [
    {
      "id": 1,
      "amount": "1.0",
      "created_at": "2000-01-01T01:00:00Z",
      "description": "Service from 2019-01-01 through 2019-12-31",
      "type": "invoice",
      "service_end_at": "2000-01-01T01:00:00Z",
      "service_start_at": "2000-01-01T01:00:00Z",
      "plan": "Enterprise",
      "site": "My site",
      "prepaid_bytes": 1,
      "prepaid_bytes_expire_at": "2000-01-01T01:00:00Z",
      "prepaid_bytes_used": 1,
      "prepaid_bytes_available": 1
    }
  ],
  "method": "paypal",
  "payment_line_items": [
    {
      "amount": "1.0",
      "created_at": "2000-01-01T01:00:00Z",
      "invoice_id": 1,
      "payment_id": 1
    }
  ],
  "payment_reversed_at": "2000-01-01T01:00:00Z",
  "payment_type": "example",
  "site_name": "My Site",
  "type": "invoice"
}