API Documentation

API Endpoint

Line Items

Line Items

Supported filter params

  • invoice_id (array)
GET /api/v2/line_items
Requestsreturns line_items

GET  /api/v2/line_items

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": [
    {
      "id": "3",
      "type": "line_items",
      "attributes": {
        "unit_id": 2,
        "position": 1,
        "quantity": "3.0",
        "discount": null,
        "description": "test name",
        "adjustment": false,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "unit_price": 5000,
        "unit_price_default": 6250,
        "unit_price_normalized": 5000,
        "amount": 15000,
        "amount_default": 18750,
        "amount_normalized": 15000
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 377
          }
        },
        "invoice": {
          "data": {
            "type": "invoices",
            "id": "40"
          }
        },
        "service": {
          "data": null
        },
        "expense": {
          "data": null
        },
        "service_type": {
          "data": {
            "type": "service_types",
            "id": "51"
          }
        }
      }
    }
  ],
  "included": [
    {
      "id": "40",
      "type": "invoices",
      "attributes": {
        "number": "2016/01",
        "subject": null,
        "invoiced_on": "2020-10-21",
        "sent_on": null,
        "pay_on": "2020-10-31",
        "delivery_on": null,
        "paid_on": null,
        "discount": null,
        "tax1_name": null,
        "tax1_value": null,
        "tax2_name": null,
        "tax2_value": null,
        "deleted_at": null,
        "tag_list": [],
        "note": null,
        "exported_at": null,
        "export_integration_type_id": null,
        "note_interpolated": null,
        "email_key": "343e20e4be17262a56a1e22a7cbfa38b",
        "purchase_order_number": null,
        "export_invoice_url": null,
        "company_reference_id": null,
        "created_at": "2020-10-21T01:04:43.790+02:00",
        "exchange_rate": "1.25",
        "exchange_date": "2020-10-21",
        "custom_fields": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "amount": 15000,
        "amount_default": 18750,
        "amount_normalized": 15000,
        "amount_tax": 0,
        "amount_tax_default": 0,
        "amount_tax_normalized": 0,
        "amount_with_tax": 15000,
        "amount_with_tax_default": 18750,
        "amount_with_tax_normalized": 15000,
        "amount_paid": 0,
        "amount_paid_default": 0,
        "amount_paid_normalized": 0,
        "amount_written_off": 0,
        "amount_written_off_default": 0,
        "amount_written_off_normalized": 0,
        "amount_unpaid": 15000,
        "amount_unpaid_default": 18750,
        "amount_unpaid_normalized": 15000
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 377
          }
        },
        "bill_to": {
          "data": null
        },
        "bill_from": {
          "data": null
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1188"
          }
        },
        "document_type": {
          "data": null
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "855"
          }
        },
        "invoice_attributions": {
          "data": []
        },
        "attachment": {
          "data": null
        }
      }
    },
    {
      "id": "51",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "category_id": null,
        "archived_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 377
          }
        }
      }
    },
    {
      "id": "1188",
      "type": "companies",
      "attributes": {
        "name": "Client812",
        "billing_name": null,
        "vat": null,
        "default_currency": null,
        "created_at": "2020-10-21T01:04:43.785+02:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "custom_fields": null,
        "description": null,
        "due_days": null,
        "tag_list": [],
        "contact": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 377
          }
        },
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "855",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user840@email.com",
        "title": null,
        "joined_at": "2020-10-21T01:04:43.000+02:00",
        "last_seen_at": "2020-10-21T01:04:43.819+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "virtual": false,
        "custom_fields": null,
        "autotracking": false,
        "created_at": "2020-10-21T01:04:43.769+02:00",
        "placeholder": false,
        "color_id": null,
        "private_custom_reports_used": 0
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 377
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1187"
          }
        },
        "subsidiary": {
          "data": null
        }
      }
    },
    {
      "id": "1187",
      "type": "companies",
      "attributes": {
        "name": "Organization377",
        "billing_name": null,
        "vat": null,
        "default_currency": "USD",
        "created_at": "2020-10-21T01:04:43.768+02:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "custom_fields": null,
        "description": null,
        "due_days": null,
        "tag_list": [],
        "contact": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 377
          }
        },
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "links": {
    "first": "http://www.example.com/api/v2/line_items?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "last": "http://www.example.com/api/v2/line_items?page%5Bnumber%5D=1&page%5Bsize%5D=30"
  },
  "meta": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1,
    "page_size": 30,
    "max_page_size": 200,
    "organization_features": {
      "custom_fields": {
        "type": "metered",
        "limit": 15,
        "used": 0
      },
      "custom_fields_per_project": {
        "type": "metered",
        "limit": 10,
        "used": 0
      },
      "public_custom_reports": {
        "type": "metered",
        "limit": 30,
        "used": 0
      },
      "private_custom_reports": {
        "type": "metered",
        "limit": 30,
        "used": 0
      },
      "scheduling_placeholders": {
        "type": "metered",
        "limit": 5,
        "used": 0
      },
      "multigrouping": {
        "type": "switch",
        "available": true
      },
      "client_access_to_budgets": {
        "type": "switch",
        "available": true
      },
      "subsidiaries": {
        "type": "switch",
        "available": true
      },
      "time_approvals": {
        "type": "switch",
        "available": true
      },
      "expenses_approvals": {
        "type": "switch",
        "available": true
      },
      "timeoff_approvals": {
        "type": "switch",
        "available": true
      },
      "autotracking": {
        "type": "switch",
        "available": true
      },
      "forecasting": {
        "type": "switch",
        "available": true
      },
      "webhooks": {
        "type": "switch",
        "available": true
      },
      "table_pivoting": {
        "type": "switch",
        "available": true
      },
      "formula_fields": {
        "type": "switch",
        "available": true
      },
      "single_sign_on": {
        "type": "switch",
        "available": true
      },
      "duplicate_tasks": {
        "type": "switch",
        "available": true
      },
      "billable_time_rounding": {
        "type": "switch",
        "available": true
      },
      "payment_sync": {
        "type": "switch",
        "available": true
      },
      "booking_methods": {
        "type": "switch",
        "available": true
      },
      "import_tasks_csv": {
        "type": "switch",
        "available": true
      },
      "reactions": {
        "type": "switch",
        "available": true
      },
      "time_week_view": {
        "type": "switch",
        "available": true
      }
    }
  }
}

