BillingBilling API

Overview

The Wumex Billing API is a RESTful JSON API that allows you to send invoices digitally to your customers. Recipients receive invoices directly in the Wumex app — with push notifications, automatic categorization, and real-time payment status.

The API is designed for businesses, accounting systems, ERP providers, and developers who want to integrate invoicing into their applications.

Key features:

  • Send invoices via API to email addresses or Wumex IDs
  • Real-time status tracking (delivered, viewed, paid)
  • Webhook notifications for all status changes
  • Swiss QR invoice support (QR reference, IBAN)
  • Batch processing and attachments

Authentication

All API requests must be authenticated with an API key. Send your key in the X-API-Key header with every request.

You can obtain your API key after registering at Wumex Billing.

Example:

# Replace YOUR_API_KEY with your actual key
curl https://npylglrnvsxkwvynridg.supabase.co/functions/v1/billing-api/invoices \
  -H "X-API-Key: YOUR_API_KEY"

Base URL

All API endpoints use the following base URL:

https://npylglrnvsxkwvynridg.supabase.co/functions/v1/billing-api

All requests must be made over HTTPS. HTTP requests will be rejected.


GET

Merchant Profile

GET /billing-api/merchants/me

Returns the profile of the currently authenticated merchant, including plan information and API key prefix.

Example Response

{
  "id": "merch_9xK2mP4",
  "company_name": "Muster AG",
  "email": "billing@muster.ch",
  "api_key_prefix": "wmx_live_7kH3...",
  "plan": "pro",
  "created_at": "2025-11-15T08:00:00Z"
}

POST

Create Invoice

POST /billing-api/invoices

Creates a new invoice and delivers it to the recipient.

Request Body

FieldTypeRequiredDescription
external_referencestringYesUnique reference number
recipient_emailstringYesCustomer email address
recipient_namestringNoRecipient name (for matching)
recipient_wumex_idstringNoDirect Wumex user ID
amountnumberYesInvoice amount
currencystringNoCurrency (default: CHF)
due_datestringYesDue date in ISO 8601 format
issued_datestringNoIssue date in ISO 8601 format
category_hintstringNoe.g. insurance, medical, rent
payment_ibanstringNoIBAN for bank transfer
payment_qr_referencestringNoSwiss QR reference
payment_payable_tostringNoPayee name
line_itemsarrayNoLine items [{description, amount}]
attachmentsarrayNoAttachments [{filename, content_type, url}]
metadataobjectNoFree JSON object for custom data

Example Request

// Create invoice
POST /billing-api/invoices
{
  "external_reference": "INV-2026-001",
  "recipient_email": "kunde@example.ch",
  "recipient_name": "Max Muster",
  "amount": 250.00,
  "currency": "CHF",
  "due_date": "2026-04-01",
  "issued_date": "2026-03-01",
  "category_hint": "insurance",
  "payment_iban": "CH93 0076 2011 6238 5295 7",
  "payment_qr_reference": "210000000003139471430009017",
  "payment_payable_to": "Muster AG",
  "line_items": [
    { "description": "Grundversicherung März 2026", "amount": 200.00 },
    { "description": "Zusatzversicherung", "amount": 50.00 }
  ],
  "attachments": [
    {
      "filename": "rechnung.pdf",
      "content_type": "application/pdf",
      "url": "https://example.ch/invoices/INV-2026-001.pdf"
    }
  ],
  "metadata": {
    "internal_id": "12345",
    "department": "billing"
  }
}

Example Response

// Successful response
{
  "id": "inv_7kH3mN9pQ2",
  "status": "delivered",
  "recipient_matched": true,
  "created_at": "2026-03-01T10:00:00Z"
}

GET

Get Invoice

GET /billing-api/invoices/:id

Retrieves the current status and all details of an invoice.

Example Response

{
  "id": "inv_7kH3mN9pQ2",
  "external_reference": "INV-2026-001",
  "status": "delivered",
  "recipient_email": "kunde@example.ch",
  "recipient_name": "Max Muster",
  "recipient_wumex_id": "usr_4xK9mP2",
  "amount": 250.00,
  "currency": "CHF",
  "due_date": "2026-04-01",
  "issued_date": "2026-03-01",
  "created_at": "2026-03-01T10:00:00Z",
  "delivered_at": "2026-03-01T10:00:12Z",
  "viewed_at": null,
  "paid_at": null
}

GET

List Invoices

GET /billing-api/invoices?status=delivered&limit=50&offset=0&from=2026-01-01

Returns a paginated list of all invoices.

Query Parameters

ParameterTypeDefaultDescription
statusstringFilter by status
limitnumber50Items per page (max 100)
offsetnumber0Offset for pagination
fromstringFrom date (ISO 8601)

Example Response

{
  "data": [
    {
      "id": "inv_7kH3mN9pQ2",
      "external_reference": "INV-2026-001",
      "status": "delivered",
      "amount": 250.00,
      "currency": "CHF",
      "created_at": "2026-03-01T10:00:00Z"
    }
  ],
  "total": 142,
  "limit": 50,
  "offset": 0
}

PATCH

Update Invoice

PATCH /billing-api/invoices/:id

