You are viewing a non-production environment — the API surface may differ from production.
Payments API

Invoices

Invoice management, recipients, and location settings

GET
/api/v1/invoice-location-settings

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Query Parameters

locationId*number

Location ID to fetch settings for (required)

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/invoice-location-settings?locationId=0"
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "defaultPaymentTermsDays": 30,    "invoiceNumberPrefix": "string",    "invoiceNumberCounter": 0,    "minInvoiceAmount": 0,    "senderName": "string",    "senderAddressLine1": "string",    "senderAddressLine2": "string",    "senderPostalCode": "string",    "senderCity": "string",    "senderCountry": "string",    "senderEmail": "string",    "senderPhone": "string",    "senderOrganizationNumber": "string",    "senderVatNumber": "string",    "senderLogoUrl": "string",    "bankAccountNumber": "string",    "bankName": "string",    "swiftBic": "string",    "iban": "string",    "paymentReferencePrefix": "string",    "invoiceFooterText": "string",    "invoiceTermsText": "string",    "latePaymentFee": 0,    "latePaymentInterestRate": 0,    "autoGenerateEnabled": true,    "autoSendOnGeneration": true,    "defaultInvoiceSendMode": "manual",    "defaultInvoiceSchedule": {      "scheduleType": "weekly",      "dayOfWeek": 0,      "dayOfMonth": 1,      "intervalDays": 1,      "timeOfDay": "string",      "timezone": "string"    },    "registerPurchasesInCashRegister": true,    "collectionPeriodType": "calendar_month",    "reminderEnabled": true,    "firstReminderDaysAfterDue": 0,    "secondReminderDaysAfterDue": 0,    "thirdReminderDaysAfterDue": 0,    "reminderFeeAmount": 0,    "autoMarkOverdueDays": 0,    "currency": "string",    "overrideParentSettings": true,    "shareInvoiceNumberSeries": true,    "allowChildRecipientCreation": true,    "canCreateRecipients": true,    "requiredRecipientFields": [      "name"    ],    "posReferenceRequirement": "optional",    "sourceLocationId": 0,    "sourceLocationName": "string",    "isInherited": true,    "hasParent": true,    "numberSeriesSourceLocationId": 0,    "numberSeriesSourceLocationName": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
PUT
/api/v1/invoice-location-settings

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

locationId*number

Location ID (required)

defaultPaymentTermsDays?number

Default payment terms in days

invoiceNumberPrefix?|

Prefix for invoice numbers

minInvoiceAmount?number

Minimum amount for invoicing

senderName?|

Sender/company name

senderAddressLine1?|

Sender address line 1

senderAddressLine2?|

Sender address line 2

senderPostalCode?|

Sender postal code

senderCity?|

Sender city

senderCountry?|

Sender country

senderEmail?|

Sender email address

senderPhone?|

Sender phone number

senderOrganizationNumber?|

Sender organization number

senderVatNumber?|

Sender VAT number

senderLogoUrl?|

Logo URL shown top-right on the invoice PDF and in the invoice email

bankAccountNumber?|

Bank account number

bankName?|

Bank name

swiftBic?|

SWIFT/BIC code

iban?|

IBAN

paymentReferencePrefix?|

Payment reference prefix

invoiceFooterText?|

Footer text for invoices

invoiceTermsText?|

Terms and conditions text

latePaymentFee?number

Late payment fee amount

latePaymentInterestRate?number

Late payment interest rate (percentage)

autoGenerateEnabled?boolean

Enable automatic invoice generation

autoSendOnGeneration?boolean

Automatically send invoices when generated

defaultInvoiceSendMode?string

Value in

  • "manual"
  • "scheduled"
  • "immediate"
defaultInvoiceSchedule?|null
registerPurchasesInCashRegister?boolean

Register invoice purchases in the configured cash register

collectionPeriodType?string

Collection period type for auto-invoicing

Value in

  • "calendar_month"
  • "rolling_30_days"
  • "weekly"
reminderEnabled?boolean

Enable payment reminders

firstReminderDaysAfterDue?number

Days after due date for first reminder

secondReminderDaysAfterDue?number

Days after due date for second reminder

thirdReminderDaysAfterDue?number

Days after due date for third reminder

reminderFeeAmount?number

Fee amount added per reminder

