api.ktilaskutus.fi Open in urlscan Pro
104.214.222.85  Public Scan

Submitted URL: https://api.ktilaskutus.fi/
Effective URL: https://api.ktilaskutus.fi/doc/v1/index.html
Submission: On August 23 via automatic, source certstream-suspicious

Form analysis 0 forms found in the DOM

Text Content

 * Quick Start
 * Errors
 * Cross-Origin Resource Sharing
 * Authentication
 * General
   * Creditors
     * getGet creditors
     * postCreate creditor
     * patchUpdate creditor
     * getGet creditor by ID
     * postCreate logo
     * getGet logo by ID
     * delDelete logo by ID
   * Customers
     * getGet customers
     * postCreate customer
     * getGet customer by ID
     * patchUpdate customer
   * Invoices
     * postCreate invoice
     * getGet invoices
     * postImport Finvoice
     * getGet invoice by ID
     * patchUpdate invoice
     * postCreate attachment
     * getGet attachments
     * getGet attachment by ID
     * delDelete attachment by ID
     * getGet items
     * getGet item by ID
   * Letters
     * getGet letters
     * getGet letter by ID
     * getGet deliveries
     * postCreate delivery
     * patchCancel delivery
   * Payments
     * getGet payments
     * getGet payment by ID
     * patchUpdate payment
     * postCreate transfer
     * getGet transfers
     * getGet transfer by ID
   * Users
     * patchUpdate current user
     * getGet current user
   * Miscellaneous
     * getGet electronic invoice operators
     * getGet electronic invoice operator by ID
   * OAuth2
     * postToken endpoint

Documentation Powered by ReDoc





KTI API REFERENCE (1.0.0+20210502)

Download OpenAPI specification:Download

API support: info@ktilaskutus.fi URL: https://ktilaskutus.fi



QUICK START

You can create your first invoice with single invoice-create operation.

Alternatively, you can import an existing Finvoice file which has the benefit of
handling customer creation or matching automatically.

 1. Import existing Finvoice file using operation invoice-import-finvoice.


ERRORS

The API uses standard HTTP status codes to indicate the success or failure of
the API call. The body of the error response will be JSON describing the
occurred error.


CROSS-ORIGIN RESOURCE SHARING

This API features Cross-Origin Resource Sharing (CORS) implemented in compliance
with W3C spec. And that allows cross-domain communication from the browser. All
responses have a wildcard same-origin which makes them completely public and
accessible to everyone, including any code on any site.


AUTHENTICATION


BEARER

Bearer authentication (also called token authentication) is an HTTP
authentication scheme that involves security tokens called bearer tokens. The
name “Bearer authentication” can be understood as “give access to the bearer of
this token.” The bearer token is a cryptic string, usually generated by the
server in response to a login request. The client must send this token in the
Authorization header when making requests to protected resources:

Authorization: bearer <token>

Security Scheme Type HTTP HTTP Authorization Scheme bearer


CREDITORS

Creditor represents a supplier: a person, organisation or other entity that
sells a product or service as their business.

In invoice terms, creditor is the seller.


GET CREDITORS

Retrieves creditors based on given filter criteria. By default returns first
page of the creditors.

AUTHORIZATIONS:

Bearer

QUERY PARAMETERS

filter
string
Example: filter=id = 1012 and externalId isnotnull

Filter expression

sort
string
Example: sort=id asc, externalId desc

Sort expression

page
string
Default: "1:100"
Example: page=17:50

Paging expression


RESPONSES

200

Success

default

Error

get/creditors

Staging

https://api.stage.ktilaskutus.fi/v1/creditors

Production

https://api.ktilaskutus.fi/v1/creditors


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
[
 * {
    * "id": 19481582,
    * "externalId": "10174814",
    * "type": "business",
    * "businessCode": "1234567-1",
    * "name": "string",
    * "street": "Testikatu 1 A 2",
    * "postalCode": "20100",
    * "city": "TURKU",
    * "country": "FI",
    * "phone": "+3584012345678",
    * "email": "user@example.com",
    * "bankAccountNumber": "string",
    * "createdAt": "2019-08-24T14:15:22Z",
    * "updatedAt": "2019-08-24T14:15:22Z"
   
   }

]



CREATE CREDITOR

Creates new creditor.

AUTHORIZATIONS:

Bearer

REQUEST BODY SCHEMA: APPLICATION/JSON



externalId
string [ 1 .. 32 ] characters Nullable

Identifier in the original (external) system.

type
required
string

Type of the creditor. Value cannot be changed after initial set.

business


business
consumer
businessCode
required
string

Business-ID (y-tunnus) of the creditor. Value cannot be changed after initial
set.

name
required
string [ 1 .. 255 ] characters

Name of the creditor.

street
required
string [ 1 .. 255 ] characters

Street address of the creditor.

postalCode
required
string [ 1 .. 255 ] characters

Postal code (ZIP) of the creditor.

city
required
string [ 1 .. 255 ] characters

City of the creditor.

country
required
string 2 characters

Country code of the creditor in ISO 3166-1 alpha-2.

phone
string Nullable ^\+[1-9][0-9]{6,14}$

Phone number of the creditor in international format.

email
string <email> Nullable

Email address of the creditor.

bankAccountNumber
string Nullable

Bank account number as IBAN.


RESPONSES

200

Success

default

Error

post/creditors

Staging

https://api.stage.ktilaskutus.fi/v1/creditors

Production

https://api.ktilaskutus.fi/v1/creditors


REQUEST SAMPLES

 * Payload

Content type
application/json
Example
business


