Api

Billing & Profile

Manage your billing information, payment methods, and view usage statistics.

Billing & Profile

Manage your billing information, payment methods, and view usage statistics.

Current Billing

GET /profile/billing/current

Get the current month's billing items across all your projects.

Headers

NameTypeDescription
AuthorizationstringBearer token for authentication

Response

200 - Success

[
  {
    "project": "proj_abc123",
    "projectName": "Production Environment",
    "items": [
      {
        "type": "vps",
        "name": "Web Server 01",
        "hours": 720,
        "cost": 49.00
      },
      {
        "type": "vps", 
        "name": "Database Server",
        "hours": 720,
        "cost": 99.00
      }
    ],
    "total": 148.00,
    "hours": 1440
  }
]

Invoice History

GET /profile/billing/invoices

Retrieve your complete invoice history with detailed line items.

Headers

NameTypeDescription
AuthorizationstringBearer token for authentication

Response

200 - Success

[
  {
    "id": "inv_1234567890",
    "paymentStatus": "paid",
    "lastChecked": "2025-01-15T10:30:00Z",
    "created": "2025-01-01T00:00:00Z", 
    "total": 148.00,
    "items": [
      {
        "name": "VPS Basic - Web Server 01",
        "type": "vps",
        "product": "prod_abc123",
        "project": "proj_abc123",
        "projectName": "Production Environment",
        "hours": 720,
        "cost": 49.00,
        "productCost": 49
      }
    ]
  }
]

Payment Methods

Get Payment Method

GET /profile/billing/payment-method

Retrieve your current payment method details.

Headers

NameTypeDescription
AuthorizationstringBearer token for authentication

Response

200 - Success

{
  "agreement": "agr_abc123",
  "facilitator": "mobilepay_recurring",
  "displayName": "John Doe",
  "testMode": false,
  "created": "2025-01-01T00:00:00Z",
  "status": "success"
}

Setup MobilePay

GET /profile/billing/mobilepay

Set up MobilePay as your payment method.

Headers

NameTypeDescription
AuthorizationstringBearer token for authentication

Response

200 - Success

{
  "facilitator": "mobilepay_recurring",
  "url": "https://mobilepay.dk/recurring-setup/..."
}

Setup Nets Payment

GET /profile/billing/nets

Set up Nets card payment as your payment method.

Headers

NameTypeDescription
AuthorizationstringBearer token for authentication

Response

200 - Success

{
  "facilitator": "nets",
  "url": "https://payment.nets.eu/..."
}

Remove Payment Method

DELETE /profile/billing/payment-method

Remove your current payment method.

Headers

NameTypeDescription
AuthorizationstringBearer token for authentication

Response

200 - Success

{
  "success": true
}

Billing Details

Get Billing Details

GET /profile/billing/details

Retrieve your billing contact information.

Headers

NameTypeDescription
AuthorizationstringBearer token for authentication

Response

200 - Success

{
  "name": "John Doe",
  "street": "Example Street 123",
  "zipCode": "1234",
  "city": "Copenhagen",
  "countryKey": "DNK",
  "phone": "+4512345678",
  "email": "john@example.com",
  "isPerson": true
}

Update Billing Details

POST /profile/billing/details

Update your billing contact information.

Headers

NameTypeDescription
AuthorizationstringBearer token for authentication

Request Body

NameTypeDescription
namestringFull name or company name
streetstringStreet address
zipCodestringPostal/ZIP code
citystringCity name
countryKeystringISO 3166-1 alpha-3 country code
phonestringPhone number with country code
emailstringBilling email address
isPersonbooleanWhether this is a personal or business account

Example Request:

{
  "name": "John Doe",
  "street": "Example Street 123",
  "zipCode": "1234", 
  "city": "Copenhagen",
  "countryKey": "DNK",
  "phone": "+4512345678",
  "email": "john@example.com",
  "isPerson": true
}

Response

200 - Success

{
  "success": true
}

Project Billing

Project Hourly Billing

GET /projects/{project}/billing/hourly

Get historical hourly billing for a specific project.

Path Parameters

NameTypeDescription
projectstringUnique project identifier

Headers

NameTypeDescription
AuthorizationstringBearer token for authentication

Response

200 - Success

[
  {
    "created": "2025-01-01T00:00:00Z",
    "year": 2025,
    "month": 1,
    "items": [
      {
        "type": "vps",
        "name": "Web Server 01",
        "hours": 744,
        "cost": 49.0
      }
    ]
  }
]

Current Project Billing

GET /projects/{project}/billing/hourly/current

Get current month's hourly billing for a specific project.

Path Parameters

NameTypeDescription
projectstringUnique project identifier

Headers

NameTypeDescription
AuthorizationstringBearer token for authentication

Response

200 - Success

[
  {
    "productType": "vps",
    "product": "prod_abc123",
    "type": "vps",
    "name": "Web Server 01",
    "hours": 360,
    "cost": 24.5,
    "lastUpdated": "2025-01-15T10:00:00Z",
    "created": "2025-01-15T00:00:00Z"
  }
]