Updates an existing invoice. You can change the reference, due date, payment info, line items, attachments, and metadata. The amount cannot be changed.

Updatable Fields

FieldTypeDescription
external_referencestringNew reference number
due_datestringNew due date
payment_ibanstringIBAN for bank transfer
payment_qr_referencestringSwiss QR reference
payment_payable_tostringPayee name
category_hintstringCategory hint (e.g. insurance, medical, rent)
line_itemsarrayUpdated line items [{description, amount}]
attachmentsarrayUpdated attachments [{filename, content_type, url}]
metadataobjectUpdated metadata object

Example

PATCH /billing-api/invoices/inv_7kH3mN9pQ2
{
  "due_date": "2026-05-01",
  "payment_iban": "CH93 0076 2011 6238 5295 7"
}

DELETE

Cancel Invoice

DELETE /billing-api/invoices/:id

Permanently cancels an invoice. The recipient will be notified about the cancellation.

Example Response

{
  "id": "inv_7kH3mN9pQ2",
  "status": "cancelled",
  "cancelled_at": "2026-03-15T14:30:00Z"
}

POST

Payment Reminder

POST /billing-api/invoices/:id/remind

Sends a payment reminder to the recipient. A maximum of one reminder can be sent every 7 days per invoice.

Limit: Maximum 1 reminder per 7 days per invoice.

Example Response

{
  "id": "inv_7kH3mN9pQ2",
  "reminder_sent": true,
  "next_reminder_available_at": "2026-03-22T14:30:00Z"
}

Webhooks

Webhooks notify your system in real time about status changes. Configure your webhook URL in the dashboard.

Available Events

EventDescription
invoice.deliveredInvoice was delivered to the recipient
invoice.viewedInvoice was viewed by the recipient
invoice.paidInvoice was paid
invoice.disputedInvoice was disputed by the recipient
recipient.registeredRecipient registered with Wumex

HMAC-SHA256 Verification

Verify incoming webhooks with HMAC-SHA256 to ensure they originate from Wumex:

// Verify webhook signature
const crypto = require('crypto');

function verifyWebhook(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');

  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

// Express.js example
app.post('/webhooks/wumex', (req, res) => {
  const signature = req.headers['x-wumex-signature'];
  const isValid = verifyWebhook(
    JSON.stringify(req.body),
    signature,
    process.env.WUMEX_WEBHOOK_SECRET
  );

  if (!isValid) {
    return res.status(401).send('Invalid signature');
  }

  const { event, data } = req.body;
  console.log(`Event: ${event}`, data);

  res.status(200).send('OK');
});

Status Values

Each invoice goes through different status values:

StatusDescription
pending_matchRecipient is being matched / delivery pending
deliveredInvoice was successfully delivered
viewedInvoice was viewed by the recipient
paidInvoice was paid
disputedInvoice was disputed by the recipient
cancelledInvoice was cancelled
expiredInvoice has expired (past due date)

Error Handling

The API uses standard HTTP status codes. On errors, a JSON object with an error string is returned.

Error Format

{
  "error": "The field 'amount' is required."
}

HTTP Status Codes

CodeDescription
400Bad Request — Missing or invalid parameters
401Unauthorized — API key missing or invalid
403Forbidden — No permission for this action
404Not Found — Resource does not exist
429Rate Limit Exceeded — Too many requests
500Server Error — Internal error, please retry

Rate Limits

API requests are limited per plan. When exceeded, you will receive a 429 status code.

PlanLimit
Free60 requests / minute
Pro120 requests / minute
Business300 requests / minute
EnterpriseCustom

Rate limit information is returned in the response headers:

X-RateLimit-Limit: 120       // Maximum requests per minute
X-RateLimit-Remaining: 98   // Remaining requests in the current window
X-RateLimit-Reset: 1709312400 // Unix timestamp of the next reset

Code Examples

Complete examples for creating an invoice in different programming languages.

curl -X POST https://npylglrnvsxkwvynridg.supabase.co/functions/v1/billing-api/invoices \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "external_reference": "INV-2026-001",
    "recipient_email": "kunde@example.ch",
    "amount": 150.00,
    "currency": "CHF",
    "due_date": "2026-04-01",
    "line_items": [
      { "description": "Beratung März 2026", "amount": 150.00 }
    ]
  }'

Settings

Cookie settings of Sidora AG

This website uses cookies and similar technologies. Essential cookies ensure the basic functionality of the website. Additional cookies are only set with your explicit consent and are used for analysis and to improve our services. You can adjust or withdraw your selection at any time.
These cookies are required for the basic functions of the website.
mehr
These cookies enable enhanced functionality and personalization.
mehr
These cookies help us understand how visitors interact with the website.
mehr
These cookies are used to make advertising more relevant to you.
mehr

Settings

Cookie settings of Sidora AG

This website uses cookies and similar technologies. Essential cookies ensure the basic functionality of the website. Additional cookies are only set with your explicit consent and are used for analysis and to improve our services. You can adjust or withdraw your selection at any time.
These cookies are required for the basic functions of the website.
mehr
These cookies enable enhanced functionality and personalization.
mehr
These cookies help us understand how visitors interact with the website.
mehr
These cookies are used to make advertising more relevant to you.
mehr