business
consumer
Copy
Expand all Collapse all
{
 * "externalId": "10174814",
 * "type": "business",
 * "businessCode": "1234567-1",
 * "name": "string",
 * "street": "Testikatu 1 A 2",
 * "postalCode": "20100",
 * "city": "TURKU",
 * "country": "FI",
 * "phone": "+3584012345678",
 * "email": "user@example.com",
 * "bankAccountNumber": "string"

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Example
business


business
consumer
Copy
Expand all Collapse all
{
 * "id": 19481582,
 * "externalId": "10174814",
 * "type": "business",
 * "businessCode": "1234567-1",
 * "name": "string",
 * "street": "Testikatu 1 A 2",
 * "postalCode": "20100",
 * "city": "TURKU",
 * "country": "FI",
 * "phone": "+3584012345678",
 * "email": "user@example.com",
 * "bankAccountNumber": "string",
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



UPDATE CREDITOR

Updates existing creditor.

Note. Unchanged properties can be left out of the request.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

creditorId
required
integer

ID of the creditor

REQUEST BODY SCHEMA: APPLICATION/JSON



externalId
string [ 1 .. 32 ] characters Nullable

Identifier in the original (external) system.

name
string [ 1 .. 255 ] characters

Name of the creditor.

street
string [ 1 .. 255 ] characters

Street address of the creditor.

postalCode
string [ 1 .. 255 ] characters

Postal code (ZIP) of the creditor.

city
string [ 1 .. 255 ] characters

City of the creditor.

country
string 2 characters

Country code of the creditor in ISO 3166-1 alpha-2.

phone
string Nullable ^\+[1-9][0-9]{6,14}$

Phone number of the creditor in international format.

email
string <email> Nullable

Email address of the creditor.

bankAccountNumber
string Nullable

Bank account number as IBAN.


RESPONSES

200

Success

default

Error

patch/creditors/{creditorId}

Staging

https://api.stage.ktilaskutus.fi/v1/creditors/{creditorId}

Production

https://api.ktilaskutus.fi/v1/creditors/{creditorId}


REQUEST SAMPLES

 * Payload

Content type
application/json
Copy
Expand all Collapse all
{
 * "externalId": "10174814",
 * "name": "string",
 * "street": "Testikatu 1 A 2",
 * "postalCode": "20100",
 * "city": "TURKU",
 * "country": "FI",
 * "phone": "+3584012345678",
 * "email": "user@example.com",
 * "bankAccountNumber": "string"

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Example
business


business
consumer
Copy
Expand all Collapse all
{
 * "id": 19481582,
 * "externalId": "10174814",
 * "type": "business",
 * "businessCode": "1234567-1",
 * "name": "string",
 * "street": "Testikatu 1 A 2",
 * "postalCode": "20100",
 * "city": "TURKU",
 * "country": "FI",
 * "phone": "+3584012345678",
 * "email": "user@example.com",
 * "bankAccountNumber": "string",
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



GET CREDITOR BY ID

Retrieves creditor by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

creditorId
required
integer

ID of the creditor


RESPONSES

200

Success

default

Error

get/creditors/{creditorId}

Staging

https://api.stage.ktilaskutus.fi/v1/creditors/{creditorId}

Production

https://api.ktilaskutus.fi/v1/creditors/{creditorId}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Example
business


business
consumer
Copy
Expand all Collapse all
{
 * "id": 19481582,
 * "externalId": "10174814",
 * "type": "business",
 * "businessCode": "1234567-1",
 * "name": "string",
 * "street": "Testikatu 1 A 2",
 * "postalCode": "20100",
 * "city": "TURKU",
 * "country": "FI",
 * "phone": "+3584012345678",
 * "email": "user@example.com",
 * "bankAccountNumber": "string",
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



CREATE LOGO

Creates new logo.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

creditorId
required
integer

ID of the creditor

REQUEST BODY SCHEMA: IMAGE/PNG


string <binary>



RESPONSES

200

Success

default

Error

post/creditors/{creditorId}/logo

Staging

https://api.stage.ktilaskutus.fi/v1/creditors/{creditorId}/logo

Production

https://api.ktilaskutus.fi/v1/creditors/{creditorId}/logo


RESPONSE SAMPLES

 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "type": "authentication-error",
 * "title": "string",
 * "status": 400,
 * "detail": "string",
 * "errors": [
    * {
       * "error": "string",
       * "property": "string"
      
      }
   
   ],
 * "correlationId": "string"

}


GET LOGO BY ID

Retrieves logo by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

creditorId
required
integer

ID of the creditor


RESPONSES

200

Success

default

Error

get/creditors/{creditorId}/logo

Staging

https://api.stage.ktilaskutus.fi/v1/creditors/{creditorId}/logo

Production

https://api.ktilaskutus.fi/v1/creditors/{creditorId}/logo


RESPONSE SAMPLES

 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "type": "authentication-error",
 * "title": "string",
 * "status": 400,
 * "detail": "string",
 * "errors": [
    * {
       * "error": "string",
       * "property": "string"
      
      }
   
   ],
 * "correlationId": "string"

}


DELETE LOGO BY ID

Deletes logo by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

creditorId
required
integer

ID of the creditor


RESPONSES

200

Success

default

Error

delete/creditors/{creditorId}/logo

Staging

https://api.stage.ktilaskutus.fi/v1/creditors/{creditorId}/logo

Production

https://api.ktilaskutus.fi/v1/creditors/{creditorId}/logo


RESPONSE SAMPLES

 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "type": "authentication-error",
 * "title": "string",
 * "status": 400,
 * "detail": "string",
 * "errors": [
    * {
       * "error": "string",
       * "property": "string"
      
      }
   
   ],
 * "correlationId": "string"

}


CUSTOMERS

Customer represents the buyer.


GET CUSTOMERS

Retrieves customers based on given filter criteria. By default returns first
page of the customers.

AUTHORIZATIONS:

Bearer

QUERY PARAMETERS

filter
string
Example: filter=id = 1012 and externalId isnotnull

Filter expression

sort
string
Example: sort=id asc, externalId desc

Sort expression

page
string
Default: "1:100"
Example: page=17:50

Paging expression


RESPONSES

200

Success

default

Error

get/customers

Staging

https://api.stage.ktilaskutus.fi/v1/customers

Production

https://api.ktilaskutus.fi/v1/customers


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
[
 * {
    * "id": 0,
    * "creditorId": 18585,
    * "debtorId": 0,
    * "externalId": "10174814",
    * "number": 94824,
    * "type": "business",
    * "businessCode": "1234567-1",
    * "name": "Test Company Oy",
    * "socialSecurityNumber": "010101-123N",
    * "firstName": "Teppo",
    * "lastName": "Testaaja",
    * "careOf": "Foobar",
    * "street": "Test Street 1 A 2",
    * "street2": "Test Street 1 A 2",
    * "postalCode": 20250,
    * "city": "Turku",
    * "country": "FI",
    * "phone": "+3584012345678",
    * "email": "teppo.testaaja@testing.fi",
    * "electronicInvoiceOperator": "00372332748700001",
    * "electronicInvoiceAddress": "003729887813",
    * "deliveryMethod": "email",
    * "paymentPeriod": 14,
    * "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et
      nunc blandit, maximus felis vel, accumsan erat.",
    * "createdAt": "string",
    * "updatedAt": "string"
   
   }

]



CREATE CUSTOMER

Creates new customer.

AUTHORIZATIONS:

Bearer

REQUEST BODY SCHEMA: APPLICATION/JSON



creditorId
integer

ID of the creditor.

externalId
string [ 1 .. 32 ] characters Nullable

Identifier in the original (external) system.

number
string

Customer number

type
string
Enum: "business" "consumer"

Type of customer

Possible values are:

 * business: Company or organization
 * consumer: Private person

businessCode
string

Company business identifier (e.g. y-tunnus)

name
string

Company name

socialSecurityNumber
string

Private person Person-ID (e.g. henkilötunnus)

firstName
string

Private person first name

lastName
string

Private person last name

careOf
string

Care of name

street
string

Street address

street2
string

Street address

postalCode
string

Postal code (zip)

city
string

City

country
string 2 characters

Country code in ISO 3166-1 alpha-2.

phone
string^\+[1-9][0-9]{6,14}$

Phone number in international format.

email
string <email>

Email address

electronicInvoiceOperator
string

Code or shorthand of the electronic invoice operator. See verkkolaskuosoite.fi
for more information.

electronicInvoiceAddress
string

Electronic invoice address. See verkkolaskuosoite.fi for more information.

deliveryMethod
string
Enum: "email" "paper" "electronic" "none"

Delivery method.

Possible values are

 * email: Delivery is via email
 * paper: Delivery is via paper
 * electronic: Delivery via e-invoice or as paper if e-invoice fails
 * none: No delivery is made

paymentPeriod
integer

Payment period measured in days. Due date is payment period days after invoice
date.

notes
string

Free text notes


RESPONSES

200

Success

default

Error

post/customers

Staging

https://api.stage.ktilaskutus.fi/v1/customers

Production

https://api.ktilaskutus.fi/v1/customers


REQUEST SAMPLES

 * Payload

Content type
application/json
Copy
Expand all Collapse all
{
 * "creditorId": 18585,
 * "externalId": "10174814",
 * "number": 94824,
 * "type": "business",
 * "businessCode": "1234567-1",
 * "name": "Test Company Oy",
 * "socialSecurityNumber": "010101-123N",
 * "firstName": "Teppo",
 * "lastName": "Testaaja",
 * "careOf": "Foobar",
 * "street": "Test Street 1 A 2",
 * "street2": "Test Street 1 A 2",
 * "postalCode": 20250,
 * "city": "Turku",
 * "country": "FI",
 * "phone": "+3584012345678",
 * "email": "teppo.testaaja@testing.fi",
 * "electronicInvoiceOperator": "00372332748700001",
 * "electronicInvoiceAddress": "003729887813",
 * "deliveryMethod": "email",
 * "paymentPeriod": 14,
 * "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et
   nunc blandit, maximus felis vel, accumsan erat."

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 0,
 * "creditorId": 18585,
 * "debtorId": 0,
 * "externalId": "10174814",
 * "number": 94824,
 * "type": "business",
 * "businessCode": "1234567-1",
 * "name": "Test Company Oy",
 * "socialSecurityNumber": "010101-123N",
 * "firstName": "Teppo",
 * "lastName": "Testaaja",
 * "careOf": "Foobar",
 * "street": "Test Street 1 A 2",
 * "street2": "Test Street 1 A 2",
 * "postalCode": 20250,
 * "city": "Turku",
 * "country": "FI",
 * "phone": "+3584012345678",
 * "email": "teppo.testaaja@testing.fi",
 * "electronicInvoiceOperator": "00372332748700001",
 * "electronicInvoiceAddress": "003729887813",
 * "deliveryMethod": "email",
 * "paymentPeriod": 14,
 * "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et
   nunc blandit, maximus felis vel, accumsan erat.",
 * "createdAt": "string",
 * "updatedAt": "string"

}



GET CUSTOMER BY ID

Retrieves customer by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

customerId
required
integer

ID of the customer


RESPONSES

200

Success

default

Error

get/customers/{customerId}

Staging

https://api.stage.ktilaskutus.fi/v1/customers/{customerId}

Production

https://api.ktilaskutus.fi/v1/customers/{customerId}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 0,
 * "creditorId": 18585,
 * "debtorId": 0,
 * "externalId": "10174814",
 * "number": 94824,
 * "type": "business",
 * "businessCode": "1234567-1",
 * "name": "Test Company Oy",
 * "socialSecurityNumber": "010101-123N",
 * "firstName": "Teppo",
 * "lastName": "Testaaja",
 * "careOf": "Foobar",
 * "street": "Test Street 1 A 2",
 * "street2": "Test Street 1 A 2",
 * "postalCode": 20250,
 * "city": "Turku",
 * "country": "FI",
 * "phone": "+3584012345678",
 * "email": "teppo.testaaja@testing.fi",
 * "electronicInvoiceOperator": "00372332748700001",
 * "electronicInvoiceAddress": "003729887813",
 * "deliveryMethod": "email",
 * "paymentPeriod": 14,
 * "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et
   nunc blandit, maximus felis vel, accumsan erat.",
 * "createdAt": "string",
 * "updatedAt": "string"

}



UPDATE CUSTOMER

Updates given customer.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

customerId
required
integer

ID of the customer

REQUEST BODY SCHEMA: APPLICATION/JSON



creditorId
integer

ID of the creditor.

externalId
string [ 1 .. 32 ] characters Nullable

Identifier in the original (external) system.

number
string

Customer number

type
string
Enum: "business" "consumer"

Type of customer

Possible values are:

 * business: Company or organization
 * consumer: Private person

businessCode
string

Company business identifier (e.g. y-tunnus)

name
string

Company name

socialSecurityNumber
string

Private person Person-ID (e.g. henkilötunnus)

firstName
string

Private person first name

lastName
string

Private person last name

careOf
string

Care of name

street
string

Street address

street2
string

Street address

postalCode
string

Postal code (zip)

city
string

City

country
string 2 characters

Country code in ISO 3166-1 alpha-2.

phone
string^\+[1-9][0-9]{6,14}$

Phone number in international format.

email
string <email>

Email address

electronicInvoiceOperator
string

Code or shorthand of the electronic invoice operator. See verkkolaskuosoite.fi
for more information.

electronicInvoiceAddress
string

Electronic invoice address. See verkkolaskuosoite.fi for more information.

deliveryMethod
string
Enum: "email" "paper" "electronic" "none"

Delivery method.

Possible values are

 * email: Delivery is via email
 * paper: Delivery is via paper
 * electronic: Delivery via e-invoice or as paper if e-invoice fails
 * none: No delivery is made

paymentPeriod
integer

Payment period measured in days. Due date is payment period days after invoice
date.

notes
string

Free text notes


RESPONSES

200

Success

default

Error

patch/customers/{customerId}

Staging

https://api.stage.ktilaskutus.fi/v1/customers/{customerId}

Production

https://api.ktilaskutus.fi/v1/customers/{customerId}


REQUEST SAMPLES

 * Payload

Content type
application/json
Copy
Expand all Collapse all
{
 * "creditorId": 18585,
 * "externalId": "10174814",
 * "number": 94824,
 * "type": "business",
 * "businessCode": "1234567-1",
 * "name": "Test Company Oy",
 * "socialSecurityNumber": "010101-123N",
 * "firstName": "Teppo",
 * "lastName": "Testaaja",
 * "careOf": "Foobar",
 * "street": "Test Street 1 A 2",
 * "street2": "Test Street 1 A 2",
 * "postalCode": 20250,
 * "city": "Turku",
 * "country": "FI",
 * "phone": "+3584012345678",
 * "email": "teppo.testaaja@testing.fi",
 * "electronicInvoiceOperator": "00372332748700001",
 * "electronicInvoiceAddress": "003729887813",
 * "deliveryMethod": "email",
 * "paymentPeriod": 14,
 * "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et
   nunc blandit, maximus felis vel, accumsan erat."

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 0,
 * "creditorId": 18585,
 * "debtorId": 0,
 * "externalId": "10174814",
 * "number": 94824,
 * "type": "business",
 * "businessCode": "1234567-1",
 * "name": "Test Company Oy",
 * "socialSecurityNumber": "010101-123N",
 * "firstName": "Teppo",
 * "lastName": "Testaaja",
 * "careOf": "Foobar",
 * "street": "Test Street 1 A 2",
 * "street2": "Test Street 1 A 2",
 * "postalCode": 20250,
 * "city": "Turku",
 * "country": "FI",
 * "phone": "+3584012345678",
 * "email": "teppo.testaaja@testing.fi",
 * "electronicInvoiceOperator": "00372332748700001",
 * "electronicInvoiceAddress": "003729887813",
 * "deliveryMethod": "email",
 * "paymentPeriod": 14,
 * "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et
   nunc blandit, maximus felis vel, accumsan erat.",
 * "createdAt": "string",
 * "updatedAt": "string"

}



INVOICES

Invoice represents a single invoice.


CREATE INVOICE

Creates new invoice.

AUTHORIZATIONS:

Bearer

REQUEST BODY SCHEMA: APPLICATION/JSON



externalId
string [ 1 .. 32 ] characters Nullable

Identifier in the original (external) system.

creditorId
required
integer

ID of the creditor.

number
string

Invoice number

issuedOn
string <date>

Invoice date i.e. date when invoice was issued.

dueOn
string <date>

Invoice due date.

interestMethodCode
string
Enum: "fia" "fix"

Interest rate method.

Possible values are

 * fia: Finnish Interest Act (Korkolaki). Semiannually changing rate.
 * fix: Fixed interest. Specify the actual rate in rate.

interestRate
number <float>

Determines the Interest Act allowed alternative interest rate for maximum of 180
days. If no alternative interest is used, leave this to 0.

yourReference
string

A reference meaningful to the customer

ourReference
string

A reference meaningful to the creditor

freeText
string

Free text

customerId
required
integer

ID of the customer.

customerNumber
string

Customer number

customerType
string
Enum: "business" "consumer"

Type of customer

Possible values are:

 * business: Company or organization
 * consumer: Private person

customerBusinessCode
string

Company business identifier (e.g. y-tunnus)

customerName
string

Company name

customerSocialSecurityNumber
string

Private person Person-ID (e.g. henkilötunnus)

customerFirstName
string

Private person first name

customerLastName
string

Private person last name

customerCareOf
string

Care of name

customerStreet
string

Street address

customerStreet2
string

Street address

customerPostalCode
string

Postal code (zip)

customerCity
string

City

customerCountry
string 2 characters

Country code in ISO 3166-1 alpha-2.

customerPhone
string^\+[1-9][0-9]{6,14}$

Phone number in international format.

customerEmail
string <email>

Email address

customerElectronicInvoiceOperator
string

Code or shorthand of the electronic invoice operator. See verkkolaskuosoite.fi
for more information.

customerSlectronicInvoiceAddress
string

Electronic invoice address. See verkkolaskuosoite.fi for more information.

action
string
Enum: "invoice" "remind" "collect"

Action to take

Possible values are:

 * invoice: Send invoice
 * remind: Send reminder
 * collect: Start collection

deliveryMethod
string
Enum: "email" "paper" "electronic" "none"

Delivery method.

Possible values are

 * email: Delivery is via email
 * paper: Delivery is via paper
 * electronic: Delivery via e-invoice or as paper if e-invoice fails
 * none: No delivery is made

creditAmount
number <float>

The complete amount of granted credit.

creditGrantedOn
string <date>

The date when credit was granted.

creditTerminatedOn
string <date>

The date when credit was terminated.

creditEffectiveInterestRate
number <float>

The effective interest rate observing credit interest and all fees.

items
required
object



RESPONSES

200

Success

default

Error

post/invoices

Staging

https://api.stage.ktilaskutus.fi/v1/invoices

Production

https://api.ktilaskutus.fi/v1/invoices


REQUEST SAMPLES

 * Payload

Content type
application/json
Copy
Expand all Collapse all
{
 * "externalId": "10174814",
 * "creditorId": 18585,
 * "number": 1000194,
 * "issuedOn": "2018-12-01T00:00:00.000Z",
 * "dueOn": "2018-12-15T00:00:00.000Z",
 * "interestMethodCode": "fia",
 * "interestRate": 96,
 * "yourReference": 24,
 * "ourReference": 24,
 * "freeText": "This is free text. This is free text. This is free text...",
 * "customerId": 27575,
 * "customerNumber": 94824,
 * "customerType": "business",
 * "customerBusinessCode": "1234567-1",
 * "customerName": "Test Company Oy",
 * "customerSocialSecurityNumber": "010101-123N",
 * "customerFirstName": "Teppo",
 * "customerLastName": "Testaaja",
 * "customerCareOf": "Foobar",
 * "customerStreet": "Test Street 1 A 2",
 * "customerStreet2": "Test Street 1 A 2",
 * "customerPostalCode": 20250,
 * "customerCity": "Turku",
 * "customerCountry": "FI",
 * "customerPhone": "+3584012345678",
 * "customerEmail": "teppo.testaaja@testing.fi",
 * "customerElectronicInvoiceOperator": "00372332748700001",
 * "customerSlectronicInvoiceAddress": "003729887813",
 * "action": "invoice",
 * "deliveryMethod": "email",
 * "creditAmount": 0,
 * "creditGrantedOn": "2019-08-24",
 * "creditTerminatedOn": "2019-08-24",
 * "creditEffectiveInterestRate": 0,
 * "items": {
    * "type": "capital",
    * "description": "Apples",
    * "price": 12.4,
    * "priceExcludingVat": 10,
    * "priceVat": 10,
    * "vatRate": 24,
    * "vatStatus": "doms",
    * "quantity": 1,
    * "unit": "h",
    * "discountRate": 15
   
   }

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "externalId": "10174814",
 * "creditorId": 18585,
 * "state": "invoice_sent",
 * "number": 1000194,
 * "paymentReference": 1234561,
 * "issuedOn": "2018-12-01T00:00:00.000Z",
 * "dueOn": "2018-12-15T00:00:00.000Z",
 * "interestMethodCode": "fia",
 * "interestRate": 96,
 * "customerId": 27575,
 * "customerType": "business",
 * "customerNumber": 94824,
 * "customerBusinessCode": "1234567-1",
 * "customerSocialSecurityNumber": "010101-123N",
 * "customerName": "Test Company Oy",
 * "customerFirstName": "Teppo",
 * "customerLastName": "Testaaja",
 * "customerStreet": "Test Street 1 A 2",
 * "customerPostalCode": 20250,
 * "customerCity": "Turku",
 * "customerCountry": "FI",
 * "total": 12.4,
 * "totalExcludingVat": 10,
 * "totalVat": 10,
 * "open": 10,
 * "paid": 10,
 * "freeText": "This is free text. This is free text. This is free text...",
 * "createdAt": "2019-08-24T14:15:22Z"

}



GET INVOICES

Retrieves invoices based on given filter criteria. By default returns first page
of the invoices.

AUTHORIZATIONS:

Bearer

QUERY PARAMETERS

filter
string
Example: filter=id = 1012 and externalId isnotnull

Filter expression

sort
string
Example: sort=id asc, externalId desc

Sort expression

page
string
Default: "1:100"
Example: page=17:50

Paging expression


RESPONSES

200

Success

default

Error

get/invoices

Staging

https://api.stage.ktilaskutus.fi/v1/invoices

Production

https://api.ktilaskutus.fi/v1/invoices


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
[
 * {
    * "id": 18585,
    * "externalId": "10174814",
    * "creditorId": 18585,
    * "state": "invoice_sent",
    * "number": 1000194,
    * "paymentReference": 1234561,
    * "issuedOn": "2018-12-01T00:00:00.000Z",
    * "dueOn": "2018-12-15T00:00:00.000Z",
    * "interestMethodCode": "fia",
    * "interestRate": 96,
    * "customerId": 27575,
    * "customerType": "business",
    * "customerNumber": 94824,
    * "customerBusinessCode": "1234567-1",
    * "customerSocialSecurityNumber": "010101-123N",
    * "customerName": "Test Company Oy",
    * "customerFirstName": "Teppo",
    * "customerLastName": "Testaaja",
    * "customerStreet": "Test Street 1 A 2",
    * "customerPostalCode": 20250,
    * "customerCity": "Turku",
    * "customerCountry": "FI",
    * "total": 12.4,
    * "totalExcludingVat": 10,
    * "totalVat": 10,
    * "open": 10,
    * "paid": 10,
    * "freeText": "This is free text. This is free text. This is free text...",
    * "createdAt": "2019-08-24T14:15:22Z"
   
   }

]



IMPORT FINVOICE

Import invoice from existing Finvoice file.

The following information is required for a successful import.

 1. Information about import as JSON
 2. The Finvoice file
 3. The PDF file (optional)

As the import excepts various data of different formats and structures, a
multipart/form-data POST is used here.


EXAMPLE

In the following example, finvoice.xml contains the Finvoice file, and
finvoice.pdf contains the invoice image PDF.

$ curl -H "Authorization: Bearer API_KEY" https://api.stage.ktilaskutus.fi/v1/invoices/import/finvoice \
       -F info='{ "creditorId": CREDITOR_ID }' \
       -F finvoice=@finvoice.xml \
       -F pdf=@finvoice.pdf

AUTHORIZATIONS:

Bearer

REQUEST BODY SCHEMA: MULTIPART/FORM-DATA



info
object

finvoice
string <binary>

Contents of Finvoice file

pdf
string <binary>

Contents of PDF file (optional)


RESPONSES

200

Success

default

Error

post/invoices/import/finvoice

Staging

https://api.stage.ktilaskutus.fi/v1/invoices/import/finvoice

Production

https://api.ktilaskutus.fi/v1/invoices/import/finvoice


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "externalId": "10174814",
 * "creditorId": 18585,
 * "state": "invoice_sent",
 * "number": 1000194,
 * "paymentReference": 1234561,
 * "issuedOn": "2018-12-01T00:00:00.000Z",
 * "dueOn": "2018-12-15T00:00:00.000Z",
 * "interestMethodCode": "fia",
 * "interestRate": 96,
 * "customerId": 27575,
 * "customerType": "business",
 * "customerNumber": 94824,
 * "customerBusinessCode": "1234567-1",
 * "customerSocialSecurityNumber": "010101-123N",
 * "customerName": "Test Company Oy",
 * "customerFirstName": "Teppo",
 * "customerLastName": "Testaaja",
 * "customerStreet": "Test Street 1 A 2",
 * "customerPostalCode": 20250,
 * "customerCity": "Turku",
 * "customerCountry": "FI",
 * "total": 12.4,
 * "totalExcludingVat": 10,
 * "totalVat": 10,
 * "open": 10,
 * "paid": 10,
 * "freeText": "This is free text. This is free text. This is free text...",
 * "createdAt": "2019-08-24T14:15:22Z"

}



