> For the complete documentation index, see [llms.txt](https://docs.plock.io/plock-overview/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plock.io/plock-overview/use-cases/for-developers/api/endpoints/invoices.md).

# Invoices

Invoices

## GET /api/c1/invoices

> Get all invoices

```json
{"openapi":"3.1.0","info":{"title":"Plock external API","version":"0.2.1"},"tags":[{"name":"Invoices","description":"Invoices"}],"servers":[{"url":"https://api.plock.io","description":"Production"},{"url":"https://test-api.plock.io","description":"Test"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"JsonApiMeta":{"properties":{"page":{"properties":{"currentPage":{"type":"integer"},"from":{"type":"integer"},"lastPage":{"type":"integer"},"perPage":{"type":"integer"},"to":{"type":"integer"},"total":{"type":"integer"}},"type":"object"}},"type":"object"},"JsonApiVersion":{"properties":{"version":{"type":"string"}},"type":"object"},"JsonApiLinks":{"properties":{"first":{"type":"string"},"last":{"type":"string"},"next":{"type":"string"}},"type":"object"},"Invoices":{"properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"properties":{"amount":{"title":"amount","description":"Amount for the invoice","type":"number"},"accountId":{"title":"accountId","description":"Account ID","type":"integer"},"erpId":{"title":"erpId","description":"External ERP ID, for example from Fortnox","type":["string","null"]},"subscriptionId":{"title":"subscriptionId","description":"Subscription ID","type":"integer"},"currency":{"title":"currency","description":"Currency of the invoice","type":"string"},"invoiceType":{"title":"invoiceType","description":"Type of invoice","type":"string"},"periodStart":{"title":"periodStart","description":"Start of the period for the invoice","type":"string","format":"date"},"periodEnd":{"title":"periodEnd","description":"End of the period for the invoice","type":"string","format":"date"},"createdAt":{"title":"createdAt","type":"string","format":"date-time"},"updatedAt":{"title":"updatedAt","type":"string","format":"date-time"},"dueAt":{"title":"dueAt","description":"Invoice due at (from ERP)","type":"string","format":"date-time"},"paymentStatus":{"title":"paymentStatus","description":"Payment status (from ERP)","type":"string"}},"type":"object"},"relationships":{"$ref":"#/components/schemas/InvoicesRelationships"},"links":{"$ref":"#/components/schemas/JsonApiLinksSingle"}},"type":"object"},"InvoicesRelationships":{"properties":{"subscriptions":{"type":"string"},"accounts":{"type":"string"},"invoice-items":{"type":"string"}},"type":"object"},"JsonApiLinksSingle":{"properties":{"self":{"type":"string"}},"type":"object"},"JsonApiErrors":{"properties":{"detail":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"}},"type":"object"}}},"paths":{"/api/c1/invoices":{"get":{"tags":["Invoices"],"summary":"Get all invoices","operationId":"getInvoices","parameters":[{"name":"page","in":"query","description":"Pagination number and size","required":false,"style":"deepObject","explode":true,"schema":{"properties":{"size":{"description":"Number of objects returned per page","type":"integer"},"number":{"description":"Page number","type":"integer"}},"type":"object"}},{"name":"Accept","in":"header","description":"The client must specify an Accept header.","required":true,"schema":{"type":"string","enum":["application/vnd.api+json"]}},{"name":"filter","in":"query","description":"Filter to use","required":false,"style":"deepObject","explode":true,"schema":{"properties":{"parentInvoiceId":{"description":"Get all invoices where parent invoice ID is ..","type":"integer"},"accountId":{"description":"Get all invoices where the account ID is ..","type":"integer"},"subscriptionId":{"description":"Get all invoices where the subscription ID is ..","type":"integer"}},"type":"object"}}],"responses":{"200":{"description":"OK","content":{"application/vnd.api+json":{"schema":{"properties":{"meta":{"$ref":"#/components/schemas/JsonApiMeta"},"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"links":{"$ref":"#/components/schemas/JsonApiLinks"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoices"}}},"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/JsonApiErrors"}}},"type":"object"}}}}}}}}}
```

## GET /api/c1/invoices/{invoiceId}

> Get specific invoice

```json
{"openapi":"3.1.0","info":{"title":"Plock external API","version":"0.2.1"},"tags":[{"name":"Invoices","description":"Invoices"}],"servers":[{"url":"https://api.plock.io","description":"Production"},{"url":"https://test-api.plock.io","description":"Test"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"JsonApiVersion":{"properties":{"version":{"type":"string"}},"type":"object"},"JsonApiLinksSingle":{"properties":{"self":{"type":"string"}},"type":"object"},"Invoices":{"properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"properties":{"amount":{"title":"amount","description":"Amount for the invoice","type":"number"},"accountId":{"title":"accountId","description":"Account ID","type":"integer"},"erpId":{"title":"erpId","description":"External ERP ID, for example from Fortnox","type":["string","null"]},"subscriptionId":{"title":"subscriptionId","description":"Subscription ID","type":"integer"},"currency":{"title":"currency","description":"Currency of the invoice","type":"string"},"invoiceType":{"title":"invoiceType","description":"Type of invoice","type":"string"},"periodStart":{"title":"periodStart","description":"Start of the period for the invoice","type":"string","format":"date"},"periodEnd":{"title":"periodEnd","description":"End of the period for the invoice","type":"string","format":"date"},"createdAt":{"title":"createdAt","type":"string","format":"date-time"},"updatedAt":{"title":"updatedAt","type":"string","format":"date-time"},"dueAt":{"title":"dueAt","description":"Invoice due at (from ERP)","type":"string","format":"date-time"},"paymentStatus":{"title":"paymentStatus","description":"Payment status (from ERP)","type":"string"}},"type":"object"},"relationships":{"$ref":"#/components/schemas/InvoicesRelationships"},"links":{"$ref":"#/components/schemas/JsonApiLinksSingle"}},"type":"object"},"InvoicesRelationships":{"properties":{"subscriptions":{"type":"string"},"accounts":{"type":"string"},"invoice-items":{"type":"string"}},"type":"object"},"JsonApiErrors":{"properties":{"detail":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"}},"type":"object"}}},"paths":{"/api/c1/invoices/{invoiceId}":{"get":{"tags":["Invoices"],"summary":"Get specific invoice","operationId":"getInvoiceById","parameters":[{"name":"invoiceId","in":"path","description":"Plock invoice ID","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","description":"Pagination number and size","required":false,"style":"deepObject","explode":true,"schema":{"properties":{"size":{"description":"Number of objects returned per page","type":"integer"},"number":{"description":"Page number","type":"integer"}},"type":"object"}},{"name":"Accept","in":"header","description":"The client must specify an Accept header.","required":true,"schema":{"type":"string","enum":["application/vnd.api+json"]}}],"responses":{"200":{"description":"OK","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"links":{"$ref":"#/components/schemas/JsonApiLinksSingle"},"data":{"$ref":"#/components/schemas/Invoices"}},"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/JsonApiErrors"}}},"type":"object"}}}},"404":{"description":"Not found","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/JsonApiErrors"}}},"type":"object"}}}}}}}}}
```

## GET /api/c1/invoices/{invoiceId}/invoice-items

> Get items for a specific invoice

```json
{"openapi":"3.1.0","info":{"title":"Plock external API","version":"0.2.1"},"tags":[{"name":"Invoices","description":"Invoices"}],"servers":[{"url":"https://api.plock.io","description":"Production"},{"url":"https://test-api.plock.io","description":"Test"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"JsonApiVersion":{"properties":{"version":{"type":"string"}},"type":"object"},"JsonApiLinksSingle":{"properties":{"self":{"type":"string"}},"type":"object"},"InvoiceItems":{"properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"properties":{"unit_amount":{"title":"unit_amount","description":"Price per unit (null for tiered plans)","type":["number","null"]},"quantity":{"title":"quantity","description":"Quantity of units ","type":"number"},"amount":{"title":"amount","description":"Total amount for the line item (excluding any rebate)","type":["number","null"]},"rebate":{"title":"rebate","description":"Total rebate for the line item","type":["number","null"]},"breakdown":{"title":"breakdown","description":"Detailed breakdown of charges","type":["object","null"]},"product_name":{"title":"product_name","description":"Name of the product","type":["string","null"]},"plan_name":{"title":"plan_name","description":"Name of the plan","type":["string","null"]},"description":{"title":"description","description":"Description of the invoice item","type":["string","null"]},"type":{"title":"type","description":"Type of invoice item","type":"string"}},"type":"object"},"relationships":{"$ref":"#/components/schemas/InvoiceItemsRelationships"},"links":{"$ref":"#/components/schemas/JsonApiLinksSingle"}},"type":"object"},"InvoiceItemsRelationships":{"properties":{"invoices":{"type":"string"}},"type":"object"},"JsonApiErrors":{"properties":{"detail":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"}},"type":"object"}}},"paths":{"/api/c1/invoices/{invoiceId}/invoice-items":{"get":{"tags":["Invoices"],"summary":"Get items for a specific invoice","operationId":"getInvoiceItemsByInvoiceId","parameters":[{"name":"invoiceId","in":"path","description":"Plock invoice ID","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","description":"Pagination number and size","required":false,"style":"deepObject","explode":true,"schema":{"properties":{"size":{"description":"Number of objects returned per page","type":"integer"},"number":{"description":"Page number","type":"integer"}},"type":"object"}},{"name":"Accept","in":"header","description":"The client must specify an Accept header.","required":true,"schema":{"type":"string","enum":["application/vnd.api+json"]}}],"responses":{"200":{"description":"OK","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"links":{"$ref":"#/components/schemas/JsonApiLinksSingle"},"data":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItems"}}},"type":"object"}}}},"401":{"description":"Unauthorized","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/JsonApiErrors"}}},"type":"object"}}}},"404":{"description":"Not found","content":{"application/vnd.api+json":{"schema":{"properties":{"jsonapi":{"$ref":"#/components/schemas/JsonApiVersion"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/JsonApiErrors"}}},"type":"object"}}}}}}}}}
```