Get line items
GET/api/v2/line_items


GET /api/v2/line_items/1
Requestsreturns line_item

GET  /api/v2/line_items/4

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "4",
    "type": "line_items",
    "attributes": {
      "unit_id": 2,
      "position": 1,
      "quantity": "3.0",
      "discount": null,
      "description": "test name",
      "adjustment": false,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "unit_price": 5000,
      "unit_price_default": 6250,
      "unit_price_normalized": 5000,
      "amount": 15000,
      "amount_default": 18750,
      "amount_normalized": 15000
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 378
        }
      },
      "invoice": {
        "data": {
          "type": "invoices",
          "id": "41"
        }
      },
      "service": {
        "data": null
      },
      "expense": {
        "data": null
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "52"
        }
      }
    }
  },
  "included": [
    {
      "id": "41",
      "type": "invoices",
      "attributes": {
        "number": "2016/01",
        "subject": null,
        "invoiced_on": "2020-10-21",
        "sent_on": null,
        "pay_on": "2020-10-31",
        "delivery_on": null,
        "paid_on": null,
        "discount": null,
        "tax1_name": null,
        "tax1_value": null,
        "tax2_name": null,
        "tax2_value": null,
        "deleted_at": null,
        "tag_list": [],
        "note": null,
        "exported_at": null,
        "export_integration_type_id": null,
        "note_interpolated": null,
        "email_key": "bb65f9694b863f9c984b19c23e4233c7",
        "purchase_order_number": null,
        "export_invoice_url": null,
        "company_reference_id": null,
        "created_at": "2020-10-21T01:04:43.909+02:00",
        "exchange_rate": "1.25",
        "exchange_date": "2020-10-21",
        "custom_fields": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "amount": 15000,
        "amount_default": 18750,
        "amount_normalized": 15000,
        "amount_tax": 0,
        "amount_tax_default": 0,
        "amount_tax_normalized": 0,
        "amount_with_tax": 15000,
        "amount_with_tax_default": 18750,
        "amount_with_tax_normalized": 15000,
        "amount_paid": 0,
        "amount_paid_default": 0,
        "amount_paid_normalized": 0,
        "amount_written_off": 0,
        "amount_written_off_default": 0,
        "amount_written_off_normalized": 0,
        "amount_unpaid": 15000,
        "amount_unpaid_default": 18750,
        "amount_unpaid_normalized": 15000
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 378
          }
        },
        "bill_to": {
          "data": null
        },
        "bill_from": {
          "data": null
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1190"
          }
        },
        "document_type": {
          "data": null
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "856"
          }
        },
        "invoice_attributions": {
          "data": []
        },
        "attachment": {
          "data": null
        }
      }
    },
    {
      "id": "52",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "category_id": null,
        "archived_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 378
          }
        }
      }
    },
    {
      "id": "1190",
      "type": "companies",
      "attributes": {
        "name": "Client813",
        "billing_name": null,
        "vat": null,
        "default_currency": null,
        "created_at": "2020-10-21T01:04:43.903+02:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "custom_fields": null,
        "description": null,
        "due_days": null,
        "tag_list": [],
        "contact": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 378
          }
        },
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "856",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user841@email.com",
        "title": null,
        "joined_at": "2020-10-21T01:04:43.000+02:00",
        "last_seen_at": "2020-10-21T01:04:43.936+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "virtual": false,
        "custom_fields": null,
        "autotracking": false,
        "created_at": "2020-10-21T01:04:43.888+02:00",
        "placeholder": false,
        "color_id": null,
        "private_custom_reports_used": 0
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 378
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1189"
          }
        },
        "subsidiary": {
          "data": null
        }
      }
    },
    {
      "id": "1189",
      "type": "companies",
      "attributes": {
        "name": "Organization378",
        "billing_name": null,
        "vat": null,
        "default_currency": "USD",
        "created_at": "2020-10-21T01:04:43.887+02:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "custom_fields": null,
        "description": null,
        "due_days": null,
        "tag_list": [],
        "contact": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 378
          }
        },
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "meta": {
    "organization_features": {
      "custom_fields": {
        "type": "metered",
        "limit": 15,
        "used": 0
      },
      "custom_fields_per_project": {
        "type": "metered",
        "limit": 10,
        "used": 0
      },
      "public_custom_reports": {
        "type": "metered",
        "limit": 30,
        "used": 0
      },
      "private_custom_reports": {
        "type": "metered",
        "limit": 30,
        "used": 0
      },
      "scheduling_placeholders": {
        "type": "metered",
        "limit": 5,
        "used": 0
      },
      "multigrouping": {
        "type": "switch",
        "available": true
      },
      "client_access_to_budgets": {
        "type": "switch",
        "available": true
      },
      "subsidiaries": {
        "type": "switch",
        "available": true
      },
      "time_approvals": {
        "type": "switch",
        "available": true
      },
      "expenses_approvals": {
        "type": "switch",
        "available": true
      },
      "timeoff_approvals": {
        "type": "switch",
        "available": true
      },
      "autotracking": {
        "type": "switch",
        "available": true
      },
      "forecasting": {
        "type": "switch",
        "available": true
      },
      "webhooks": {
        "type": "switch",
        "available": true
      },
      "table_pivoting": {
        "type": "switch",
        "available": true
      },
      "formula_fields": {
        "type": "switch",
        "available": true
      },
      "single_sign_on": {
        "type": "switch",
        "available": true
      },
      "duplicate_tasks": {
        "type": "switch",
        "available": true
      },
      "billable_time_rounding": {
        "type": "switch",
        "available": true
      },
      "payment_sync": {
        "type": "switch",
        "available": true
      },
      "booking_methods": {
        "type": "switch",
        "available": true
      },
      "import_tasks_csv": {
        "type": "switch",
        "available": true
      },
      "reactions": {
        "type": "switch",
        "available": true
      },
      "time_week_view": {
        "type": "switch",
        "available": true
      }
    }
  }
}

