Skip to content

Finance Payout Specification Example

This example shows how to retrieve finance payout specifications with specific query parameters for pagination and data projection.

The finance payout specifications provide detailed financial transaction data including capital amounts, interest charges, creditor commissions, and VAT calculations. Each specification represents a financial entry that contributes to the overall payout calculation for creditors, showing the breakdown of collected funds by category (capital, interest, reminder fees) and their current processing state.

All API requests require a valid authentication token in the X-API-Key header. For details about the authentication process and token management, see the Authentication documentation.

In this guide, we will use the AuthTokenProvider class (documented in the authentication guide) to handle token management.

Get Finance Payout Specifications

Retrieve finance payout specifications using the Finance Payout Specification endpoint with Pagination and Queries:

typescript
const token = await auth.getValidToken()

const query = encodeURIComponent(JSON.stringify({}))
const projection = encodeURIComponent(
  JSON.stringify({
    booking_date: 1,
    article: 1,
    state: 1,
    total_amount: 1,
    amount: 1,
    vat_amount: 1,
    finance_category: 1,
    payout_reference: 1,
    reference_number: 1,
    invoice_number: 1,
  })
)

const response = await axios.get(
  `https://api-sandbox.amili.se/finance--payout-specifications?page=1&max_results=20&sort=-_created&projection=${projection}&where=${query}`,
  {
    headers: {
      'X-API-Key': token,
    },
  }
)
python
import json

token = auth.get_valid_token()

query = json.dumps({})
projection = json.dumps({
  "booking_date": 1,
  "article": 1,
  "state": 1,
  "total_amount": 1,
  "amount": 1,
  "vat_amount": 1,
  "finance_category": 1,
  "payout_reference": 1,
  "reference_number": 1,
  "invoice_number": 1
})

response = requests.get(
  'https://api-sandbox.amili.se/finance--payout-specifications',
  params={
    'page': 1,
    'max_results': 20,
    'sort': '-_created',
    'projection': projection,
    'where': query
  },
  headers={'X-API-Key': token}
)
response.raise_for_status()
result = response.json()

The response will be:

