# Top up invoice balance

> For the complete documentation index, see [llms.txt](https://developer.fluxir.com/llms.txt).

**POST** `/api/app/invoice/topup`

Creates and sends a top-up invoice for the specified amount.

## Authorization

- oidc (openIdConnect)

## Header parameters

- `X-Tenant` (string)
  Tenant ID

## Query parameters

- `amount` (integer)
  The top-up amount.

## Responses

### 200

OK

- `id` (integer<int64>)
- `from` (string<date>)
- `to` (string<date>)
- `status` ("PendingReview" | "ApprovedForSending" | "TakenForSending" | "Sent" | "Paid" | "Rejected" | "Failed" | "Cancelled" | "Aborted")
- `comment` (string)
- `tenantId` (string<uuid>)
- `tenantName` (string)
- `tenantTitle` (string)
- `issueDate` (string<date-time>)
- `paymentDate` (string<date-time>)
- `paymentType` ("SendInvoice")
- `hostedInvoiceUrl` (string)
- `items` (object[])
  - `id` (integer<int64>)
  - `serviceApplicationId` (integer<int64>)
  - `travelerFirstName` (string)
  - `travelerLastName` (string)
  - `serviceType` ("Visa" | "Insurance" | "AirportLounge" | "FastTrack" | "Esim" | "FlightItineraryLetter" | "HotelItineraryLetter")
  - `providerName` (string)
  - `priceCode` (string)
  - `description` (string)
  - `fee` (integer<int32>)
  - `dateApplied` (string<date-time>)
- `externalInvoices` (object[])
  - `id` (integer<int64>)
  - `stripeId` (string)
  - `invoiceId` (integer<int64>)
  - `hostedInvoiceUrl` (string)
  - `status` ("Unknown" | "Open" | "Completed" | "Expired")
  - `paymentDate` (string<date-time>)

Example:

```json
{
  "id": 0,
  "from": "2024-01-01",
  "to": "2024-01-01",
  "status": "PendingReview",
  "comment": "string",
  "tenantId": "00000000-0000-0000-0000-000000000000",
  "tenantName": "string",
  "tenantTitle": "string",
  "issueDate": "1970-01-01T00:00:00.000Z",
  "paymentDate": "1970-01-01T00:00:00.000Z",
  "paymentType": "SendInvoice",
  "hostedInvoiceUrl": "string",
  "items": [
    {
      "id": 0,
      "serviceApplicationId": 0,
      "travelerFirstName": "string",
      "travelerLastName": "string",
      "serviceType": "Visa",
      "providerName": "string",
      "priceCode": "string",
      "description": "string",
      "fee": 0,
      "dateApplied": "1970-01-01T00:00:00.000Z"
    }
  ],
  "externalInvoices": [
    {
      "id": 0,
      "stripeId": "string",
      "invoiceId": 0,
      "hostedInvoiceUrl": "string",
      "status": "Unknown",
      "paymentDate": "1970-01-01T00:00:00.000Z"
    }
  ]
}
```

### 400

Bad Request

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 401

Unauthorized

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 403

Forbidden

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 404

Not Found

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 500

Internal Server Error

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 501

Not Implemented

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```