Gets a line item
GET/api/v2/line_items/{id}

URI Parameters
HideShow
id
number (required) Example: 1

line item id


POST /api/v2/line_items
Requestscreates line_itemreturns error

POST  /api/v2/line_items

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "line_items",
    "attributes": {
      "unit_id": 2,
      "unit_price": 5000,
      "quantity": 3,
      "description": "test name",
      "service_type_id": 53
    },
    "relationships": {
      "invoice": {
        "data": {
          "type": "invoices",
          "id": "42"
        }
      }
    }
  }
}
Responses201
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "6",
    "type": "line_items",
    "attributes": {
      "unit_id": 2,
      "position": 2,
      "quantity": "3.0",
      "discount": null,
      "description": "test name",
      "adjustment": false,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "unit_price": 5000,
      "unit_price_default": 6250,
      "unit_price_normalized": 5000,
      "amount": 15000,
      "amount_default": 18750,
      "amount_normalized": 15000
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 379
        }
      },
      "invoice": {
        "data": {
          "type": "invoices",
          "id": "42"
        }
      },
      "service": {
        "data": null
      },
      "expense": {
        "data": null
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "53"
        }
      }
    }
  },
  "included": [
    {
      "id": "42",
      "type": "invoices",
      "attributes": {
        "number": "2016/01",
        "subject": null,
        "invoiced_on": "2020-10-21",
        "sent_on": null,
        "pay_on": "2020-10-31",
        "delivery_on": null,
        "paid_on": null,
        "discount": null,
        "tax1_name": null,
        "tax1_value": null,
        "tax2_name": null,
        "tax2_value": null,
        "deleted_at": null,
        "tag_list": [],
        "note": null,
        "exported_at": null,
        "export_integration_type_id": null,
        "note_interpolated": null,
        "email_key": "4d2d5b3b91bce6b7906f5e12d3814302",
        "purchase_order_number": null,
        "export_invoice_url": null,
        "company_reference_id": null,
        "created_at": "2020-10-21T01:04:44.031+02:00",
        "exchange_rate": "1.25",
        "exchange_date": "2020-10-21",
        "custom_fields": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "amount": 30000,
        "amount_default": 37500,
        "amount_normalized": 30000,
        "amount_tax": 0,
        "amount_tax_default": 0,
        "amount_tax_normalized": 0,
        "amount_with_tax": 30000,
        "amount_with_tax_default": 37500,
        "amount_with_tax_normalized": 30000,
        "amount_paid": 0,
        "amount_paid_default": 0,
        "amount_paid_normalized": 0,
        "amount_written_off": 0,
        "amount_written_off_default": 0,
        "amount_written_off_normalized": 0,
        "amount_unpaid": 30000,
        "amount_unpaid_default": 37500,
        "amount_unpaid_normalized": 30000
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 379
          }
        },
        "bill_to": {
          "data": null
        },
        "bill_from": {
          "data": null
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1192"
          }
        },
        "document_type": {
          "data": null
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "857"
          }
        },
        "invoice_attributions": {
          "data": []
        },
        "attachment": {
          "data": null
        }
      }
    },
    {
      "id": "53",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "category_id": null,
        "archived_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 379
          }
        }
      }
    },
    {
      "id": "1192",
      "type": "companies",
      "attributes": {
        "name": "Client814",
        "billing_name": null,
        "vat": null,
        "default_currency": null,
        "created_at": "2020-10-21T01:04:44.025+02:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "custom_fields": null,
        "description": null,
        "due_days": null,
        "tag_list": [],
        "contact": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 379
          }
        },
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "857",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user842@email.com",
        "title": null,
        "joined_at": "2020-10-21T01:04:44.000+02:00",
        "last_seen_at": "2020-10-21T01:04:44.060+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "virtual": false,
        "custom_fields": null,
        "autotracking": false,
        "created_at": "2020-10-21T01:04:44.010+02:00",
        "placeholder": false,
        "color_id": null,
        "private_custom_reports_used": 0
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 379
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1191"
          }
        },
        "subsidiary": {
          "data": null
        }
      }
    },
    {
      "id": "1191",
      "type": "companies",
      "attributes": {
        "name": "Organization379",
        "billing_name": null,
        "vat": null,
        "default_currency": "USD",
        "created_at": "2020-10-21T01:04:44.009+02:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "custom_fields": null,
        "description": null,
        "due_days": null,
        "tag_list": [],
        "contact": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 379
          }
        },
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "meta": {
    "organization_features": {
      "custom_fields": {
        "type": "metered",
        "limit": 15,
        "used": 0
      },
      "custom_fields_per_project": {
        "type": "metered",
        "limit": 10,
        "used": 0
      },
      "public_custom_reports": {
        "type": "metered",
        "limit": 30,
        "used": 0
      },
      "private_custom_reports": {
        "type": "metered",
        "limit": 30,
        "used": 0
      },
      "scheduling_placeholders": {
        "type": "metered",
        "limit": 5,
        "used": 0
      },
      "multigrouping": {
        "type": "switch",
        "available": true
      },
      "client_access_to_budgets": {
        "type": "switch",
        "available": true
      },
      "subsidiaries": {
        "type": "switch",
        "available": true
      },
      "time_approvals": {
        "type": "switch",
        "available": true
      },
      "expenses_approvals": {
        "type": "switch",
        "available": true
      },
      "timeoff_approvals": {
        "type": "switch",
        "available": true
      },
      "autotracking": {
        "type": "switch",
        "available": true
      },
      "forecasting": {
        "type": "switch",
        "available": true
      },
      "webhooks": {
        "type": "switch",
        "available": true
      },
      "table_pivoting": {
        "type": "switch",
        "available": true
      },
      "formula_fields": {
        "type": "switch",
        "available": true
      },
      "single_sign_on": {
        "type": "switch",
        "available": true
      },
      "duplicate_tasks": {
        "type": "switch",
        "available": true
      },
      "billable_time_rounding": {
        "type": "switch",
        "available": true
      },
      "payment_sync": {
        "type": "switch",
        "available": true
      },
      "booking_methods": {
        "type": "switch",
        "available": true
      },
      "import_tasks_csv": {
        "type": "switch",
        "available": true
      },
      "reactions": {
        "type": "switch",
        "available": true
      },
      "time_week_view": {
        "type": "switch",
        "available": true
      }
    }
  }
}

