credit-notes

Publish a credit note

Changed on

Publishes a draft credit note, making it official and immutable.

Scope: credit-notes:write

post/companies/{companyId}/credit-notes/{creditNoteId}/publish

Request

  • Base URL
    https://api.bokio.se/v1
  • URL
    https://api.bokio.se/v1/companies/{companyId}/credit-notes/{creditNoteId}/publish
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: /authorize
      Client credentials
      Token URL: /token scopes: credit-notes:write

Response

Credit note published successfully

idstring uuid required

The unique identifier of the credit note

invoiceNumberstring nullable

The credit note number

orderNumberReferencestring nullable

The order number associated with the invoice.

projectReferencestring nullable

The project reference associated with the credit note.

buyerReferencestring nullable

The buyer reference associated with the credit note.

contractReferencestring nullable

The contract reference associated with the credit note.

currencystring required

ISO 4217 currency code

currencyRatenumber double
totalAmountnumber double

Total amount of the credit note including VAT.

totalTaxnumber double
paidAmountnumber double
status'draft' | 'published'

The status of the credit note

creditDatestring date required
dueDatestring date required
publishedDateTimestring date-time nullable

The date when the credit note was published (null for draft)

metadataobject nullable

Metadata fields for the invoice as string key-value pairs. These fields can be used for filtering.All metadata keys must start with a letter or underscore and contain only alphanumeric characters and underscores.

Example response

{
  "id": "b529df79-eb7f-5ef0-a8dc-c2b71f953554",
  "status": "published",
  "invoiceNumber": "CN-2024-001",
  "invoiceRef": {
    "id": "a419cf69-db6f-4de9-992c-b1a60942a443",
    "invoiceNumber": "IN-2024-001"
  },
  "customerRef": {
    "id": "55c899c5-82b2-47fa-9c51-e35fc9b26443",
    "name": "customer 1",
    "customerNumber": "CUST-001"
  },
  "contactDetailRef": {
    "id": "d3b07384-d9a0-4c9b-8b3a-6e1f2a5c8d4e",
    "email": "contact@customer1.com",
    "phone": "+46701234567"
  },
  "currency": "SEK",
  "currencyRate": 1,
  "totalAmount": 6375,
  "totalTax": 1275,
  "paidAmount": 0,
  "creditDate": "2024-10-15",
  "dueDate": "2024-11-15",
  "publishedDateTime": "2024-10-15T12:00:00",
  "projectReference": "PROJ-001",
  "buyerReference": "BUYER-123",
  "contractReference": "CONTRACT-456",
  "lineItems": [
    {
      "id": 1,
      "itemRef": {
        "id": "55c899c5-82b2-47fa-9c51-e35fc9b26443",
        "description": "Product 1"
      },
      "description": "Product 1",
      "itemType": "salesItem",
      "productType": "goods",
      "quantity": 2,
      "unitPrice": 100,
      "taxRate": 25,
      "discount": {
        "type": "amount",
        "value": 100
      }
    },
    {
      "id": 2,
      "description": "Installation work",
      "itemType": "salesItem",
      "productType": "services",
      "unitType": "hour",
      "quantity": 10,
      "unitPrice": 500,
      "taxRate": 25
    }
  ],
  "billingAddress": {
    "line1": "Älvsborgsvägen 10",
    "line2": null,
    "city": "Göteborg",
    "postalCode": "123 45",
    "country": "SE"
  },
  "deliveryAddress": {
    "line1": "Delivery Street 15",
    "line2": "Floor 2",
    "city": "Stockholm",
    "postalCode": "111 11",
    "country": "SE"
  },
  "attachmentRefs": [
    {
      "id": "240a4af0-edfd-47b1-b4ab-f30450eaac19",
      "fileName": "myfile.pdf"
    },
    {
      "id": "94a8f806-8493-40f6-9d5b-0495c84f8ab9",
      "fileName": "myfile2.pdf"
    }
  ],
  "journalEntryRef": {
    "id": "340a4af0-edfd-47b1-b4ab-f30450eaac19"
  },
  "metadata": {
    "project": "Website Redesign",
    "department": "IT",
    "externalId": "EXT-INV-2024-001"
  }
}

Changes

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      added the new custom enum value to the //// response property for the response status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added to the response property allOf list for the response status