autoMarkOverdueDays?number

Days after due date to auto-mark as overdue

currency?string

Currency code (e.g., SEK, EUR)

overrideParentSettings?boolean

Use location-specific settings instead of inheriting parent settings

shareInvoiceNumberSeries?boolean

Share this location's invoice counter with child locations

allowChildRecipientCreation?boolean

Allow child locations to create invoice recipients

requiredRecipientFields?array<>
posReferenceRequirement?string

Value in

  • "optional"
  • "required"
  • "existing"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/v1/invoice-location-settings" \  -H "Content-Type: application/json" \  -d '{    "locationId": 0  }'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "defaultPaymentTermsDays": 30,    "invoiceNumberPrefix": "string",    "invoiceNumberCounter": 0,    "minInvoiceAmount": 0,    "senderName": "string",    "senderAddressLine1": "string",    "senderAddressLine2": "string",    "senderPostalCode": "string",    "senderCity": "string",    "senderCountry": "string",    "senderEmail": "string",    "senderPhone": "string",    "senderOrganizationNumber": "string",    "senderVatNumber": "string",    "senderLogoUrl": "string",    "bankAccountNumber": "string",    "bankName": "string",    "swiftBic": "string",    "iban": "string",    "paymentReferencePrefix": "string",    "invoiceFooterText": "string",    "invoiceTermsText": "string",    "latePaymentFee": 0,    "latePaymentInterestRate": 0,    "autoGenerateEnabled": true,    "autoSendOnGeneration": true,    "defaultInvoiceSendMode": "manual",    "defaultInvoiceSchedule": {      "scheduleType": "weekly",      "dayOfWeek": 0,      "dayOfMonth": 1,      "intervalDays": 1,      "timeOfDay": "string",      "timezone": "string"    },    "registerPurchasesInCashRegister": true,    "collectionPeriodType": "calendar_month",    "reminderEnabled": true,    "firstReminderDaysAfterDue": 0,    "secondReminderDaysAfterDue": 0,    "thirdReminderDaysAfterDue": 0,    "reminderFeeAmount": 0,    "autoMarkOverdueDays": 0,    "currency": "string",    "overrideParentSettings": true,    "shareInvoiceNumberSeries": true,    "allowChildRecipientCreation": true,    "canCreateRecipients": true,    "requiredRecipientFields": [      "name"    ],    "posReferenceRequirement": "optional",    "sourceLocationId": 0,    "sourceLocationName": "string",    "isInherited": true,    "hasParent": true,    "numberSeriesSourceLocationId": 0,    "numberSeriesSourceLocationName": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
GET
/api/v1/invoice-recipients

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Query Parameters

locationId*number

Location ID (required)

isActive?boolean

Filter by active status

search?string

Match against name, organization name, email or organization number

page?number

Page number

Range1 <= value
Default1
limit?number

Items per page

Range1 <= value <= 100
Default50

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/invoice-recipients?locationId=0"
{  "status": "success",  "data": {    "items": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "locationId": 0,        "name": "string",        "email": "string",        "organizationName": "string",        "organizationNumber": "string",        "phone": "string",        "billingAddressLine1": "string",        "billingAddressLine2": "string",        "postalCode": "string",        "city": "string",        "country": "string",        "reference": "string",        "contactPerson": "string",        "vatNumber": "string",        "totalInvoicedAmount": 0,        "totalPaidAmount": 0,        "outstandingAmount": 0,        "invoiceCount": 0,        "isActive": true,        "showInvoiceAddOns": true,        "invoiceReferenceGrouping": "per_reference",        "sourceLocationId": 0,        "sourceLocationName": "string",        "isInherited": true,        "relationship": "local",        "createdAt": "2019-08-24T14:15:22Z",        "updatedAt": "2019-08-24T14:15:22Z"      }    ],    "pagination": {      "page": 1,      "limit": 1,      "total": 0,      "totalPages": 0    }  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoice-recipients

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

locationId*number

Location ID (required)

name*string

Recipient name (required)

email*string

Email address (required)

organizationName?string

Organization/company name

organizationNumber?string

Organization number

phone?string

Phone number

billingAddressLine1?string

Address line 1

billingAddressLine2?string

Address line 2

postalCode?string

Postal code

city?string

City

country*string

ISO 3166-1 alpha-2 country code

