Authorization Overview

Retrieves all documents that require authorization for a specific company. This action can only be performed by a user with access to the document with the Authoriser role and only documents currently assigned to the user for authorization will be listed.

This API resource is only available to Premium APPs.

GET authorization?companyId=:Id&type=:type&status=:status

Request details

The get request will contain all information regarding the documents to be authorized for a specific company.

Request Parameters

Property Type Description Optional
companyId Guid Company id. No
status string Status of the documents to be authorized. Possible values are All, ToBeAuthorised and OnHold. By default All is used. Yes
type string Authorization type. Possible values are AfterBooking and BeforeBooking. No

Document collection properties

Property Type Description
Documents Array A list of documents.
_links Array A list of useful preconfigured uri's a client app can use to navigate this resource collection.
_metadata Complex object Optional object with additional information concerning the current returned result.

For details on collections see collection details.

Response complex objects details

Document

Property Type Description
documentId Guid Unique identifier of the document.
comments integer Number of comments.
tag string Details on the tag information of this document, if any.
transactionDate datetime The date of the transaction.
dueDate datetime The date the document is due to.
period string The period of the transaction.
total decimal Total amount.
description string A description of the transaction.
invoiceNumber string The invoice number.
accountCode string The account code.
status string The authorization status.
lines array Transaction lines.
transactionId guid The unique id of the transaction.
relation complex The relationship of the transaction.
currencyCode string The code of the currency used on this transaction.
isCredit boolean States whether it is a credit transaction or not.
project string The project which the transaction is related to.
costCenter string The cost center the transaction is related to.
authorizers array A list of authorizers.
readyToBeAuthorized datetime The date when the transaction is ready to be authorized.
companyId Guid Unique identifier of the company.
lineCount integer The number of lines within this transaction.
authorizersCount integer The number of authorizers on this transaction.
name string The name of the document.
createdOn datetime Created date.

Line

Property Type Description
index integer Index number.
accountCode string Account code.
accountName string Account name.
amount decimal Line amount.
project string Project name.
costCenter string Cost center name.
costUnit string Cost unit name.

Note: currently, supported only on Unit4 companies.

description string Description of the transaction line.

Relation

Property Type Description
id Guid Relation entity id.
name string Entity name.
code string Entity code.

Authorizer

Property Type Description
name string Authorizer name.
action string Action taken by the authorizer in the document authorization flow. Possible values are Authorized, OnHold or null (no action was taken).
type string When the authorizer was assigned. Possible values are AfterBooking or BeforeBooking.

Remarks

For requests with the authorization type BeforeBooking the response won't include the following fields: transactionDate, lineCount, dueDate, period, transactionId, lines, relation, total, accountCode, currencyCode, description, invoiceNumber.

For requests with the authorization type AfterBooking the response won't include the following fields: project, costCenter, costUnit.

Example response:

{
    "documents":[
        {
            "documentId": "bacbc2fe-8569-44f4-9881-11baafa6bd71",
            "comments": 7,
            "tag": "INK",
            "transactionDate": "2014-09-30T00:00:00",
            "dueDate": "2014-10-30T00:00:00",
            "period": "2014/9",
            "total": 338.63,
            "description": "",
            "invoiceNumber": "602442",
            "accountCode": "0990",
            "status": "Booked",
            "lines":[{
                    "index": 1,
                    "accountCode": "0990",
                    "accountName": "Nice account code",
                    "amount": 56.17,
                    "project": null,
                    "costCenter": null,
                    "costUnit": null,
                    "description": "Some line description here"
                },
                {
                    "index": 2,
                    "accountCode": "1001",
                    "accountName": "Nicer account code",
                    "amount": 1.13,
                    "project": "Great Project",
                    "costCenter": "Great Cost Center",
                    "costUnit": "Great Cost Unit/Dossier",
                    "description": "Description is here too"
                }],
            "transactionId": "7n23a8786-55f5-a3df-8569-11baefa6bd92",
            "relation": {
                    "id": "9e0d6fa2-ef7b-4372-b0e7-a8b89e831415",
                    "name": "Some Awesome Company",
                    "code": "1234"
                },
            "currencyCode": "EUR",
            "isCredit": false,
            "project": null,
            "costCenter": null,
            "authorizers":[{
                    "name": "Peter Griffin",
                    "action": "",
                    "type": "BeforeBooking"
                }],
            "readyToBeAuthorized": "2014-10-30T00:00:00",
            "companyId": "2b23a626-da06-4071-a3df-cb0b9cda4c80",
            "lineCount": 1,
            "authorizersCount": 1,
            "name": "The name of the document",
            "createdOn": "2014-10-30T00:00:00"
        },
    "_links": [
        {
            "rel": "self",
            "href": "http://api.basecone.com/authorization?companyId=2b23a626-da06-4071-a3df-cb0b9cda4c80"
        }
    ],
    "_metadata": {
        "total": 1162,
        "count": 5
    }
}

Possible error responses

Status code Error code Details
400 validation_error One or more properties were not valid.
400 invalid_request_payload Request properties are not valid to perform the requested operation.
401 unauthorized User is not authorized to access the resource.
403 forbidden User has no rights to execute the requested operation.
403 forbidden User does not have access to the list of authorization documents