GET INVOICE BY ID

Retrieves invoice by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

invoiceId
required
integer

ID of the invoice


RESPONSES

200

Success

default

Error

get/invoices/{invoiceId}

Staging

https://api.stage.ktilaskutus.fi/v1/invoices/{invoiceId}

Production

https://api.ktilaskutus.fi/v1/invoices/{invoiceId}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "externalId": "10174814",
 * "creditorId": 18585,
 * "state": "invoice_sent",
 * "number": 1000194,
 * "paymentReference": 1234561,
 * "issuedOn": "2018-12-01T00:00:00.000Z",
 * "dueOn": "2018-12-15T00:00:00.000Z",
 * "interestMethodCode": "fia",
 * "interestRate": 96,
 * "customerId": 27575,
 * "customerType": "business",
 * "customerNumber": 94824,
 * "customerBusinessCode": "1234567-1",
 * "customerSocialSecurityNumber": "010101-123N",
 * "customerName": "Test Company Oy",
 * "customerFirstName": "Teppo",
 * "customerLastName": "Testaaja",
 * "customerStreet": "Test Street 1 A 2",
 * "customerPostalCode": 20250,
 * "customerCity": "Turku",
 * "customerCountry": "FI",
 * "total": 12.4,
 * "totalExcludingVat": 10,
 * "totalVat": 10,
 * "open": 10,
 * "paid": 10,
 * "freeText": "This is free text. This is free text. This is free text...",
 * "createdAt": "2019-08-24T14:15:22Z"

}