json
{
  "_items": [
    {
      "_id": "507f1f77bcf86cd799439011",
      "amount": 60.0,
      "vat_amount": 15.0,
      "total_amount": 75.0,
      "article": "reminder",
      "state": "reminder",
      "booking_date": "Wed, 11 Jun 2025 00:00:00 GMT",
      "finance_category": "creditor_commission",
      "_updated": "Wed, 11 Jun 2025 14:00:18 GMT",
      "_created": "Wed, 11 Jun 2025 14:00:18 GMT",
      "_etag": "a1b2c3d4e5f678901234567890123456",
      "invoice_number": "INV-2025-020",
      "reference_number": "25020"
    },
    {
      "_id": "507f1f77bcf86cd799439012",
      "amount": 1064,
      "vat_amount": 0.0,
      "total_amount": 1064.0,
      "article": "capital",
      "state": "reminder",
      "booking_date": "Wed, 11 Jun 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Wed, 11 Jun 2025 14:00:18 GMT",
      "_created": "Wed, 11 Jun 2025 14:00:17 GMT",
      "_etag": "b2c3d4e5f67890123456789012345678",
      "invoice_number": "INV-2025-020",
      "reference_number": "25020"
    },
    {
      "_id": "507f1f77bcf86cd799439013",
      "amount": 10000,
      "vat_amount": 0.0,
      "total_amount": 10000.0,
      "article": "capital",
      "state": "reminder",
      "booking_date": "Thu, 05 Jun 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Thu, 05 Jun 2025 11:30:14 GMT",
      "_created": "Thu, 05 Jun 2025 11:30:14 GMT",
      "_etag": "c3d4e5f6789012345678901234567890",
      "invoice_number": "INV-2025-019",
      "reference_number": "25019"
    },
    {
      "_id": "507f1f77bcf86cd799439014",
      "amount": 3209,
      "vat_amount": 0.0,
      "total_amount": 3209.0,
      "article": "interest",
      "state": "reminder",
      "booking_date": "Thu, 05 Jun 2025 00:00:00 GMT",
      "finance_category": "interest",
      "_updated": "Thu, 05 Jun 2025 11:30:14 GMT",
      "_created": "Thu, 05 Jun 2025 11:30:14 GMT",
      "_etag": "d4e5f6789012345678901234567890ab",
      "invoice_number": "INV-2025-018",
      "reference_number": "25018"
    },
    {
      "_id": "507f1f77bcf86cd799439015",
      "amount": 12000,
      "vat_amount": 0.0,
      "total_amount": 12000.0,
      "article": "capital",
      "state": "reminder",
      "booking_date": "Thu, 05 Jun 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Thu, 05 Jun 2025 11:30:14 GMT",
      "_created": "Thu, 05 Jun 2025 11:30:14 GMT",
      "_etag": "e5f6789012345678901234567890abcd",
      "invoice_number": "INV-2025-018",
      "reference_number": "25018"
    },
    {
      "_id": "507f1f77bcf86cd799439016",
      "amount": 3014,
      "vat_amount": 0.0,
      "total_amount": 3014.0,
      "article": "interest",
      "state": "reminder",
      "booking_date": "Tue, 03 Jun 2025 00:00:00 GMT",
      "finance_category": "interest",
      "_updated": "Tue, 03 Jun 2025 11:13:15 GMT",
      "_created": "Tue, 03 Jun 2025 11:13:15 GMT",
      "_etag": "f6789012345678901234567890abcdef",
      "invoice_number": "INV-2025-017",
      "reference_number": "25017"
    },
    {
      "_id": "507f1f77bcf86cd799439017",
      "amount": 3700,
      "vat_amount": 0.0,
      "total_amount": 3700.0,
      "article": "capital",
      "state": "reminder",
      "booking_date": "Tue, 03 Jun 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Tue, 03 Jun 2025 11:13:15 GMT",
      "_created": "Tue, 03 Jun 2025 11:13:15 GMT",
      "_etag": "789012345678901234567890abcdef12",
      "invoice_number": "INV-2025-017",
      "reference_number": "25017"
    },
    {
      "_id": "507f1f77bcf86cd799439018",
      "amount": 1000,
      "vat_amount": 0.0,
      "total_amount": 1000.0,
      "article": "capital",
      "state": "reminder",
      "booking_date": "Tue, 03 Jun 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Tue, 03 Jun 2025 06:17:12 GMT",
      "_created": "Tue, 03 Jun 2025 06:17:12 GMT",
      "_etag": "89012345678901234567890abcdef1234",
      "invoice_number": "INV-2025-016",
      "reference_number": "25016"
    },
    {
      "_id": "507f1f77bcf86cd799439019",
      "amount": 20,
      "vat_amount": 0.0,
      "total_amount": 20.0,
      "article": "capital",
      "state": "initializing",
      "booking_date": "Fri, 09 May 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Fri, 09 May 2025 13:03:19 GMT",
      "_created": "Fri, 09 May 2025 13:03:19 GMT",
      "_etag": "9012345678901234567890abcdef1234",
      "invoice_number": "INV-2025-015",
      "reference_number": "25015"
    },
    {
      "_id": "507f1f77bcf86cd799439020",
      "amount": 70,
      "vat_amount": 0.0,
      "total_amount": 70.0,
      "article": "capital",
      "state": "initializing",
      "booking_date": "Fri, 09 May 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Fri, 09 May 2025 13:03:18 GMT",
      "_created": "Fri, 09 May 2025 13:03:18 GMT",
      "_etag": "012345678901234567890abcdef1234",
      "invoice_number": "INV-2025-014",
      "reference_number": "25014"
    },
    {
      "_id": "507f1f77bcf86cd799439021",
      "amount": 25,
      "vat_amount": 0.0,
      "total_amount": 25.0,
      "article": "capital",
      "state": "initializing",
      "booking_date": "Fri, 09 May 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Fri, 09 May 2025 13:03:18 GMT",
      "_created": "Fri, 09 May 2025 13:03:18 GMT",
      "_etag": "123456789012345678901234567890ab",
      "invoice_number": "INV-2025-013",
      "reference_number": "25013"
    },
    {
      "_id": "507f1f77bcf86cd799439022",
      "amount": 50,
      "vat_amount": 0.0,
      "total_amount": 50.0,
      "article": "capital",
      "state": "initializing",
      "booking_date": "Fri, 09 May 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Fri, 09 May 2025 13:03:18 GMT",
      "_created": "Fri, 09 May 2025 13:03:18 GMT",
      "_etag": "23456789012345678901234567890abc",
      "invoice_number": "INV-2025-012",
      "reference_number": "25012"
    },
    {
      "_id": "507f1f77bcf86cd799439023",
      "amount": 12500,
      "vat_amount": 0.0,
      "total_amount": 12500.0,
      "article": "capital",
      "state": "reminder",
      "booking_date": "Tue, 29 Apr 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Tue, 29 Apr 2025 06:40:15 GMT",
      "_created": "Tue, 29 Apr 2025 06:40:15 GMT",
      "_etag": "3456789012345678901234567890abcd",
      "invoice_number": "INV-2025-011",
      "reference_number": "25011"
    },
    {
      "_id": "507f1f77bcf86cd799439024",
      "amount": 6250,
      "vat_amount": 0.0,
      "total_amount": 6250.0,
      "article": "capital",
      "state": "reminder",
      "booking_date": "Mon, 28 Apr 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Mon, 28 Apr 2025 19:00:16 GMT",
      "_created": "Mon, 28 Apr 2025 19:00:16 GMT",
      "_etag": "456789012345678901234567890abcdef",
      "invoice_number": "INV-2025-010",
      "reference_number": "25010"
    },
    {
      "_id": "507f1f77bcf86cd799439025",
      "amount": 112.0,
      "vat_amount": 0.0,
      "total_amount": 112.0,
      "article": "interest",
      "state": "reminder",
      "booking_date": "Mon, 28 Apr 2025 00:00:00 GMT",
      "finance_category": "interest",
      "_updated": "Mon, 28 Apr 2025 15:40:17 GMT",
      "_created": "Mon, 28 Apr 2025 15:40:17 GMT",
      "_etag": "56789012345678901234567890abcdef",
      "invoice_number": "INV-2025-009",
      "reference_number": "25009"
    },
    {
      "_id": "507f1f77bcf86cd799439026",
      "amount": 60.0,
      "vat_amount": 15.0,
      "total_amount": 75.0,
      "article": "reminder",
      "state": "reminder",
      "booking_date": "Mon, 28 Apr 2025 00:00:00 GMT",
      "finance_category": "creditor_commission",
      "_updated": "Mon, 28 Apr 2025 15:40:17 GMT",
      "_created": "Mon, 28 Apr 2025 15:40:17 GMT",
      "_etag": "6789012345678901234567890abcdef1",
      "invoice_number": "INV-2025-009",
      "reference_number": "25009"
    },
    {
      "_id": "507f1f77bcf86cd799439027",
      "amount": 1875.0,
      "vat_amount": 0.0,
      "total_amount": 1875.0,
      "article": "capital",
      "state": "reminder",
      "booking_date": "Mon, 28 Apr 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Mon, 28 Apr 2025 15:40:17 GMT",
      "_created": "Mon, 28 Apr 2025 15:40:17 GMT",
      "_etag": "789012345678901234567890abcdef12",
      "invoice_number": "INV-2025-009",
      "reference_number": "25009"
    },
    {
      "_id": "507f1f77bcf86cd799439028",
      "amount": 500,
      "vat_amount": 0.0,
      "total_amount": 500.0,
      "article": "capital",
      "state": "initializing",
      "booking_date": "Thu, 24 Apr 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Thu, 24 Apr 2025 08:40:18 GMT",
      "_created": "Thu, 24 Apr 2025 08:40:18 GMT",
      "_etag": "89012345678901234567890abcdef12",
      "invoice_number": "INV-2025-008",
      "reference_number": "25008"
    },
    {
      "_id": "507f1f77bcf86cd799439029",
      "amount": 5000,
      "vat_amount": 0.0,
      "total_amount": 5000.0,
      "article": "capital",
      "state": "initializing",
      "booking_date": "Thu, 24 Apr 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Thu, 24 Apr 2025 08:00:19 GMT",
      "_created": "Thu, 24 Apr 2025 08:00:19 GMT",
      "_etag": "9012345678901234567890abcdef12",
      "invoice_number": "INV-2025-008",
      "reference_number": "25008"
    },
    {
      "_id": "507f1f77bcf86cd799439030",
      "amount": 1064,
      "vat_amount": 0.0,
      "total_amount": 1064.0,
      "article": "capital",
      "state": "initializing",
      "booking_date": "Thu, 24 Apr 2025 00:00:00 GMT",
      "finance_category": "capital",
      "_updated": "Thu, 24 Apr 2025 07:50:16 GMT",
      "_created": "Thu, 24 Apr 2025 07:50:16 GMT",
      "_etag": "012345678901234567890abcdef1234",
      "invoice_number": "INV-2025-008",
      "reference_number": "25008"
    }
  ],
  "_meta": {
    "page": 1,
    "max_results": 20,
    "total": 162
  }
}