POST  /api/v2/line_items

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "line_items",
    "attributes": {
      "unit_id": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/invoice"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/unit"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/unit_price"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/quantity"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "is not a number",
      "source": {
        "pointer": "data/attributes/quantity"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/description"
      }
    }
  ]
}

Create a line item
POST/api/v2/line_items

URI Parameters
HideShow
invoice_id
number (required) Example: 1

invoice id

unit_id
number (required) Example: 1

unit id

unit_price
number (required) Example: 100

unit price

quantity
number (required) Example: 10

quantity

description
string (required) Example: Description

description


PATCH /api/v2/line_items/1
Requestsupdates line_itemreturns error

PATCH  /api/v2/line_items/9

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "line_items",
    "attributes": {
      "quantity": 6
    }
  }
}
Responses200
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "data": {
    "id": "9",
    "type": "line_items",
    "attributes": {
      "unit_id": 2,
      "position": 1,
      "quantity": "6.0",
      "discount": null,
      "description": "test name",
      "adjustment": false,
      "currency": "EUR",
      "currency_default": "USD",
      "currency_normalized": "EUR",
      "unit_price": 5000,
      "unit_price_default": 6250,
      "unit_price_normalized": 5000,
      "amount": 30000,
      "amount_default": 37500,
      "amount_normalized": 30000
    },
    "relationships": {
      "organization": {
        "data": {
          "type": "organizations",
          "id": 382
        }
      },
      "invoice": {
        "data": {
          "type": "invoices",
          "id": "45"
        }
      },
      "service": {
        "data": null
      },
      "expense": {
        "data": null
      },
      "service_type": {
        "data": {
          "type": "service_types",
          "id": "56"
        }
      }
    }
  },
  "included": [
    {
      "id": "45",
      "type": "invoices",
      "attributes": {
        "number": "2016/01",
        "subject": null,
        "invoiced_on": "2020-10-21",
        "sent_on": null,
        "pay_on": "2020-10-31",
        "delivery_on": null,
        "paid_on": null,
        "discount": null,
        "tax1_name": null,
        "tax1_value": null,
        "tax2_name": null,
        "tax2_value": null,
        "deleted_at": null,
        "tag_list": [],
        "note": null,
        "exported_at": null,
        "export_integration_type_id": null,
        "note_interpolated": null,
        "email_key": "3d103b670fe35ec3296ec37258d9a631",
        "purchase_order_number": null,
        "export_invoice_url": null,
        "company_reference_id": null,
        "created_at": "2020-10-21T01:04:44.354+02:00",
        "exchange_rate": "1.25",
        "exchange_date": "2020-10-21",
        "custom_fields": null,
        "currency": "EUR",
        "currency_default": "USD",
        "currency_normalized": "EUR",
        "amount": 30000,
        "amount_default": 37500,
        "amount_normalized": 30000,
        "amount_tax": 0,
        "amount_tax_default": 0,
        "amount_tax_normalized": 0,
        "amount_with_tax": 30000,
        "amount_with_tax_default": 37500,
        "amount_with_tax_normalized": 30000,
        "amount_paid": 0,
        "amount_paid_default": 0,
        "amount_paid_normalized": 0,
        "amount_written_off": 0,
        "amount_written_off_default": 0,
        "amount_written_off_normalized": 0,
        "amount_unpaid": 30000,
        "amount_unpaid_default": 37500,
        "amount_unpaid_normalized": 30000
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 382
          }
        },
        "bill_to": {
          "data": null
        },
        "bill_from": {
          "data": null
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1198"
          }
        },
        "document_type": {
          "data": null
        },
        "creator": {
          "data": {
            "type": "people",
            "id": "860"
          }
        },
        "invoice_attributions": {
          "data": []
        },
        "attachment": {
          "data": null
        }
      }
    },
    {
      "id": "56",
      "type": "service_types",
      "attributes": {
        "name": "test name",
        "category_id": null,
        "archived_at": null
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 382
          }
        }
      }
    },
    {
      "id": "1198",
      "type": "companies",
      "attributes": {
        "name": "Client817",
        "billing_name": null,
        "vat": null,
        "default_currency": null,
        "created_at": "2020-10-21T01:04:44.348+02:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "custom_fields": null,
        "description": null,
        "due_days": null,
        "tag_list": [],
        "contact": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 382
          }
        },
        "bill_to": {
          "data": null
        }
      }
    },
    {
      "id": "860",
      "type": "people",
      "attributes": {
        "first_name": "test first name",
        "last_name": "test last name",
        "email": "user845@email.com",
        "title": null,
        "joined_at": "2020-10-21T01:04:44.000+02:00",
        "last_seen_at": "2020-10-21T01:04:44.383+02:00",
        "deactivated_at": null,
        "archived_at": null,
        "role_id": 1,
        "invited_at": null,
        "is_user": true,
        "tag_list": [],
        "avatar_url": null,
        "virtual": false,
        "custom_fields": null,
        "autotracking": false,
        "created_at": "2020-10-21T01:04:44.333+02:00",
        "placeholder": false,
        "color_id": null,
        "private_custom_reports_used": 0
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 382
          }
        },
        "company": {
          "data": {
            "type": "companies",
            "id": "1197"
          }
        },
        "subsidiary": {
          "data": null
        }
      }
    },
    {
      "id": "1197",
      "type": "companies",
      "attributes": {
        "name": "Organization382",
        "billing_name": null,
        "vat": null,
        "default_currency": "USD",
        "created_at": "2020-10-21T01:04:44.332+02:00",
        "archived_at": null,
        "avatar_url": null,
        "invoice_email_recipients": {},
        "custom_fields": null,
        "description": null,
        "due_days": null,
        "tag_list": [],
        "contact": {}
      },
      "relationships": {
        "organization": {
          "data": {
            "type": "organizations",
            "id": 382
          }
        },
        "bill_to": {
          "data": null
        }
      }
    }
  ],
  "meta": {
    "organization_features": {
      "custom_fields": {
        "type": "metered",
        "limit": 15,
        "used": 0
      },
      "custom_fields_per_project": {
        "type": "metered",
        "limit": 10,
        "used": 0
      },
      "public_custom_reports": {
        "type": "metered",
        "limit": 30,
        "used": 0
      },
      "private_custom_reports": {
        "type": "metered",
        "limit": 30,
        "used": 0
      },
      "scheduling_placeholders": {
        "type": "metered",
        "limit": 5,
        "used": 0
      },
      "multigrouping": {
        "type": "switch",
        "available": true
      },
      "client_access_to_budgets": {
        "type": "switch",
        "available": true
      },
      "subsidiaries": {
        "type": "switch",
        "available": true
      },
      "time_approvals": {
        "type": "switch",
        "available": true
      },
      "expenses_approvals": {
        "type": "switch",
        "available": true
      },
      "timeoff_approvals": {
        "type": "switch",
        "available": true
      },
      "autotracking": {
        "type": "switch",
        "available": true
      },
      "forecasting": {
        "type": "switch",
        "available": true
      },
      "webhooks": {
        "type": "switch",
        "available": true
      },
      "table_pivoting": {
        "type": "switch",
        "available": true
      },
      "formula_fields": {
        "type": "switch",
        "available": true
      },
      "single_sign_on": {
        "type": "switch",
        "available": true
      },
      "duplicate_tasks": {
        "type": "switch",
        "available": true
      },
      "billable_time_rounding": {
        "type": "switch",
        "available": true
      },
      "payment_sync": {
        "type": "switch",
        "available": true
      },
      "booking_methods": {
        "type": "switch",
        "available": true
      },
      "import_tasks_csv": {
        "type": "switch",
        "available": true
      },
      "reactions": {
        "type": "switch",
        "available": true
      },
      "time_week_view": {
        "type": "switch",
        "available": true
      }
    }
  }
}

PATCH  /api/v2/line_items/10

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Body
{
  "data": {
    "type": "line_items",
    "attributes": {
      "quantity": ""
    }
  }
}
Responses422
Headers
Content-Type: application/vnd.api+json; charset=utf-8
Body
{
  "errors": [
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "can't be blank",
      "source": {
        "pointer": "data/attributes/quantity"
      }
    },
    {
      "status": "422",
      "code": "invalid_attribute",
      "title": "Invalid Attribute",
      "detail": "is not a number",
      "source": {
        "pointer": "data/attributes/quantity"
      }
    }
  ]
}

Update a line item
PATCH/api/v2/line_items/{id}

URI Parameters
HideShow
id
number (required) Example: 1

line item id


DELETE /api/v2/line_items/1
Requestsarchives line item

DELETE  /api/v2/line_items/15

Headers
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: application/vnd.api+json
Responses204
This response has no content.

Deletes a line item
DELETE/api/v2/line_items/{id}

URI Parameters
HideShow
id
number (required) Example: 1

line item id


Generated by aglio on 20 Oct 2020