UPDATE INVOICE

Updates given invoice.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

invoiceId
required
integer

ID of the invoice

REQUEST BODY SCHEMA: APPLICATION/JSON



externalId
string [ 1 .. 32 ] characters Nullable

Identifier in the original (external) system.

yourReference
string

A reference meaningful to the customer

ourReference
string

A reference meaningful to the creditor


RESPONSES

200

Success

default

Error

patch/invoices/{invoiceId}

Staging

https://api.stage.ktilaskutus.fi/v1/invoices/{invoiceId}

Production

https://api.ktilaskutus.fi/v1/invoices/{invoiceId}


REQUEST SAMPLES

 * Payload

Content type
application/json
Copy
Expand all Collapse all
{
 * "externalId": "10174814",
 * "yourReference": 24,
 * "ourReference": 24

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "externalId": "10174814",
 * "creditorId": 18585,
 * "state": "invoice_sent",
 * "number": 1000194,
 * "paymentReference": 1234561,
 * "issuedOn": "2018-12-01T00:00:00.000Z",
 * "dueOn": "2018-12-15T00:00:00.000Z",
 * "interestMethodCode": "fia",
 * "interestRate": 96,
 * "customerId": 27575,
 * "customerType": "business",
 * "customerNumber": 94824,
 * "customerBusinessCode": "1234567-1",
 * "customerSocialSecurityNumber": "010101-123N",
 * "customerName": "Test Company Oy",
 * "customerFirstName": "Teppo",
 * "customerLastName": "Testaaja",
 * "customerStreet": "Test Street 1 A 2",
 * "customerPostalCode": 20250,
 * "customerCity": "Turku",
 * "customerCountry": "FI",
 * "total": 12.4,
 * "totalExcludingVat": 10,
 * "totalVat": 10,
 * "open": 10,
 * "paid": 10,
 * "freeText": "This is free text. This is free text. This is free text...",
 * "createdAt": "2019-08-24T14:15:22Z"

}



