### GET /v4/rest/financial-report-bundle/{id} Source: https://api.waya.se/v4/rest/swagger//swagger.json API endpoint for GET /v4/rest/financial-report-bundle/{id} ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/financial-report-bundle/{id}" ``` ``` -------------------------------- ### GET /v4/rest/boarding/{boardingId}/document/{documentId}/attachment/{attachmentId}/file Source: https://api.waya.se/v4/rest/swagger//swagger.json API endpoint for GET /v4/rest/boarding/{boardingId}/document/{documentId}/attachment/{attachmentId}/file ```markdown ### Parameters - **boardingId** (string, path, required) - **documentId** (string, path, required) - **attachmentId** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/boarding/{boardingId}/document/{documentId}/attachment/{attachmentId}/file" ``` ``` -------------------------------- ### GET /v4/rest/boarding/{boardingId}/document/{documentId}/pdf Source: https://api.waya.se/v4/rest/swagger//swagger.json API endpoint for GET /v4/rest/boarding/{boardingId}/document/{documentId}/pdf ```markdown ### Parameters - **boardingId** (string, path, required) - **documentId** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/boarding/{boardingId}/document/{documentId}/pdf" ``` ``` -------------------------------- ### GET /v4/rest/credit/{id} Source: https://api.waya.se/v4/rest/swagger//swagger.json API endpoint for GET /v4/rest/credit/{id} ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/credit/{id}" ``` ``` -------------------------------- ### GET /v4/rest/financial-report/{id}/file Source: https://api.waya.se/v4/rest/swagger//swagger.json API endpoint for GET /v4/rest/financial-report/{id}/file ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/financial-report/{id}/file" ``` ``` -------------------------------- ### GET /v4/rest/financial-report-bundle/{id}/costs Source: https://api.waya.se/v4/rest/swagger//swagger.json API endpoint for GET /v4/rest/financial-report-bundle/{id}/costs ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/financial-report-bundle/{id}/costs" ``` ``` -------------------------------- ### GET /v4/rest/boarding/{id} Source: https://api.waya.se/v4/rest/swagger//swagger.json Retrieves an ongoing or completed boarding of a new creditor. ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/boarding/{id}" ``` ``` -------------------------------- ### POST /v4/rest/invoice Source: https://api.waya.se/v4/rest/swagger//swagger.json Create invoices. ## Debtor **NOTE** For valid formats of national identifiers, as well as a list of valid debtors to use when testing in non-production environments, see [lookup using national identifier](#get-/v4/rest/legal-entity/-country-code-/-national-identification-number-). The minimum information needed about the debtor is their personal identification number or organization number. If no address is given, their registered address will be used: ```json "debtor": { "nationalIdentifier": { "number": "5590127725", "countryCode": "SE" } } ``` To send the invoice to a foreign debtor or to another address than their registered address, include an address: ```json "debtor": { "nationalIdentifier": { "number": "5590127725", "countryCode": "SE" }, "name": "Waya Technology AB", "billingAddress": { "lines": [ "Lilla Bommen 1" ], "postalCode": "41104", "city": "Göteborg", "countryCode": "SE" }, "type": "ORGANIZATION" } ``` ## Invoice rows A row without any price can be used as a comment or to add additional information to the invoice: ```json "rows": [ { "text": "A text line without any price" } ] ``` A discount can either be specified on a row itself using either `discountTotal` or `discountPercentage`. For example, this will create a row with a total price of 3,200.00 (` = (800.00 × 4 - 200.00) × 1.25`): ```json "rows": [ { "text": "Consultation services", "unit": "h", "unitPrice": 800.00, "quantity": 4, "vatPercentage": 25.0, "discountTotal": 200.00, "priceExcludingVat": true } ] ``` ```markdown ### Parameters - **body** (NewInvoice, body, optional) ### Responses #### 201 - Success Empty response body #### 400 - Error Error ### Example Usage ```bash curl -X POST "https://api.example.com/v4/rest/invoice" ``` ``` -------------------------------- ### GET /v4/rest/invoice/{id} Source: https://api.waya.se/v4/rest/swagger//swagger.json API endpoint for GET /v4/rest/invoice/{id} ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/invoice/{id}" ``` ``` -------------------------------- ### PUT /v4/rest/invoice/{id}/pdf Source: https://api.waya.se/v4/rest/swagger//swagger.json Set the original invoice PDF that will be available for the debtor online as well as printed on the back of reminders, debt collection letters and similar. Note that if the system generated and sent the original PDF, i.e. the invoice was created by specifying `sendAs` to `INVOICE`, the PDF cannot be replaced. ## Notable error codes |HTTP|Code|Description| |:--|:--|:--| |400|319-3-42|Invalid file type| |400|319-2-45|Invalid invoice state - Request requires the invoice to be in another state, for example when trying to delete an invoice but it has already been sent to the debtor.| ```markdown ### Parameters - **id** (string, path, required) - **pdf** (string (binary), body, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X PUT "https://api.example.com/v4/rest/invoice/{id}/pdf" ``` ``` -------------------------------- ### API Overview: Invoice Tools API Source: https://api.waya.se/v4/rest/swagger//swagger.json Waya/Inkassogram invoice and tools API. Client side code can be generated using the Swagger/OpenAPI specification, see more information [here](https://swagger.io/tools/swagger-codegen/). --- ## Standard definitions - Country codes in [ISO 3166-1 alpha 2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2), for example `SE`. - Language codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). Note: `sv`=Swedish, `se`=Northern Sami. - Currency codes in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217), for example `SEK`. - Dates and timestamps in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), for example `2020-12-31` for dates and `2020-12-31T20:30:00+01:00` for timestamps. Assumes UTC for timestamps in requests if no timezone given. --- ## API modifications New fields will be added to both request and response models when needed, but no new mandatory fields will be added without prior notice. To avoid problems when new fields are added to responses, ensure the client code does not throw errors when unexpected fields are detected. New values for enums might also be added when needed. Ensure these unexpected values can still be handled without error. For example, if generating Java code using the Swagger generator, the config `enumUnknownDefaultCase` can be set to true in order to automatically add an extra enum value that will be used for unexpected future enum values returned by the API. --- ## Error handling When there is an error, a unique error code will be returned which can be referenced when contacting our support for quicker help. However, the first part of the error code, for example `319-2-4`, can be used to programmatically identify different errors. As a rule of thumb, errors starting with `319-2` are caused by user input and those starting with `319-3` are due to malformed API requests. Example error response, details fields may be null: ```json { "errorCode": "319-2-4-1704965684", "message": "Not found", "details": "No invoice with that ID" } ``` Defined error codes: |HTTP|Code|Description| |:--|:--|:--| |400|319-3-1|Schema validation error| |500|319-1-2|Unexpected error, try again - Try again in a little while, if the problem persists then contact Waya's technical support.| |400|319-3-3|Unsupported - Request required features no longer supported by the system or features no longer enabled for integration or client.| |404|319-2-4|Not found| |401|319-2-5|Unauthorized| |403|319-2-46|Forbidden resource - Valid authentication, but making a request not allow by current permissions set on integration.| |400|319-2-6|Already exists - When creating a resource, a resource with specified ID already exists.| |400|319-3-46|Inactive channel - If invoice channel is not active yet or has been disabled and thus cannot accept invoices.| |400|319-2-7|Invalid debtor - Debtor is not valid, usually due to invalid national identifier.| |400|319-2-8|Blocked debtor| |400|319-3-9|Delivery method unavailable for creditor| |400|319-2-10|Delivery method unavailable for debtor - Usually due to delivery method requiring debtor to opt in.| |400|319-3-11|Invalid invoice date| |400|319-3-12|Invalid due date| |400|319-3-13|Invalid delivery date| |400|319-3-14|Missing email address| |400|319-2-15|Invalid email address| |400|319-2-16|Blocked email address| |400|319-2-17|Invalid email CC address| |400|319-2-18|Invalid email BCC address| |400|319-3-19|Missing phone number| |400|319-2-20|Invalid phone number| |400|319-2-21|Invalid discount| |400|319-3-22|Sum row validation error| |400|319-3-23|Sum total validation error| |400|319-2-24|Price too low| |400|319-2-25|Price too high| |400|319-3-26|Row mismatch| |400|319-3-27|Invoice not found - When referencing an invalid invoice in a request.| |400|319-2-32|Invalid currency| |400|319-2-33|Invalid exchange rate| |400|319-3-36|Invalid process step| |400|319-3-37|Invalid country| |400|319-2-38|Credit limit reached| |400|319-3-39|Invalid fee| |400|319-3-40|Invalid interest| |400|319-3-41|Invalid file size| |400|319-3-42|Invalid file type| |400|319-3-43|Invalid file hash| |400|319-2-44|Invalid reservation| |400|319-2-45|Invalid invoice state - Request requires the invoice to be in another state, for example when trying to delete an invoice but it has already been sent to the debtor.| |400|319-2-47|Invalid attachment - One or more of the PDF attachments are invalid| |400|319-2-48|Invalid tax reduction row - One or more of the tax reduction rows are invalid| |400|319-2-49|Fraud protection - Individual is marked for fraud protected and care should be taken to ensure the identity of the individual| |400|319-2-50|Deregistered or deleted - Legal entity has been deleted or deregistered in national registry| |400|319-2-51|Invalid legal entity - Legal entity exists, but data cannot be retrieved from national registry due to their status| --- ## Invoice delivery methods There are multiple ways to deliver debits and credits to the debtor. Only some delivery methods might be available, depending on configuration. | Name | Description | | :--- | :--- | | `DO_NOT_SEND` | Will generate a PDF, but not distribute it to the debtor. Invoice PDF can be downloaded and distributed using a 3rd party. | | `EXTERNAL` | Does not generate a PDF. Integration creates and distributes their own version of the invoice. | | `EMAIL` | Distributes as email. | | `POSTAL` | Distributes as letter. | | `E_INVOICE_COMPANY` | Only if debor is an organization, distributes directly to the debtor's ERP system. Sends using given GLN, otherwise tries using their national identifier. | | `E_INVOICE_BANK` | Distributes directly to the debtor's bank, but only if the debtor has opted in. | | `E_INVOICE` | Combination of `E_INVOICE_BANK` and `E_INVOICE_COMPANY`, trying them in that order. | | `DIGITAL_MAILBOX` | Distributes to digital mailbox. | | `DYNAMIC` | Lets the system find an appropriate delivery method for the specific debtor. | --- ## Process status All process steps are categorized into four general types: `INVOICE`, `DUNNING`, `COLLECTION` and `ENFORCEMENT`. Depending on product, country and creditor configuration, the invoice might have multiple dunning or collection steps. While new country-specific steps may be introduced, no additional general types will be added. Integrations should therefore handle statuses by evaluating the general type if an unrecognized, more country-specific step is returned by the API. | Specific | General | Description | | :--- | :--- | :--- | | `EXTERNAL_INVOICE` | `INVOICE` | Invoice was not created in Waya's system until it was overdue and next step might be either dunning or collection. | | `INVOICE` | `INVOICE` | | | `REMINDER` | `DUNNING` | | | `DEBT_COLLECTION` | `COLLECTION` | | | `FINAL_NOTICE` | `COLLECTION` | | | `KFM` | `ENFORCEMENT` | Kronofogdemyndigheten - Case has been handed over to the Swedish enforcement agency. | | `3PC` | `COLLECTION` | Third party collection - Case has been handed over to a third party for collection. | --- ## Entity IDs Entity IDs exposed by the API are guaranteed to be unique within the same entity type only. For example, invoice IDs are unique among invoices even if created by different integrations or creditors, but may collide with IDs of other entity types such as credits or financial reports. --- ## Webhooks The system can send webhooks to an integration-defined endpoint whenever an entity is created or updated. As each webhook contains identifiers only, the receiving system is expected to fetch the full and current state of the entity via the API. Example payload of invoice webhook: ```json { "type": "INVOICE", "id": "oWh_LNipaGQ", "creditorId": "QYKrdNSAw-c" } ``` | Field | Description | | :--- | :--- | | `type` | Type of entity that was created or modified. Possible values are: `INVOICE`, `CREDIT`, `FINANCIAL_REPORT`, `FINANCIAL_REPORT_BUNDLE`. Each entity type can be configured to be sent to a specific endpoint or excluded entirely. Newly introduced webhook types are opt-in and will not be delivered to existing integrations by default. | | `id` | The ID of the invoice, credit, etc. | | `creditorId` | The ID of the creditor/client the entity belongs to. Necessary if the integration has access to multiple creditors. | Static headers and/or additional static fields can be configured. ```yaml # Invoice Tools API # Version: 1.0.0 Waya/Inkassogram invoice and tools API. Client side code can be generated using the Swagger/OpenAPI specification, see more information [here](https://swagger.io/tools/swagger-codegen/). --- ## Standard definitions - Country codes in [ISO 3166-1 alpha 2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2), for example `SE`. - Language codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). Note: `sv`=Swedish, `se`=Northern Sami. - Currency codes in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217), for example `SEK`. - Dates and timestamps in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), for example `2020-12-31` for dates and `2020-12-31T20:30:00+01:00` for timestamps. Assumes UTC for timestamps in requests if no timezone given. --- ## API modifications New fields will be added to both request and response models when needed, but no new mandatory fields will be added without prior notice. To avoid problems when new fields are added to responses, ensure the client code does not throw errors when unexpected fields are detected. New values for enums might also be added when needed. Ensure these unexpected values can still be handled without error. For example, if generating Java code using the Swagger generator, the config `enumUnknownDefaultCase` can be set to true in order to automatically add an extra enum value that will be used for unexpected future enum values returned by the API. --- ## Error handling When there is an error, a unique error code will be returned which can be referenced when contacting our support for quicker help. However, the first part of the error code, for example `319-2-4`, can be used to programmatically identify different errors. As a rule of thumb, errors starting with `319-2` are caused by user input and those starting with `319-3` are due to malformed API requests. Example error response, details fields may be null: ```json { "errorCode": "319-2-4-1704965684", "message": "Not found", "details": "No invoice with that ID" } ``` Defined error codes: |HTTP|Code|Description| |:--|:--|:--| |400|319-3-1|Schema validation error| |500|319-1-2|Unexpected error, try again - Try again in a little while, if the problem persists then contact Waya's technical support.| |400|319-3-3|Unsupported - Request required features no longer supported by the system or features no longer enabled for integration or client.| |404|319-2-4|Not found| |401|319-2-5|Unauthorized| |403|319-2-46|Forbidden resource - Valid authentication, but making a request not allow by current permissions set on integration.| |400|319-2-6|Already exists - When creating a resource, a resource with specified ID already exists.| |400|319-3-46|Inactive channel - If invoice channel is not active yet or has been disabled and thus cannot accept invoices.| |400|319-2-7|Invalid debtor - Debtor is not valid, usually due to invalid national identifier.| |400|319-2-8|Blocked debtor| |400|319-3-9|Delivery method unavailable for creditor| |400|319-2-10|Delivery method unavailable for debtor - Usually due to delivery method requiring debtor to opt in.| |400|319-3-11|Invalid invoice date| |400|319-3-12|Invalid due date| |400|319-3-13|Invalid delivery date| |400|319-3-14|Missing email address| |400|319-2-15|Invalid email address| |400|319-2-16|Blocked email address| |400|319-2-17|Invalid email CC address| |400|319-2-18|Invalid email BCC address| |400|319-3-19|Missing phone number| |400|319-2-20|Invalid phone number| |400|319-2-21|Invalid discount| |400|319-3-22|Sum row validation error| |400|319-3-23|Sum total validation error| |400|319-2-24|Price too low| |400|319-2-25|Price too high| |400|319-3-26|Row mismatch| |400|319-3-27|Invoice not found - When referencing an invalid invoice in a request.| |400|319-2-32|Invalid currency| |400|319-2-33|Invalid exchange rate| |400|319-3-36|Invalid process step| |400|319-3-37|Invalid country| |400|319-2-38|Credit limit reached| |400|319-3-39|Invalid fee| |400|319-3-40|Invalid interest| |400|319-3-41|Invalid file size| |400|319-3-42|Invalid file type| |400|319-3-43|Invalid file hash| |400|319-2-44|Invalid reservation| |400|319-2-45|Invalid invoice state - Request requires the invoice to be in another state, for example when trying to delete an invoice but it has already been sent to the debtor.| |400|319-2-47|Invalid attachment - One or more of the PDF attachments are invalid| |400|319-2-48|Invalid tax reduction row - One or more of the tax reduction rows are invalid| |400|319-2-49|Fraud protection - Individual is marked for fraud protected and care should be taken to ensure the identity of the individual| |400|319-2-50|Deregistered or deleted - Legal entity has been deleted or deregistered in national registry| |400|319-2-51|Invalid legal entity - Legal entity exists, but data cannot be retrieved from national registry due to their status| --- ## Invoice delivery methods There are multiple ways to deliver debits and credits to the debtor. Only some delivery methods might be available, depending on configuration. | Name | Description | | :--- | :--- | | `DO_NOT_SEND` | Will generate a PDF, but not distribute it to the debtor. Invoice PDF can be downloaded and distributed using a 3rd party. | | `EXTERNAL` | Does not generate a PDF. Integration creates and distributes their own version of the invoice. | | `EMAIL` | Distributes as email. | | `POSTAL` | Distributes as letter. | | `E_INVOICE_COMPANY` | Only if debor is an organization, distributes directly to the debtor's ERP system. Sends using given GLN, otherwise tries using their national identifier. | | `E_INVOICE_BANK` | Distributes directly to the debtor's bank, but only if the debtor has opted in. | | `E_INVOICE` | Combination of `E_INVOICE_BANK` and `E_INVOICE_COMPANY`, trying them in that order. | | `DIGITAL_MAILBOX` | Distributes to digital mailbox. | | `DYNAMIC` | Lets the system find an appropriate delivery method for the specific debtor. | --- ## Process status All process steps are categorized into four general types: `INVOICE`, `DUNNING`, `COLLECTION` and `ENFORCEMENT`. Depending on product, country and creditor configuration, the invoice might have multiple dunning or collection steps. While new country-specific steps may be introduced, no additional general types will be added. Integrations should therefore handle statuses by evaluating the general type if an unrecognized, more country-specific step is returned by the API. | Specific | General | Description | | :--- | :--- | :--- | | `EXTERNAL_INVOICE` | `INVOICE` | Invoice was not created in Waya's system until it was overdue and next step might be either dunning or collection. | | `INVOICE` | `INVOICE` | | | `REMINDER` | `DUNNING` | | | `DEBT_COLLECTION` | `COLLECTION` | | | `FINAL_NOTICE` | `COLLECTION` | | | `KFM` | `ENFORCEMENT` | Kronofogdemyndigheten - Case has been handed over to the Swedish enforcement agency. | | `3PC` | `COLLECTION` | Third party collection - Case has been handed over to a third party for collection. | --- ## Entity IDs Entity IDs exposed by the API are guaranteed to be unique within the same entity type only. For example, invoice IDs are unique among invoices even if created by different integrations or creditors, but may collide with IDs of other entity types such as credits or financial reports. --- ## Webhooks The system can send webhooks to an integration-defined endpoint whenever an entity is created or updated. As each webhook contains identifiers only, the receiving system is expected to fetch the full and current state of the entity via the API. Example payload of invoice webhook: ```json { "type": "INVOICE", "id": "oWh_LNipaGQ", "creditorId": "QYKrdNSAw-c" } ``` | Field | Description | | :--- | :--- | | `type` | Type of entity that was created or modified. Possible values are: `INVOICE`, `CREDIT`, `FINANCIAL_REPORT`, `FINANCIAL_REPORT_BUNDLE`. Each entity type can be configured to be sent to a specific endpoint or excluded entirely. Newly introduced webhook types are opt-in and will not be delivered to existing integrations by default. | | `id` | The ID of the invoice, credit, etc. | | `creditorId` | The ID of the creditor/client the entity belongs to. Necessary if the integration has access to multiple creditors. | Static headers and/or additional static fields can be configured. # Base URL: Not specified ``` -------------------------------- ### GET /v4/rest/invoice Source: https://api.waya.se/v4/rest/swagger//swagger.json Returns empty array and status code 200 if no results. ```markdown ### Parameters - **id** (string, query, optional) - **externalNumber** (string, query, optional) - **ocr** (string, query, optional) - **updatedSince** (string, query, optional): filter invoices updated after specified ISO timestamp - **pageNumber** (string, query, optional) - **pageSize** (string, query, optional) ### Responses #### 200 - Success Empty response body ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/invoice?id=value&externalNumber=value&ocr=value&updatedSince=value&pageNumber=value&pageSize=value" ``` ``` -------------------------------- ### GET /v4/rest/legal-entity/{country-code}/{national-identification-number} Source: https://api.waya.se/v4/rest/swagger//swagger.json Lookup of address given a national identifier in the same way as is automatically done when creating an invoice. ## National identifier format At leasts the following formats may be used in requests: - Swedish individuals - `YYYYMMDDNNNC` - `YYYYMMDD-NNNC` - `YYMMDDNNNC`, assumes age of individual is less than 100 years - `YYMMDD-NNNC`, assumes age of individual is less than 100 years - `YYMMDD+NNNC`, assumes age of individual is 100 years or more - Swedish organizations - `XXXXXXNNNC` - `XXXXXX-NNNC` - `16XXXXXXNNNC`, as `16` is usually used as prefix in order to store organizations with same length as an individuals in some systems - `YYMMDDNNNC` (or any other valid format for Swedish individual), sole proprietorship (enskild firma) - `YYMMDDNNNCXXXXX`, sole proprietorship (enskild firma), format usually used if individual has more than one ## Testing In non-production environments, only mocked individuals and a small subset of real organizations can be used, for example: - Swedish individuals: 194107102222, 194107161111, 194109061111, 194111142222, 194112271111, 194201232222, 194201312222, 194202281111, 194203052222, 194203212222, 194205112222, 194207311111, 194301021111. - Swedish organizations: 5560000043, 5560000241, 5560000365, 5560000472, 5560000753, 5560001033, 5560001348, 5560001439, 5560001629, 5560001975, 5560001991, 5560002221, 5560002296, 5560002320. Waya can provide a list of additional national identifiers if needed. ## Examples respones Example response for individual: ```json { "status": "NORMAL", "nationalIdentifier": { "number": "194811252222", "countryCode": "SE" }, "type": "INDIVIDUAL", "firstName": "Barbro", "lastName": "Lindberg", "givenName": "Barbro Lindberg", "address": { "lines": [ "Storgatan 12A" ], "postalCode": "21611", "city": "LIMHAMN", "countryCode": "SE" } } ``` Example response for organization: ```json { "status": "NORMAL", "nationalIdentifier": { "number": "5560139700", "countryCode": "SE" }, "type": "ORGANIZATION", "companyName": "Volvo Lastvagnar Aktiebolag", "address": { "postalCode": "40508", "city": "GÖTEBORG", "countryCode": "SE" } } ``` ## Special cases - Protected address (`PROTECTED`) Indicates the individual has a protected address. For Sweden, Skatteverket's address is returned instead of the individual's. *Example (test environment):* (SE) 19400427-9107 - Deceased (`DECEASED`) Indicates the individual is deceased. No address is returned. *Example (test environment):* (SE) 19441011-9046 - Emigrated (`EMIGRATED`) Indicates the individual has emigrated. Their new foreign address is included if available. *Example (test environment):* (SE) 19790702-2391 - Changed National Identifier (`CHANGED_NIN`) Indicates the individual has received a new national identifier. The new identifier is returned; no address is included. *Example (test environment):* (SE) 19460907-3277 ## Notable error codes |HTTP|Code|Description| |:--|:--|:--| |400|319-2-49|Fraud protection - Individual is marked for fraud protected and care should be taken to ensure the identity of the individual| |400|319-2-50|Deregistered or deleted - Legal entity has been deleted or deregistered in national registry| |400|319-2-51|Invalid legal entity - Legal entity exists, but data cannot be retrieved from national registry due to their status| ```markdown ### Parameters - **country-code** (string, path, required): Country code for national identification number - **national-identification-number** (string, path, required): National identification number - **type** (string, query, optional): Optional hint to force search of specific type, for example to differentiate between an individual and their sole proprietorship (enskilda firma) ### Responses #### 200 - Success Empty response body #### 400 - Error Error #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/legal-entity/{country-code}/{national-identification-number}?type=value" ``` ``` -------------------------------- ### GET /v4/rest/credit Source: https://api.waya.se/v4/rest/swagger//swagger.json Returns empty array and status code 200 if no results. ```markdown ### Parameters - **id** (string, query, optional) - **externalNumber** (string, query, optional) - **debitId** (string, query, optional) - **pageNumber** (string, query, optional) - **pageSize** (string, query, optional) ### Responses #### 200 - Success Empty response body ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/credit?id=value&externalNumber=value&debitId=value&pageNumber=value&pageSize=value" ``` ``` -------------------------------- ### GET /v4/rest/boarding/{boardingId}/document/{documentId}/signature Source: https://api.waya.se/v4/rest/swagger//swagger.json Retrieves the signatures for a specific boarding document. ```markdown ### Parameters - **boardingId** (string, path, required) - **documentId** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/boarding/{boardingId}/document/{documentId}/signature" ``` ``` -------------------------------- ### GET /v4/rest/financial-report Source: https://api.waya.se/v4/rest/swagger//swagger.json Returns empty array and status code 200 if no results. ```markdown ### Parameters - **type** (string, query, optional) - **since** (string, query, optional): filter reports created after specified ISO timestamp - **pageNumber** (string, query, optional) - **pageSize** (string, query, optional) ### Responses #### 200 - Success Empty response body ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/financial-report?type=value&since=value&pageNumber=value&pageSize=value" ``` ``` -------------------------------- ### GET /v4/rest/invoice/{id}/pdf Source: https://api.waya.se/v4/rest/swagger//swagger.json Retrives the original invoice PDF. If the invoice was created by specifying `sendAs` to something else than `INVOICE`, the original invoice PDF must have been specified as an attachment when creating it. Otherwise, the invoice PDF will be created once it is sent to the debtor by the system. Note that if the invoice has not yet been sent to the debtor, the PDF might not yet be possible to fetch and give a 404 response code. ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/invoice/{id}/pdf" ``` ``` -------------------------------- ### GET /v4/rest/creditor/{id} Source: https://api.waya.se/v4/rest/swagger//swagger.json Retrieves information about a specific creditor. ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/creditor/{id}" ``` ``` -------------------------------- ### GET /v4/rest/invoice/{id}/payment-details Source: https://api.waya.se/v4/rest/swagger//swagger.json Gives the payment details the debtor should use in order to pay the invoice. Note that the accounts to pay to might change depending on the invoice's process status. ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X GET "https://api.example.com/v4/rest/invoice/{id}/payment-details" ``` ``` -------------------------------- ### PUT /v4/rest/invoice/{id}/finalize Source: https://api.waya.se/v4/rest/swagger//swagger.json Sends a reserved invoice. If the invoice was created with `sendAs` = `INVOICE`, it will be scheduled to be sent to the debtor as soon as possible. For other values of `sendAs`, it might take a few days for it to be distributed depending on configuration. ## Notable error codes |HTTP|Code|Description| |:--|:--|:--| |400|319-2-45|Invalid invoice state - Request requires the invoice to be in another state, for example when trying to delete an invoice but it has already been sent to the debtor.| ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X PUT "https://api.example.com/v4/rest/invoice/{id}/finalize" ``` ``` -------------------------------- ### DELETE /v4/rest/invoice/{id} Source: https://api.waya.se/v4/rest/swagger//swagger.json Only invoices that are still marked as reservations can be deleted. Once it has been finalized, it must be credited instead. ## Notable error codes |HTTP|Code|Description| |:--|:--|:--| |400|319-2-45|Invalid invoice state - Request requires the invoice to be in another state, for example when trying to delete an invoice but it has already been sent to the debtor.| ```markdown ### Parameters - **id** (string, path, required) ### Responses #### 200 - Success Empty response body #### 404 - Error Error ### Example Usage ```bash curl -X DELETE "https://api.example.com/v4/rest/invoice/{id}" ``` ``` -------------------------------- ### GET /v4/rest/legal-entity/{country-code}/{national-identification-number}/credit-check Source: https://api.waya.se/v4/rest/swagger//swagger.json