Length2 <= length <= 2
reference?string

Reference/PO number

contactPerson?string

Contact person name

vatNumber?string

VAT number

showInvoiceAddOns?boolean
invoiceReferenceGrouping?string

Value in

  • "per_reference"
  • "combined"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoice-recipients" \  -H "Content-Type: application/json" \  -d '{    "locationId": 0,    "name": "string",    "email": "string",    "country": "st"  }'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "name": "string",    "email": "string",    "organizationName": "string",    "organizationNumber": "string",    "phone": "string",    "billingAddressLine1": "string",    "billingAddressLine2": "string",    "postalCode": "string",    "city": "string",    "country": "string",    "reference": "string",    "contactPerson": "string",    "vatNumber": "string",    "totalInvoicedAmount": 0,    "totalPaidAmount": 0,    "outstandingAmount": 0,    "invoiceCount": 0,    "isActive": true,    "showInvoiceAddOns": true,    "invoiceReferenceGrouping": "per_reference",    "sourceLocationId": 0,    "sourceLocationName": "string",    "isInherited": true,    "relationship": "local",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
GET
/api/v1/invoice-recipients/{recipientId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

recipientId*string

Recipient UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/invoice-recipients/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "name": "string",    "email": "string",    "organizationName": "string",    "organizationNumber": "string",    "phone": "string",    "billingAddressLine1": "string",    "billingAddressLine2": "string",    "postalCode": "string",    "city": "string",    "country": "string",    "reference": "string",    "contactPerson": "string",    "vatNumber": "string",    "totalInvoicedAmount": 0,    "totalPaidAmount": 0,    "outstandingAmount": 0,    "invoiceCount": 0,    "isActive": true,    "showInvoiceAddOns": true,    "invoiceReferenceGrouping": "per_reference",    "sourceLocationId": 0,    "sourceLocationName": "string",    "isInherited": true,    "relationship": "local",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
DELETE
/api/v1/invoice-recipients/{recipientId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

recipientId*string

Recipient UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/api/v1/invoice-recipients/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "status": "success",  "data": {    "deleted": true  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
PUT
/api/v1/invoice-recipients/{recipientId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

recipientId*string

Recipient UUID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name?string

Recipient name

email?string

Email address

organizationName?|

Organization/company name

organizationNumber?|

Organization number

phone?|

Phone number

billingAddressLine1?|

Address line 1

billingAddressLine2?|

Address line 2

postalCode?|

Postal code

city?|

City

country?|

Country

reference?|

Reference/PO number

contactPerson?|

Contact person name

vatNumber?|

VAT number

isActive?boolean

Whether the recipient is active

showInvoiceAddOns?boolean
invoiceReferenceGrouping?string

Value in

  • "per_reference"
  • "combined"

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/v1/invoice-recipients/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "name": "string",    "email": "string",    "organizationName": "string",    "organizationNumber": "string",    "phone": "string",    "billingAddressLine1": "string",    "billingAddressLine2": "string",    "postalCode": "string",    "city": "string",    "country": "string",    "reference": "string",    "contactPerson": "string",    "vatNumber": "string",    "totalInvoicedAmount": 0,    "totalPaidAmount": 0,    "outstandingAmount": 0,    "invoiceCount": 0,    "isActive": true,    "showInvoiceAddOns": true,    "invoiceReferenceGrouping": "per_reference",    "sourceLocationId": 0,    "sourceLocationName": "string",    "isInherited": true,    "relationship": "local",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoice-recipients/{recipientId}/lift

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

recipientId*string

Recipient UUID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

targetLocationId*number

Parent location receiving ownership

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoice-recipients/497f6eca-6276-4993-bfeb-53cbbbba6f08/lift" \  -H "Content-Type: application/json" \  -d '{    "targetLocationId": 0  }'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "name": "string",    "email": "string",    "organizationName": "string",    "organizationNumber": "string",    "phone": "string",    "billingAddressLine1": "string",    "billingAddressLine2": "string",    "postalCode": "string",    "city": "string",    "country": "string",    "reference": "string",    "contactPerson": "string",    "vatNumber": "string",    "totalInvoicedAmount": 0,    "totalPaidAmount": 0,    "outstandingAmount": 0,    "invoiceCount": 0,    "isActive": true,    "showInvoiceAddOns": true,    "invoiceReferenceGrouping": "per_reference",    "sourceLocationId": 0,    "sourceLocationName": "string",    "isInherited": true,    "relationship": "local",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
GET
/api/v1/invoice-recipients/{recipientId}/rules

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

recipientId*string

Recipient UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/invoice-recipients/497f6eca-6276-4993-bfeb-53cbbbba6f08/rules"
{  "status": "success",  "data": {    "rules": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",        "locationId": 0,        "ruleType": "email_exact",        "ruleValue": "string",        "isActive": true,        "maxCreditLimit": 0,        "autoApprove": true,        "createdAt": "2019-08-24T14:15:22Z",        "updatedAt": "2019-08-24T14:15:22Z",        "userName": "string",        "userEmail": "string"      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoice-recipients/{recipientId}/rules

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

recipientId*string

Recipient UUID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

locationId*number

Location ID (required)

ruleType*string

Type of rule (required)

Value in

  • "email_exact"
  • "email_wildcard"
  • "user_id"
ruleValue*string

Rule value - email, pattern (*@company.com), or user ID (required)

maxCreditLimit?number

Maximum credit limit for auto-invoicing

autoApprove?boolean

Auto-approve invoices matching this rule

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoice-recipients/497f6eca-6276-4993-bfeb-53cbbbba6f08/rules" \  -H "Content-Type: application/json" \  -d '{    "locationId": 0,    "ruleType": "email_exact",    "ruleValue": "string"  }'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "locationId": 0,    "ruleType": "email_exact",    "ruleValue": "string",    "isActive": true,    "maxCreditLimit": 0,    "autoApprove": true,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "userName": "string",    "userEmail": "string"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
DELETE
/api/v1/invoice-recipients/{recipientId}/rules/{ruleId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

recipientId*string

Recipient UUID

Formatuuid
ruleId*string

Rule UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/api/v1/invoice-recipients/497f6eca-6276-4993-bfeb-53cbbbba6f08/rules/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "status": "success",  "data": {    "deleted": true  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
GET
/api/v1/invoices

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Query Parameters

locationId*number

Location ID (required)

includeChildren?boolean

Include authorized descendants of locationId.

Defaultfalse
locationIds?string

Optional comma-separated subset of the resolved location hierarchy.

Match^[0-9]+(,[0-9]+)*$
Lengthlength <= 11000
recipientId?string

Filter by recipient

Formatuuid
status?string

Filter by status

Value in

  • "draft"
  • "sent"
  • "paid"
  • "overdue"
  • "cancelled"
  • "auto_draft"
invoiceType?string

Filter by invoice type

Value in

  • "manual"
  • "auto_generated"
  • "credit"
startDate?string

Filter by start date

Formatdate-time
endDate?string

Filter by end date

Formatdate-time
page?number

Page number

Range1 <= value
Default1
limit?number

Items per page

Range1 <= value <= 1000
Default50

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/invoices?locationId=0"
{  "status": "success",  "data": {    "items": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "locationId": 0,        "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",        "referenceId": "8502eb05-558d-4480-8511-c1011710b340",        "reference": "string",        "invoiceNumber": "string",        "status": "draft",        "invoiceType": "manual",        "collectionPeriodStart": "2019-08-24T14:15:22Z",        "collectionPeriodEnd": "2019-08-24T14:15:22Z",        "totalAmount": 0,        "taxAmount": 0,        "subtotalAmount": 0,        "currency": "string",        "dueDate": "2019-08-24",        "issuedDate": "2019-08-24",        "paidDate": "2019-08-24",        "paymentReference": "string",        "notes": "string",        "createdBy": 0,        "createdAt": "2019-08-24T14:15:22Z",        "updatedAt": "2019-08-24T14:15:22Z",        "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",        "timeline": [          {            "id": "string",            "action": "created",            "occurredAt": "2019-08-24T14:15:22Z",            "actor": {              "type": "retailer_user",              "id": "string",              "name": "string",              "email": "string"            },            "details": {}          }        ]      }    ],    "pagination": {      "page": 1,      "limit": 1,      "total": 0,      "totalPages": 0    }  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

locationId*number

Location ID (required)

recipientId*string

Recipient UUID (required)

Formatuuid
referenceId?string

Recipient reference UUID (optional)

Formatuuid
dueDate*string

Due date YYYY-MM-DD (required)

Formatdate
currency?string

Currency code (optional - defaults to location currency)

invoiceType?string

Invoice type (default: manual)

Value in

  • "manual"
  • "auto_generated"
collectionPeriodStart?string

Collection period start

Formatdate-time
collectionPeriodEnd?string

Collection period end

Formatdate-time
totalAmount?number

Total amount

taxAmount?number

Tax amount

subtotalAmount?number

Subtotal amount

issuedDate?string

Issue date

Formatdate
paymentReference?string

Payment reference

notes?string

Notes

purchaseIds?array<number>

Purchase IDs to link to invoice

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices" \  -H "Content-Type: application/json" \  -d '{    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "dueDate": "2019-08-24"  }'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
GET
/api/v1/invoices/{invoiceId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
DELETE
/api/v1/invoices/{invoiceId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "status": "success",  "data": {    "deleted": true  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
PUT
/api/v1/invoices/{invoiceId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

status?string

Invoice status

Value in

  • "draft"
  • "sent"
  • "paid"
  • "overdue"
  • "cancelled"
  • "auto_draft"
dueDate?string

Due date

Formatdate
issuedDate?|

Issue date

Formatdate
paidDate?|

Payment date

Formatdate
paymentReference?|

Payment reference

notes?|

Notes

totalAmount?number

Total amount

taxAmount?number

Tax amount

subtotalAmount?number

Subtotal amount

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/{invoiceId}/cancel

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel"
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/{invoiceId}/credit-invoices

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Original invoice UUID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

lines*array<>
Items1 <= items
notes?string
Lengthlength <= 4000

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/credit-invoices" \  -H "Content-Type: application/json" \  -d '{    "lines": [      {        "lineItemId": 0,        "amountCents": 1      }    ]  }'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/{invoiceId}/mark-paid

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

paymentReference?string

Payment reference (optional)

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/mark-paid" \  -H "Content-Type: application/json" \  -d '{}'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/{invoiceId}/mark-sent

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/mark-sent"
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
GET
/api/v1/invoices/{invoiceId}/pdf-data

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/pdf-data"
{  "status": "success",  "data": {    "invoice": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "locationId": 0,      "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",      "referenceId": "8502eb05-558d-4480-8511-c1011710b340",      "reference": "string",      "invoiceNumber": "string",      "status": "draft",      "invoiceType": "manual",      "collectionPeriodStart": "2019-08-24T14:15:22Z",      "collectionPeriodEnd": "2019-08-24T14:15:22Z",      "totalAmount": 0,      "taxAmount": 0,      "subtotalAmount": 0,      "currency": "string",      "dueDate": "2019-08-24",      "issuedDate": "2019-08-24",      "paidDate": "2019-08-24",      "paymentReference": "string",      "notes": "string",      "createdBy": 0,      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",      "timeline": [        {          "id": "string",          "action": "created",          "occurredAt": "2019-08-24T14:15:22Z",          "actor": {            "type": "retailer_user",            "id": "string",            "name": "string",            "email": "string"          },          "details": {}        }      ]    },    "recipient": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "locationId": 0,      "name": "string",      "email": "string",      "organizationName": "string",      "organizationNumber": "string",      "phone": "string",      "billingAddressLine1": "string",      "billingAddressLine2": "string",      "postalCode": "string",      "city": "string",      "country": "string",      "reference": "string",      "contactPerson": "string",      "vatNumber": "string",      "totalInvoicedAmount": 0,      "totalPaidAmount": 0,      "outstandingAmount": 0,      "invoiceCount": 0,      "isActive": true,      "showInvoiceAddOns": true,      "invoiceReferenceGrouping": "per_reference",      "sourceLocationId": 0,      "sourceLocationName": "string",      "isInherited": true,      "relationship": "local",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    },    "settings": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "locationId": 0,      "defaultPaymentTermsDays": 30,      "invoiceNumberPrefix": "string",      "invoiceNumberCounter": 0,      "minInvoiceAmount": 0,      "senderName": "string",      "senderAddressLine1": "string",      "senderAddressLine2": "string",      "senderPostalCode": "string",      "senderCity": "string",      "senderCountry": "string",      "senderEmail": "string",      "senderPhone": "string",      "senderOrganizationNumber": "string",      "senderVatNumber": "string",      "senderLogoUrl": "string",      "bankAccountNumber": "string",      "bankName": "string",      "swiftBic": "string",      "iban": "string",      "paymentReferencePrefix": "string",      "invoiceFooterText": "string",      "invoiceTermsText": "string",      "latePaymentFee": 0,      "latePaymentInterestRate": 0,      "autoGenerateEnabled": true,      "autoSendOnGeneration": true,      "defaultInvoiceSendMode": "manual",      "defaultInvoiceSchedule": {        "scheduleType": "weekly",        "dayOfWeek": 0,        "dayOfMonth": 1,        "intervalDays": 1,        "timeOfDay": "string",        "timezone": "string"      },      "registerPurchasesInCashRegister": true,      "collectionPeriodType": "calendar_month",      "reminderEnabled": true,      "firstReminderDaysAfterDue": 0,      "secondReminderDaysAfterDue": 0,      "thirdReminderDaysAfterDue": 0,      "reminderFeeAmount": 0,      "autoMarkOverdueDays": 0,      "currency": "string",      "overrideParentSettings": true,      "shareInvoiceNumberSeries": true,      "allowChildRecipientCreation": true,      "canCreateRecipients": true,      "requiredRecipientFields": [        "name"      ],      "posReferenceRequirement": "optional",      "sourceLocationId": 0,      "sourceLocationName": "string",      "isInherited": true,      "hasParent": true,      "numberSeriesSourceLocationId": 0,      "numberSeriesSourceLocationName": "string",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    },    "location": {      "id": 0,      "name": "string",      "address": "string",      "postalCode": "string",      "city": "string",      "country": "string",      "phone": "string",      "organizationNumber": "string",      "email": "string",      "vatNumber": "string"    },    "purchaseDetails": [      {        "id": 0,        "intentId": "string",        "purchasedAt": "2019-08-24T14:15:22Z",        "totalAmountCents": 0,        "vatAmountCents": 0,        "items": "string",        "reference": "string",        "orderNumber": "string",        "orderComments": "string",        "lineItems": [          {            "id": 0,            "type": "string",            "title": "string",            "quantity": 0,            "finalAmountCents": 0,            "vatRateBasisPoints": 0,            "vatAmountCents": 0,            "articleNo": "string"          }        ]      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/{invoiceId}/purchases

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

purchaseIds*array<number>

Array of purchase IDs to add to the invoice

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/purchases" \  -H "Content-Type: application/json" \  -d '{    "purchaseIds": [      0    ]  }'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
PATCH
/api/v1/invoices/{invoiceId}/purchases/{purchaseId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid
purchaseId*number

Purchase ID on the invoice

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

reference*|

Reference; empty or null clears it

Lengthlength <= 200

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/purchases/0" \  -H "Content-Type: application/json" \  -d '{    "reference": "string"  }'
{  "status": "string",  "data": {    "purchaseId": 0,    "reference": "string"  }}
DELETE
/api/v1/invoices/{invoiceId}/purchases/{purchaseId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid
purchaseId*number

Purchase ID to remove

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/purchases/0"
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/{invoiceId}/send

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/send"
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ],    "pdfUrl": "string",    "emailSentTo": "string"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/{invoiceId}/send-reminder

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

reminderNumber*number

Reminder number (1, 2, or 3)

Range1 <= value <= 3

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/send-reminder" \  -H "Content-Type: application/json" \  -d '{    "reminderNumber": 1  }'
{  "status": "success",  "data": {    "sent": true,    "reminderNumber": 0  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/{invoiceId}/send-to-fortnox

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/send-to-fortnox"
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "locationId": 0,    "recipientId": "afdd332c-8290-47b9-aca2-368bf5f25a9d",    "referenceId": "8502eb05-558d-4480-8511-c1011710b340",    "reference": "string",    "invoiceNumber": "string",    "status": "draft",    "invoiceType": "manual",    "collectionPeriodStart": "2019-08-24T14:15:22Z",    "collectionPeriodEnd": "2019-08-24T14:15:22Z",    "totalAmount": 0,    "taxAmount": 0,    "subtotalAmount": 0,    "currency": "string",    "dueDate": "2019-08-24",    "issuedDate": "2019-08-24",    "paidDate": "2019-08-24",    "paymentReference": "string",    "notes": "string",    "createdBy": 0,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "originalInvoiceId": "787ae005-a194-4a17-83df-7d3c81acedb2",    "timeline": [      {        "id": "string",        "action": "created",        "occurredAt": "2019-08-24T14:15:22Z",        "actor": {          "type": "retailer_user",          "id": "string",          "name": "string",          "email": "string"        },        "details": {}      }    ],    "pdfUrl": "string",    "emailSentTo": "string"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/{invoiceId}/upload-pdf

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Path Parameters

invoiceId*string

Invoice UUID

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

pdfBase64*string

Base64-encoded PDF content

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/upload-pdf" \  -H "Content-Type: application/json" \  -d '{    "pdfBase64": "string"  }'
{  "status": "success",  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "invoiceId": "4f163819-178d-470c-a246-d6768476a6ec",    "pdfUrl": "string",    "cdnPath": "string",    "fileSize": 0,    "generatedAt": "2019-08-24T14:15:22Z"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/auto-send/run

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/auto-send/run"
{  "status": "success",  "data": {    "schedulesProcessed": 0,    "invoicesSent": 0,    "invoicesFailed": 0,    "details": [      {        "recipientId": "string",        "recipientName": "string",        "sent": [          "string"        ],        "failed": [          {            "invoiceId": "string",            "error": "string"          }        ]      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
GET
/api/v1/invoices/check-eligibility

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Query Parameters

locationId*number

Location ID (required)

email*string

Email to check eligibility for (required)

userId?number

User ID to check eligibility for (optional)

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/invoices/check-eligibility?locationId=0&email=string"
{  "status": "success",  "data": {    "eligible": true,    "recipientId": "string",    "creditLimit": 0,    "outstandingAmount": 0  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
POST
/api/v1/invoices/start-purchase

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

tabId*string

Tab UUID to pay

Formatuuid
locationId*number

Location ID

recipientId?string

Invoice recipient UUID

Formatuuid
referenceId?string

Optional: recipient reference UUID — draft invoices accumulate per (recipient, reference).

Formatuuid
selectedKitchenDispatchItemIds?array<>

Optional: specific kitchen dispatch item IDs to pay. If omitted, pays all unpaid items.

voucherCodes?array<string>

Optional: voucher codes to apply to this payment.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/invoices/start-purchase" \  -H "Content-Type: application/json" \  -d '{    "tabId": "f4c36190-e358-41c0-b3ad-58e9e89eba63",    "locationId": 0  }'
{  "status": "success",  "data": {    "success": true,    "purchaseIntentId": "7c933f97-ad75-490a-be55-2ca143239cc3",    "invoiceReference": "string"  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
GET
/api/v1/invoices/stats

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Query Parameters

locationId*number

Location ID

includeChildren?boolean

Include authorized descendant locations

Defaultfalse

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/invoices/stats?locationId=0"
{  "status": "success",  "data": {    "unsent": {      "count": 0,      "amount": 0    },    "sent": {      "count": 0,      "amount": 0    },    "monthly": [      {        "month": "string",        "amount": 0,        "count": 0      }    ]  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}
GET
/api/v1/invoices/unclaimed-purchases

Authorization

ApiKeyAuth
X-API-Key<token>

API key authentication. Format: karma_live_* or karma_dev_*

In: header

Query Parameters

locationId*number

Location ID (required)

page?number

Page number

Range1 <= value
Default1
limit?number

Items per page

Range1 <= value <= 100
Default50

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/invoices/unclaimed-purchases?locationId=0"
{  "status": "success",  "data": {    "items": [      {        "id": 0,        "intentId": "string",        "purchasedAt": "2019-08-24T14:15:22Z",        "payingUserId": 0,        "state": "string",        "currencyCode": "string",        "totalAmountCents": 0,        "vatAmountCents": 0,        "items": "string",        "userEmail": "string",        "userName": "string",        "reference": "string",        "orderNumber": "string"      }    ],    "pagination": {      "page": 1,      "limit": 1,      "total": 0,      "totalPages": 0    }  },  "meta": {    "requestId": "string",    "timestamp": "2019-08-24T14:15:22Z",    "executionTimeMs": 0  }}