CREATE ATTACHMENT

Creates new attachment.

AUTHORIZATIONS:

Bearer

REQUEST BODY SCHEMA:
APPLICATION/PDF


APPLICATION/PDF
APPLICATION/OCTET-STREAM


string <binary>



RESPONSES

200

Success

default

Error

post/invoices/{invoiceId}/attachments

Staging

https://api.stage.ktilaskutus.fi/v1/invoices/{invoiceId}/attachments

Production

https://api.ktilaskutus.fi/v1/invoices/{invoiceId}/attachments


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json


application/json
application/pdf
application/octet-stream
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "invoiceId": 18585,
 * "mediaType": "application/pdf",
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



GET ATTACHMENTS

Retrieves attachments based on given filter criteria. By default returns first
page of the attachments.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

invoiceId
required
integer

ID of the invoice

QUERY PARAMETERS

filter
string
Example: filter=id = 1012 and externalId isnotnull

Filter expression

sort
string
Example: sort=id asc, externalId desc

Sort expression

page
string
Default: "1:100"
Example: page=17:50

Paging expression


RESPONSES

200

Success

default

Error

get/invoices/{invoiceId}/attachments

Staging

https://api.stage.ktilaskutus.fi/v1/invoices/{invoiceId}/attachments

Production

https://api.ktilaskutus.fi/v1/invoices/{invoiceId}/attachments


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
[
 * {
    * "id": 18585,
    * "invoiceId": 18585,
    * "mediaType": "application/pdf",
    * "createdAt": "2019-08-24T14:15:22Z",
    * "updatedAt": "2019-08-24T14:15:22Z"
   
   }

]



GET ATTACHMENT BY ID

Retrieves attachment by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

invoiceId
required
integer

ID of the invoice

invoiceAttachmentId
required
integer

ID of the invoice attachment


RESPONSES

200

Success

default

Error

get/invoices/{invoiceId}/attachments/{invoiceAttachmentId}

Staging

https://api.stage.ktilaskutus.fi/v1/invoices/{invoiceId}/attachments/{invoiceAttachmentId}

Production

https://api.ktilaskutus.fi/v1/invoices/{invoiceId}/attachments/{invoiceAttachmentId}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json


application/json
application/pdf
application/octet-stream
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "invoiceId": 18585,
 * "mediaType": "application/pdf",
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



DELETE ATTACHMENT BY ID

Deletes attachment by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

invoiceId
required
integer

ID of the invoice

invoiceAttachmentId
required
integer

ID of the invoice attachment


RESPONSES

200

Success

default

Error

delete/invoices/{invoiceId}/attachments/{invoiceAttachmentId}

Staging

https://api.stage.ktilaskutus.fi/v1/invoices/{invoiceId}/attachments/{invoiceAttachmentId}

Production

https://api.ktilaskutus.fi/v1/invoices/{invoiceId}/attachments/{invoiceAttachmentId}


RESPONSE SAMPLES

 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "type": "authentication-error",
 * "title": "string",
 * "status": 400,
 * "detail": "string",
 * "errors": [
    * {
       * "error": "string",
       * "property": "string"
      
      }
   
   ],
 * "correlationId": "string"

}


GET ITEMS

Retrieves items based on given filter criteria. By default returns first page of
the items.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

invoiceId
required
integer

ID of the invoice

QUERY PARAMETERS

filter
string
Example: filter=id = 1012 and externalId isnotnull

Filter expression

sort
string
Example: sort=id asc, externalId desc

Sort expression

page
string
Default: "1:100"
Example: page=17:50

Paging expression


RESPONSES

200

Success

default

Error

get/invoices/{invoiceId}/items

Staging

https://api.stage.ktilaskutus.fi/v1/invoices/{invoiceId}/items

Production

https://api.ktilaskutus.fi/v1/invoices/{invoiceId}/items


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
[
 * {
    * "id": 18585,
    * "invoiceId": 18585,
    * "type": "capital",
    * "description": "Apples",
    * "quantity": 1,
    * "vatRate": 24,
    * "price": 12.4,
    * "priceExcludingVat": 10,
    * "priceVat": 10,
    * "total": 12.4,
    * "totalExcludingVat": 10,
    * "totalVat": 10,
    * "createdAt": "2019-08-24T14:15:22Z",
    * "updatedAt": "2019-08-24T14:15:22Z"
   
   }

]



GET ITEM BY ID

Retrieves item by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

invoiceId
required
integer

ID of the invoice

invoiceItemId
required
integer

ID of the invoice item


RESPONSES

200

Success

default

Error

get/invoices/{invoiceId}/items/{invoiceItemId}

Staging

https://api.stage.ktilaskutus.fi/v1/invoices/{invoiceId}/items/{invoiceItemId}

Production

https://api.ktilaskutus.fi/v1/invoices/{invoiceId}/items/{invoiceItemId}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "invoiceId": 18585,
 * "type": "capital",
 * "description": "Apples",
 * "quantity": 1,
 * "vatRate": 24,
 * "price": 12.4,
 * "priceExcludingVat": 10,
 * "priceVat": 10,
 * "total": 12.4,
 * "totalExcludingVat": 10,
 * "totalVat": 10,
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



LETTERS

Letters represents a letter sent to the debtor.


GET LETTERS

Retrieves letters based on given filter criteria. By default returns first page
of the letters.

AUTHORIZATIONS:

Bearer

QUERY PARAMETERS

filter
string
Example: filter=id = 1012 and externalId isnotnull

Filter expression

sort
string
Example: sort=id asc, externalId desc

Sort expression

page
string
Default: "1:100"
Example: page=17:50

Paging expression


RESPONSES

200

Success

default

Error

get/letters

Staging

https://api.stage.ktilaskutus.fi/v1/letters

Production

https://api.ktilaskutus.fi/v1/letters


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
[
 * {
    * "id": 84812,
    * "creditorId": 18585,
    * "invoiceId": [
       * 2525,
       * 12424
      
      ],
    * "externalId": "10174814",
    * "type": "invoice",
    * "bankAccountNumber": "FI2380867100484406",
    * "paymentReference": 1234561,
    * "dueOn": "2018-12-15T00:00:00.000Z",
    * "total": 12.4,
    * "createdAt": "2019-08-24T14:15:22Z",
    * "updatedAt": "2019-08-24T14:15:22Z"
   
   }

]



GET LETTER BY ID

Retrieves letter by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

letterId
required
integer

ID of the letter


RESPONSES

200

Success

default

Error

get/letters/{letterId}

Staging

https://api.stage.ktilaskutus.fi/v1/letters/{letterId}

Production

https://api.ktilaskutus.fi/v1/letters/{letterId}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json


application/json
application/pdf
Copy
Expand all Collapse all
{
 * "id": 84812,
 * "creditorId": 18585,
 * "invoiceId": [
    * 2525,
    * 12424
   
   ],
 * "externalId": "10174814",
 * "type": "invoice",
 * "bankAccountNumber": "FI2380867100484406",
 * "paymentReference": 1234561,
 * "dueOn": "2018-12-15T00:00:00.000Z",
 * "total": 12.4,
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



GET DELIVERIES

Retrieves deliveries for given letter.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

letterId
required
integer

ID of the letter


RESPONSES

200

Success

default

Error

get/letters/{letterId}/deliveries

Staging

https://api.stage.ktilaskutus.fi/v1/letters/{letterId}/deliveries

Production

https://api.ktilaskutus.fi/v1/letters/{letterId}/deliveries


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
[
 * {
    * "id": 85929,
    * "letterId": 84812,
    * "state": "outgoing",
    * "method": "email",
    * "createdAt": "2019-08-24T14:15:22Z",
    * "updatedAt": "2019-08-24T14:15:22Z"
   
   }

]



CREATE DELIVERY

Creates new delivery for given letter.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

letterId
required
integer

ID of the letter

REQUEST BODY SCHEMA: APPLICATION/JSON



method
required
string
Enum: "email" "paper" "electronic" "none"

Letter delivery method.

Possible values are

 * email: Letter is delivered as email
 * paper: Letter is delivered as paper letter
 * electronic: Letter is delivered as e-invoice or as paper if e-invoice fails.
 * none: No delivery is made


RESPONSES

200

Success

default

Error

post/letters/{letterId}/deliveries

Staging

https://api.stage.ktilaskutus.fi/v1/letters/{letterId}/deliveries

Production

https://api.ktilaskutus.fi/v1/letters/{letterId}/deliveries


REQUEST SAMPLES

 * Payload

Content type
application/json
Copy
Expand all Collapse all
{
 * "method": "email"

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 85929,
 * "letterId": 84812,
 * "state": "outgoing",
 * "method": "email",
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



CANCEL DELIVERY

Cancels given delivery.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

letterId
required
integer

ID of the letter

letterDeliveryId
required
integer

ID of the letter delivery

REQUEST BODY SCHEMA: APPLICATION/JSON



status
string
Value: "cancelled"

Cancellation is not allowed if state is cancelled or delivered.


RESPONSES

200

Success

default

Error

patch/letters/{letterId}/deliveries/{letterDeliveryId}

Staging

https://api.stage.ktilaskutus.fi/v1/letters/{letterId}/deliveries/{letterDeliveryId}

Production

https://api.ktilaskutus.fi/v1/letters/{letterId}/deliveries/{letterDeliveryId}


REQUEST SAMPLES

 * Payload

Content type
application/json
Copy
Expand all Collapse all
{
 * "status": "cancelled"

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 85929,
 * "letterId": 84812,
 * "state": "outgoing",
 * "method": "email",
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



PAYMENTS

Payment represents a single monetary transaction.

Payment transfer is used to link two payments moving funds from one invoice to
another.


GET PAYMENTS

Retrieves payments based on given filter criteria. By default returns first page
of the payments.

AUTHORIZATIONS:

Bearer

QUERY PARAMETERS

filter
string
Example: filter=id = 1012 and externalId isnotnull

Filter expression

sort
string
Example: sort=id asc, externalId desc

Sort expression

page
string
Default: "1:100"
Example: page=17:50

Paging expression


RESPONSES

200

Success

default

Error

get/payments

Staging

https://api.stage.ktilaskutus.fi/v1/payments

Production

https://api.ktilaskutus.fi/v1/payments


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
[
 * {
    * "id": 18585,
    * "creditorId": 18585,
    * "invoiceId": [
       * 2525,
       * 12424
      
      ],
    * "externalId": "10174814",
    * "bankAccountNumber": "string",
    * "type": "r",
    * "entryDate": "2019-01-01T00:00:00.000Z",
    * "paymentDate": "2019-01-01T00:00:00.000Z",
    * "amount": 19.95,
    * "distribution": [
       * {
          * "invoiceId": 18585,
          * "type": "capital",
          * "amount": 19.95
         
         }
      
      ],
    * "createdAt": "2019-08-24T14:15:22Z",
    * "updatedAt": "2019-08-24T14:15:22Z"
   
   }

]



GET PAYMENT BY ID

Retrieves payment by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

paymentId
required
integer

ID of the payment


RESPONSES

200

Success

default

Error

get/payments/{paymentId}

Staging

https://api.stage.ktilaskutus.fi/v1/payments/{paymentId}

Production

https://api.ktilaskutus.fi/v1/payments/{paymentId}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "creditorId": 18585,
 * "invoiceId": [
    * 2525,
    * 12424
   
   ],
 * "externalId": "10174814",
 * "bankAccountNumber": "string",
 * "type": "r",
 * "entryDate": "2019-01-01T00:00:00.000Z",
 * "paymentDate": "2019-01-01T00:00:00.000Z",
 * "amount": 19.95,
 * "distribution": [
    * {
       * "invoiceId": 18585,
       * "type": "capital",
       * "amount": 19.95
      
      }
   
   ],
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



UPDATE PAYMENT

Updates given payment.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

paymentId
required
integer

ID of the payment

REQUEST BODY SCHEMA: APPLICATION/JSON



externalId
string [ 1 .. 32 ] characters Nullable

Identifier in the original (external) system.


RESPONSES

200

Success

default

Error

patch/payments/{paymentId}

Staging

https://api.stage.ktilaskutus.fi/v1/payments/{paymentId}

Production

https://api.ktilaskutus.fi/v1/payments/{paymentId}


REQUEST SAMPLES

 * Payload

Content type
application/json
Copy
Expand all Collapse all
{
 * "externalId": "10174814"

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "creditorId": 18585,
 * "invoiceId": [
    * 2525,
    * 12424
   
   ],
 * "externalId": "10174814",
 * "bankAccountNumber": "string",
 * "type": "r",
 * "entryDate": "2019-01-01T00:00:00.000Z",
 * "paymentDate": "2019-01-01T00:00:00.000Z",
 * "amount": 19.95,
 * "distribution": [
    * {
       * "invoiceId": 18585,
       * "type": "capital",
       * "amount": 19.95
      
      }
   
   ],
 * "createdAt": "2019-08-24T14:15:22Z",
 * "updatedAt": "2019-08-24T14:15:22Z"

}



CREATE TRANSFER

Creates new payment transfer between two separate invoices.

AUTHORIZATIONS:

Bearer

REQUEST BODY SCHEMA: APPLICATION/JSON



creditorId
required
integer

ID of the creditor.

reasonCode
required
string

Reason for payment transfer.

Possible values are

 * cn: Credit note transfer.

cn


cn
sourceInvoiceId
required
integer

ID of the source invoice.

targetInvoiceId
required
integer

ID of the target invoice.

amount
required
number <float>

Amount to be transferred.


RESPONSES

200

Success

default

Error

post/payment-transfers

Staging

https://api.stage.ktilaskutus.fi/v1/payment-transfers

Production

https://api.ktilaskutus.fi/v1/payment-transfers


REQUEST SAMPLES

 * Payload

Content type
application/json
Copy
Expand all Collapse all
{
 * "creditorId": 18585,
 * "reasonCode": "cn",
 * "sourceInvoiceId": 18585,
 * "targetInvoiceId": 18585,
 * "amount": 19.95

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "creditorId": 18585,
 * "reasonCode": "cn",
 * "sourceInvoiceId": 18585,
 * "sourcePaymentId": 18585,
 * "targetInvoiceId": 18585,
 * "targetPaymentId": 18585,
 * "amount": 19.95

}



GET TRANSFERS

Retrieves payment transfers based on given filter criteria. By default returns
first page of the payment transfers.

AUTHORIZATIONS:

Bearer

QUERY PARAMETERS

filter
string
Example: filter=id = 1012 and externalId isnotnull

Filter expression

sort
string
Example: sort=id asc, externalId desc

Sort expression

page
string
Default: "1:100"
Example: page=17:50

Paging expression


RESPONSES

200

Success

default

Error

get/payment-transfers

Staging

https://api.stage.ktilaskutus.fi/v1/payment-transfers

Production

https://api.ktilaskutus.fi/v1/payment-transfers


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
[
 * {
    * "id": 18585,
    * "creditorId": 18585,
    * "reasonCode": "cn",
    * "sourceInvoiceId": 18585,
    * "sourcePaymentId": 18585,
    * "targetInvoiceId": 18585,
    * "targetPaymentId": 18585,
    * "amount": 19.95
   
   }

]



GET TRANSFER BY ID

Retrieves payment transfer by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

paymentTransferId
required
integer

ID of the payment transfer


RESPONSES

200

Success

default

Error

get/payment-transfers/{paymentTransferId}

Staging

https://api.stage.ktilaskutus.fi/v1/payment-transfers/{paymentTransferId}

Production

https://api.ktilaskutus.fi/v1/payment-transfers/{paymentTransferId}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 18585,
 * "creditorId": 18585,
 * "reasonCode": "cn",
 * "sourceInvoiceId": 18585,
 * "sourcePaymentId": 18585,
 * "targetInvoiceId": 18585,
 * "targetPaymentId": 18585,
 * "amount": 19.95

}



USERS

User represents any individual who has been granted access to the system.


UPDATE CURRENT USER

Updates current user.

AUTHORIZATIONS:

Bearer

REQUEST BODY SCHEMA: APPLICATION/JSON



password
string >= 6 characters

Password of the user.

firstName
string <= 256 characters Nullable

First name of the user.

lastName
string <= 256 characters Nullable

Last name of the user.

email
string <email> <= 256 characters Nullable

Email address of the user.


RESPONSES

200

Success

default

Error

patch/users/me

Staging

https://api.stage.ktilaskutus.fi/v1/users/me

Production

https://api.ktilaskutus.fi/v1/users/me


REQUEST SAMPLES

 * Payload

Content type
application/json
Copy
Expand all Collapse all
{
 * "password": "myPassword1",
 * "firstName": "Teppo",
 * "lastName": "Testaaja",
 * "email": "user@example.com"

}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 1398,
 * "username": "testuser1",
 * "firstName": "Teppo",
 * "lastName": "Testaaja",
 * "email": "user@example.com",
 * "token": "HvYFZNeJ33eyT5VN",
 * "creditors": [
    * 1001,
    * 1003,
    * 1023
   
   ],
 * "createdAt": "2019-08-24T14:15:22Z"

}



GET CURRENT USER

Retrieves current user.

AUTHORIZATIONS:

Bearer


RESPONSES

200

Success

default

Error

get/users/me

Staging

https://api.stage.ktilaskutus.fi/v1/users/me

Production

https://api.ktilaskutus.fi/v1/users/me


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 1398,
 * "username": "testuser1",
 * "firstName": "Teppo",
 * "lastName": "Testaaja",
 * "email": "user@example.com",
 * "token": "HvYFZNeJ33eyT5VN",
 * "creditors": [
    * 1001,
    * 1003,
    * 1023
   
   ],
 * "createdAt": "2019-08-24T14:15:22Z"

}



MISCELLANEOUS

Miscellaneous.


GET ELECTRONIC INVOICE OPERATORS

Retrieves electronic invoice operators based on given filter criteria. By
default returns first page of the electronic invoice operators.

AUTHORIZATIONS:

Bearer

QUERY PARAMETERS

filter
string
Example: filter=id = 1012 and externalId isnotnull

Filter expression

sort
string
Example: sort=id asc, externalId desc

Sort expression

page
string
Default: "1:100"
Example: page=17:50

Paging expression


RESPONSES

200

Success

default

Error

get/electronicInvoiceOperators

Staging

https://api.stage.ktilaskutus.fi/v1/electronicInvoiceOperators

Production

https://api.ktilaskutus.fi/v1/electronicInvoiceOperators


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
[
 * {
    * "id": 0,
    * "code": "string",
    * "name": "string",
    * "createdAt": "string",
    * "updatedAt": "string"
   
   }

]



GET ELECTRONIC INVOICE OPERATOR BY ID

Retrieves electronic invoice operator by ID.

AUTHORIZATIONS:

Bearer

PATH PARAMETERS

electronicInvoiceOperatorId
required
integer

ID of the electronic invoice operator


RESPONSES

200

Success

default

Error

get/electronicInvoiceOperators/{electronicInvoiceOperatorId}

Staging

https://api.stage.ktilaskutus.fi/v1/electronicInvoiceOperators/{electronicInvoiceOperatorId}

Production

https://api.ktilaskutus.fi/v1/electronicInvoiceOperators/{electronicInvoiceOperatorId}


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "id": 0,
 * "code": "string",
 * "name": "string",
 * "createdAt": "string",
 * "updatedAt": "string"

}



OAUTH2

The OAuth 2.0 authorization framework enables a third-party application to
obtain limited access to an HTTP service, either on behalf of a resource owner
by orchestrating an approval interaction between the resource owner and the HTTP
service, or by allowing the third-party application to obtain access on its own
behalf.

Following grant types are supported:

 * password The Password grant type is used by first-party clients to exchange a
   user's credentials for an access token.


TOKEN ENDPOINT

Retrieves new authentication token.

AUTHORIZATIONS:

Bearer

REQUEST BODY SCHEMA: APPLICATION/X-WWW-FORM-URLENCODED



grant_type
required
string

Specfies the grant type.

password


password
username
required
string

Specfies the username.

password
required
string

Specfies the password.


RESPONSES

200

Success

default

Error

post/oauth/token

Staging

https://api.stage.ktilaskutus.fi/v1/oauth/token

Production

https://api.ktilaskutus.fi/v1/oauth/token


RESPONSE SAMPLES

 * 200
 * default

Content type
application/json
Copy
Expand all Collapse all
{
 * "access_token": "KnN9iY2hG5eruRA2",
 * "token_type": "bearer"

}