Crunch Invoices API Documentation

invoices-api-service

Overview

Version information

Version : 0.0.1 [v.1]

Tags

  • Attachments
  • PaymentMethodController
  • SalesInvoiceController
  • VatTypeController

Access

  • Base URL: https://public-api.crunch.co.uk/v1/invoices

Paths

Download invoice attachment

Up
get /attachments

Query parameters

invoiceId (required)
Query Parameter — format: int64
attachmentId (required)
Query Parameter — format: int64
fileName (required)
Query Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: update:all

Return type

byte[]

Example data

Content-Type: application/json
""

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Returns the raw content of an invoice's attachment byte[]

Fetch all payment methods

Up
get /payment-methods

Query parameters

direction (required)
Query Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "paymentMethods" : [ {
    "paymentMethodName" : "paymentMethodName",
    "paymentMethodDisplayableName" : "paymentMethodDisplayableName"
  }, {
    "paymentMethodName" : "paymentMethodName",
    "paymentMethodDisplayableName" : "paymentMethodDisplayableName"
  } ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Payment methods are gathered and put to the body of the response PaymentMethodsDto

Delete an invoice

Up
delete /{id}

Path parameters

id (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: delete:all

Return type

Long

Example data

Content-Type: application/json
0

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Invoice is successfully deleted Long

404

Invoice cannot be allocated

400

Invoice cannot be deleted

Get a list of invoices for the authenticated client filtering out template invoices

Up
get /
The default sorting criteria is status,asc,issuedDate,desc,id,desc.

Query parameters

page (optional)
Query Parameter — The index of the page to retrieve, based at 0. format: int32
size (optional)
Query Parameter — Number of records returned per page. Maximum value allowed is 200. default: 20 format: int32
sort (optional)
Query Parameter — Sorting criteria by a given <code>field</code>. format: <field>[,asc|desc]

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "number" : 4,
  "size" : 1,
  "last" : true,
  "numberOfElements" : 1,
  "totalPages" : 0,
  "pageable" : {
    "paged" : true,
    "pageNumber" : 1,
    "offset" : 7,
    "pageSize" : 1,
    "unpaged" : true
  },
  "sort" : {
    "unsorted" : true,
    "sorted" : true,
    "empty" : true
  },
  "content" : [ {
    "issuedDate" : "2000-01-23",
    "netAmount" : 2.3021358869347655,
    "dueDate" : "2000-01-23",
    "deletable" : true,
    "grossAmount" : 9.301444243932576,
    "totalCreditsAmount" : 2.027123023002322,
    "customerName" : "customerName",
    "vatAmount" : 7.061401241503109,
    "reference" : "reference",
    "invoiceNumber" : "invoiceNumber",
    "customerId" : 5,
    "currency" : "AUSTRALIAN_DOLLAR",
    "id" : 5,
    "status" : "status",
    "outstandingBalance" : 3.616076749251911
  }, {
    "issuedDate" : "2000-01-23",
    "netAmount" : 2.3021358869347655,
    "dueDate" : "2000-01-23",
    "deletable" : true,
    "grossAmount" : 9.301444243932576,
    "totalCreditsAmount" : 2.027123023002322,
    "customerName" : "customerName",
    "vatAmount" : 7.061401241503109,
    "reference" : "reference",
    "invoiceNumber" : "invoiceNumber",
    "customerId" : 5,
    "currency" : "AUSTRALIAN_DOLLAR",
    "id" : 5,
    "status" : "status",
    "outstandingBalance" : 3.616076749251911
  } ],
  "first" : true,
  "totalElements" : 6,
  "empty" : true
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

The invoices (if any) for the authenticated client have been found and returned SalesInvoiceStateDtoPage

Get default sales invoice note

Up
get /default-note

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "id" : 4,
  "text" : "text"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Default sales invoice note successfully returned NoteDto

500

An issue getting default sales invoice note

Get invoice totals, taking into account any applied filters

Up
get /filtered-totals

Query parameters

clientId (optional)
Query Parameter — format: int64
status (optional)
Query Parameter
issuedDateStart (optional)
Query Parameter — format: date
issuedDateEnd (optional)
Query Parameter — format: date
dueDateStart (optional)
Query Parameter — format: date
dueDateEnd (optional)
Query Parameter — format: date
recurring (optional)
Query Parameter
invoiceNumber (optional)
Query Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "invoicedSum" : 0.8008281904610115,
  "owedByYouSum" : 1.4658129805029452,
  "owedToYouSum" : 6.027456183070403
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Sales invoice filtered totals successfully returned SalesInvoiceFilteredTotalsDto

400

Filter validation has failed

500

There was an issues getting filtered sales invoice totals

Get sales invoice totals

Up
get /sales-invoice-totals

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "emptyState" : true,
  "outstandingTotal" : 6.027456183070403,
  "salesTotal" : 0.8008281904610115
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Sales invoice totals successfully returned SalesInvoiceTotalsDto

500

There was an issue getting sales invoice totals

View invoice pdf

Up
get /{id}/pdf

Path parameters

id (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

byte[]

Example data

Content-Type: application/json
""

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/pdf

Responses

200

Invoice view is successfully returned byte[]

404

Invoice is not found

Get invoice

Up
get /{id}

Path parameters

id (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "issuedDate" : "2000-01-23",
  "note" : {
    "id" : 4,
    "text" : "text"
  },
  "attachments" : [ {
    "fileName" : "fileName",
    "id" : 9,
    "fileContents" : "fileContents"
  }, {
    "fileName" : "fileName",
    "id" : 9,
    "fileContents" : "fileContents"
  } ],
  "netAmount" : 5.962133916683182,
  "recurring" : true,
  "dueDate" : "2000-01-23",
  "payments" : [ {
    "paymentTarget" : {
      "bankAccount" : {
        "defaultBankAccount" : true,
        "bankName" : "bankName",
        "displayableName" : "displayableName",
        "id" : 7
      },
      "paymentMethod" : {
        "paymentMethodName" : "paymentMethodName",
        "paymentMethodDisplayableName" : "paymentMethodDisplayableName"
      }
    },
    "date" : "2000-01-23",
    "amount" : 1.1730742509559433,
    "reconciled" : true,
    "id" : 6
  }, {
    "paymentTarget" : {
      "bankAccount" : {
        "defaultBankAccount" : true,
        "bankName" : "bankName",
        "displayableName" : "displayableName",
        "id" : 7
      },
      "paymentMethod" : {
        "paymentMethodName" : "paymentMethodName",
        "paymentMethodDisplayableName" : "paymentMethodDisplayableName"
      }
    },
    "date" : "2000-01-23",
    "amount" : 1.1730742509559433,
    "reconciled" : true,
    "id" : 6
  } ],
  "deletable" : true,
  "grossAmount" : 2.3021358869347655,
  "vatAmount" : 5.637376656633329,
  "reference" : "reference",
  "creditNotes" : [ {
    "date" : "2000-01-23",
    "lineItems" : [ {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    }, {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    } ],
    "amount" : 8.762042012749001,
    "id" : 5,
    "state" : "DRAFT",
    "refunds" : [ null, null ]
  }, {
    "date" : "2000-01-23",
    "lineItems" : [ {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    }, {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    } ],
    "amount" : 8.762042012749001,
    "id" : 5,
    "state" : "DRAFT",
    "refunds" : [ null, null ]
  } ],
  "lineItemType" : "SIMPLE",
  "purchaseOrder" : "purchaseOrder",
  "currency" : "currency",
  "payment" : {
    "paymentTerms" : {
      "sendReminders" : true,
      "days" : 9
    }
  },
  "id" : 0,
  "items" : [ {
    "priceExclVat" : 2.027123023002322,
    "amount" : 4.145608029883936,
    "quantity" : 1.2315135367772556,
    "vatAmountDue" : 1.4894159098541704,
    "rate" : 7.386281948385884,
    "vatRate" : "vatRate",
    "description" : "description",
    "vatAmountCharged" : 1.0246457001441578,
    "id" : 3
  }, {
    "priceExclVat" : 2.027123023002322,
    "amount" : 4.145608029883936,
    "quantity" : 1.2315135367772556,
    "vatAmountDue" : 1.4894159098541704,
    "rate" : 7.386281948385884,
    "vatRate" : "vatRate",
    "description" : "description",
    "vatAmountCharged" : 1.0246457001441578,
    "id" : 3
  } ],
  "customer" : {
    "defaultCurrency" : "defaultCurrency",
    "name" : "name",
    "telephone" : "telephone",
    "id" : 6,
    "billingAddress" : {
      "country" : "country",
      "line4" : "line4",
      "postCode" : "postCode",
      "line3" : "line3",
      "line2" : "line2",
      "line1" : "line1"
    },
    "email" : "email",
    "contacts" : [ {
      "role" : "role",
      "includedInEmail" : true,
      "primaryContact" : true,
      "name" : "name",
      "telephone" : "telephone",
      "id" : 1,
      "email" : "email"
    }, {
      "role" : "role",
      "includedInEmail" : true,
      "primaryContact" : true,
      "name" : "name",
      "telephone" : "telephone",
      "id" : 1,
      "email" : "email"
    } ]
  },
  "status" : "status",
  "outstandingBalance" : 7.061401241503109
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Invoice is successfully returned SalesInvoiceDto

404

Invoice is not found for customer

View invoice state

Up
get /{id}/state

Path parameters

id (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "issuedDate" : "2000-01-23",
  "netAmount" : 2.3021358869347655,
  "dueDate" : "2000-01-23",
  "deletable" : true,
  "grossAmount" : 9.301444243932576,
  "totalCreditsAmount" : 2.027123023002322,
  "customerName" : "customerName",
  "vatAmount" : 7.061401241503109,
  "reference" : "reference",
  "invoiceNumber" : "invoiceNumber",
  "customerId" : 5,
  "currency" : "AUSTRALIAN_DOLLAR",
  "id" : 5,
  "status" : "status",
  "outstandingBalance" : 3.616076749251911
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Invoice state is successfully returned SalesInvoiceStateDto

404

Invoice is not found for customer

Issue an invoice

Up
post /{id}/issue

Path parameters

id (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: update:all

Return type

Example data

Content-Type: application/json
{
  "issuedDate" : "2000-01-23",
  "note" : {
    "id" : 4,
    "text" : "text"
  },
  "attachments" : [ {
    "fileName" : "fileName",
    "id" : 9,
    "fileContents" : "fileContents"
  }, {
    "fileName" : "fileName",
    "id" : 9,
    "fileContents" : "fileContents"
  } ],
  "netAmount" : 5.962133916683182,
  "recurring" : true,
  "dueDate" : "2000-01-23",
  "payments" : [ {
    "paymentTarget" : {
      "bankAccount" : {
        "defaultBankAccount" : true,
        "bankName" : "bankName",
        "displayableName" : "displayableName",
        "id" : 7
      },
      "paymentMethod" : {
        "paymentMethodName" : "paymentMethodName",
        "paymentMethodDisplayableName" : "paymentMethodDisplayableName"
      }
    },
    "date" : "2000-01-23",
    "amount" : 1.1730742509559433,
    "reconciled" : true,
    "id" : 6
  }, {
    "paymentTarget" : {
      "bankAccount" : {
        "defaultBankAccount" : true,
        "bankName" : "bankName",
        "displayableName" : "displayableName",
        "id" : 7
      },
      "paymentMethod" : {
        "paymentMethodName" : "paymentMethodName",
        "paymentMethodDisplayableName" : "paymentMethodDisplayableName"
      }
    },
    "date" : "2000-01-23",
    "amount" : 1.1730742509559433,
    "reconciled" : true,
    "id" : 6
  } ],
  "deletable" : true,
  "grossAmount" : 2.3021358869347655,
  "vatAmount" : 5.637376656633329,
  "reference" : "reference",
  "creditNotes" : [ {
    "date" : "2000-01-23",
    "lineItems" : [ {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    }, {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    } ],
    "amount" : 8.762042012749001,
    "id" : 5,
    "state" : "DRAFT",
    "refunds" : [ null, null ]
  }, {
    "date" : "2000-01-23",
    "lineItems" : [ {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    }, {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    } ],
    "amount" : 8.762042012749001,
    "id" : 5,
    "state" : "DRAFT",
    "refunds" : [ null, null ]
  } ],
  "lineItemType" : "SIMPLE",
  "purchaseOrder" : "purchaseOrder",
  "currency" : "currency",
  "payment" : {
    "paymentTerms" : {
      "sendReminders" : true,
      "days" : 9
    }
  },
  "id" : 0,
  "items" : [ {
    "priceExclVat" : 2.027123023002322,
    "amount" : 4.145608029883936,
    "quantity" : 1.2315135367772556,
    "vatAmountDue" : 1.4894159098541704,
    "rate" : 7.386281948385884,
    "vatRate" : "vatRate",
    "description" : "description",
    "vatAmountCharged" : 1.0246457001441578,
    "id" : 3
  }, {
    "priceExclVat" : 2.027123023002322,
    "amount" : 4.145608029883936,
    "quantity" : 1.2315135367772556,
    "vatAmountDue" : 1.4894159098541704,
    "rate" : 7.386281948385884,
    "vatRate" : "vatRate",
    "description" : "description",
    "vatAmountCharged" : 1.0246457001441578,
    "id" : 3
  } ],
  "customer" : {
    "defaultCurrency" : "defaultCurrency",
    "name" : "name",
    "telephone" : "telephone",
    "id" : 6,
    "billingAddress" : {
      "country" : "country",
      "line4" : "line4",
      "postCode" : "postCode",
      "line3" : "line3",
      "line2" : "line2",
      "line1" : "line1"
    },
    "email" : "email",
    "contacts" : [ {
      "role" : "role",
      "includedInEmail" : true,
      "primaryContact" : true,
      "name" : "name",
      "telephone" : "telephone",
      "id" : 1,
      "email" : "email"
    }, {
      "role" : "role",
      "includedInEmail" : true,
      "primaryContact" : true,
      "name" : "name",
      "telephone" : "telephone",
      "id" : 1,
      "email" : "email"
    } ]
  },
  "status" : "status",
  "outstandingBalance" : 7.061401241503109
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Invoice is successfully issued SalesInvoiceDto

404

Invoice is not found for customer

New invoice

Up
post /

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Request body

body SalesInvoiceDto (optional)
Body Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: create:all

Return type

Example data

Content-Type: application/json
{
  "issuedDate" : "2000-01-23",
  "note" : {
    "id" : 4,
    "text" : "text"
  },
  "attachments" : [ {
    "fileName" : "fileName",
    "id" : 9,
    "fileContents" : "fileContents"
  }, {
    "fileName" : "fileName",
    "id" : 9,
    "fileContents" : "fileContents"
  } ],
  "netAmount" : 5.962133916683182,
  "recurring" : true,
  "dueDate" : "2000-01-23",
  "payments" : [ {
    "paymentTarget" : {
      "bankAccount" : {
        "defaultBankAccount" : true,
        "bankName" : "bankName",
        "displayableName" : "displayableName",
        "id" : 7
      },
      "paymentMethod" : {
        "paymentMethodName" : "paymentMethodName",
        "paymentMethodDisplayableName" : "paymentMethodDisplayableName"
      }
    },
    "date" : "2000-01-23",
    "amount" : 1.1730742509559433,
    "reconciled" : true,
    "id" : 6
  }, {
    "paymentTarget" : {
      "bankAccount" : {
        "defaultBankAccount" : true,
        "bankName" : "bankName",
        "displayableName" : "displayableName",
        "id" : 7
      },
      "paymentMethod" : {
        "paymentMethodName" : "paymentMethodName",
        "paymentMethodDisplayableName" : "paymentMethodDisplayableName"
      }
    },
    "date" : "2000-01-23",
    "amount" : 1.1730742509559433,
    "reconciled" : true,
    "id" : 6
  } ],
  "deletable" : true,
  "grossAmount" : 2.3021358869347655,
  "vatAmount" : 5.637376656633329,
  "reference" : "reference",
  "creditNotes" : [ {
    "date" : "2000-01-23",
    "lineItems" : [ {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    }, {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    } ],
    "amount" : 8.762042012749001,
    "id" : 5,
    "state" : "DRAFT",
    "refunds" : [ null, null ]
  }, {
    "date" : "2000-01-23",
    "lineItems" : [ {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    }, {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    } ],
    "amount" : 8.762042012749001,
    "id" : 5,
    "state" : "DRAFT",
    "refunds" : [ null, null ]
  } ],
  "lineItemType" : "SIMPLE",
  "purchaseOrder" : "purchaseOrder",
  "currency" : "currency",
  "payment" : {
    "paymentTerms" : {
      "sendReminders" : true,
      "days" : 9
    }
  },
  "id" : 0,
  "items" : [ {
    "priceExclVat" : 2.027123023002322,
    "amount" : 4.145608029883936,
    "quantity" : 1.2315135367772556,
    "vatAmountDue" : 1.4894159098541704,
    "rate" : 7.386281948385884,
    "vatRate" : "vatRate",
    "description" : "description",
    "vatAmountCharged" : 1.0246457001441578,
    "id" : 3
  }, {
    "priceExclVat" : 2.027123023002322,
    "amount" : 4.145608029883936,
    "quantity" : 1.2315135367772556,
    "vatAmountDue" : 1.4894159098541704,
    "rate" : 7.386281948385884,
    "vatRate" : "vatRate",
    "description" : "description",
    "vatAmountCharged" : 1.0246457001441578,
    "id" : 3
  } ],
  "customer" : {
    "defaultCurrency" : "defaultCurrency",
    "name" : "name",
    "telephone" : "telephone",
    "id" : 6,
    "billingAddress" : {
      "country" : "country",
      "line4" : "line4",
      "postCode" : "postCode",
      "line3" : "line3",
      "line2" : "line2",
      "line1" : "line1"
    },
    "email" : "email",
    "contacts" : [ {
      "role" : "role",
      "includedInEmail" : true,
      "primaryContact" : true,
      "name" : "name",
      "telephone" : "telephone",
      "id" : 1,
      "email" : "email"
    }, {
      "role" : "role",
      "includedInEmail" : true,
      "primaryContact" : true,
      "name" : "name",
      "telephone" : "telephone",
      "id" : 1,
      "email" : "email"
    } ]
  },
  "status" : "status",
  "outstandingBalance" : 7.061401241503109
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

success SalesInvoiceDto

400

Each sales invoice may have a maximum of 5 attachments

Send a sales invoice email

Up
post /{id}/email

Path parameters

id (required)
Path Parameter — format: int64

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Request body

body SalesInvoiceEmailDto (optional)
Body Parameter

Query parameters

attachments (optional)
Query Parameter — default: false

Security

oauth2-authorisation-code
Type: oauth2 Scopes: update:all

Responses

200

Invoice is successfully issued

404

Invoice is not found for customer

500

Internal service error

Update invoice

Up
put /{id}

Path parameters

id (required)
Path Parameter — format: int64

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Request body

body SalesInvoiceDto (optional)
Body Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: update:all

Return type

Example data

Content-Type: application/json
{
  "issuedDate" : "2000-01-23",
  "note" : {
    "id" : 4,
    "text" : "text"
  },
  "attachments" : [ {
    "fileName" : "fileName",
    "id" : 9,
    "fileContents" : "fileContents"
  }, {
    "fileName" : "fileName",
    "id" : 9,
    "fileContents" : "fileContents"
  } ],
  "netAmount" : 5.962133916683182,
  "recurring" : true,
  "dueDate" : "2000-01-23",
  "payments" : [ {
    "paymentTarget" : {
      "bankAccount" : {
        "defaultBankAccount" : true,
        "bankName" : "bankName",
        "displayableName" : "displayableName",
        "id" : 7
      },
      "paymentMethod" : {
        "paymentMethodName" : "paymentMethodName",
        "paymentMethodDisplayableName" : "paymentMethodDisplayableName"
      }
    },
    "date" : "2000-01-23",
    "amount" : 1.1730742509559433,
    "reconciled" : true,
    "id" : 6
  }, {
    "paymentTarget" : {
      "bankAccount" : {
        "defaultBankAccount" : true,
        "bankName" : "bankName",
        "displayableName" : "displayableName",
        "id" : 7
      },
      "paymentMethod" : {
        "paymentMethodName" : "paymentMethodName",
        "paymentMethodDisplayableName" : "paymentMethodDisplayableName"
      }
    },
    "date" : "2000-01-23",
    "amount" : 1.1730742509559433,
    "reconciled" : true,
    "id" : 6
  } ],
  "deletable" : true,
  "grossAmount" : 2.3021358869347655,
  "vatAmount" : 5.637376656633329,
  "reference" : "reference",
  "creditNotes" : [ {
    "date" : "2000-01-23",
    "lineItems" : [ {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    }, {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    } ],
    "amount" : 8.762042012749001,
    "id" : 5,
    "state" : "DRAFT",
    "refunds" : [ null, null ]
  }, {
    "date" : "2000-01-23",
    "lineItems" : [ {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    }, {
      "amount" : 6.683562403749608,
      "itemIndex" : 9,
      "description" : "description",
      "id" : 9
    } ],
    "amount" : 8.762042012749001,
    "id" : 5,
    "state" : "DRAFT",
    "refunds" : [ null, null ]
  } ],
  "lineItemType" : "SIMPLE",
  "purchaseOrder" : "purchaseOrder",
  "currency" : "currency",
  "payment" : {
    "paymentTerms" : {
      "sendReminders" : true,
      "days" : 9
    }
  },
  "id" : 0,
  "items" : [ {
    "priceExclVat" : 2.027123023002322,
    "amount" : 4.145608029883936,
    "quantity" : 1.2315135367772556,
    "vatAmountDue" : 1.4894159098541704,
    "rate" : 7.386281948385884,
    "vatRate" : "vatRate",
    "description" : "description",
    "vatAmountCharged" : 1.0246457001441578,
    "id" : 3
  }, {
    "priceExclVat" : 2.027123023002322,
    "amount" : 4.145608029883936,
    "quantity" : 1.2315135367772556,
    "vatAmountDue" : 1.4894159098541704,
    "rate" : 7.386281948385884,
    "vatRate" : "vatRate",
    "description" : "description",
    "vatAmountCharged" : 1.0246457001441578,
    "id" : 3
  } ],
  "customer" : {
    "defaultCurrency" : "defaultCurrency",
    "name" : "name",
    "telephone" : "telephone",
    "id" : 6,
    "billingAddress" : {
      "country" : "country",
      "line4" : "line4",
      "postCode" : "postCode",
      "line3" : "line3",
      "line2" : "line2",
      "line1" : "line1"
    },
    "email" : "email",
    "contacts" : [ {
      "role" : "role",
      "includedInEmail" : true,
      "primaryContact" : true,
      "name" : "name",
      "telephone" : "telephone",
      "id" : 1,
      "email" : "email"
    }, {
      "role" : "role",
      "includedInEmail" : true,
      "primaryContact" : true,
      "name" : "name",
      "telephone" : "telephone",
      "id" : 1,
      "email" : "email"
    } ]
  },
  "status" : "status",
  "outstandingBalance" : 7.061401241503109
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Invoice is successfully updated SalesInvoiceDto

404

Invoice is not found for customer

Fetch all vat types

Up
get /vat-types

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "vatTypes" : [ {
    "displayName" : "displayName",
    "vatPercent" : 0
  }, {
    "displayName" : "displayName",
    "vatPercent" : 0
  } ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

VAT types are gathered and put to the body of the response VatTypesDto

Models

[ Jump to Methods ]

Table of Contents

  1. AddressDto
  2. BankAccountDto
  3. CreditNoteDto
  4. CreditNoteLineItemDto
  5. CustomerContactDto
  6. CustomerDto
  7. CustomerPaymentDto
  8. NoteDto
  9. Pageable
  10. PaymentDto
  11. PaymentMethodDto
  12. PaymentMethodsDto
  13. PaymentTargetDto
  14. PaymentTermsDto
  15. Resource
  16. SalesInvoiceAttachmentDto
  17. SalesInvoiceDto
  18. SalesInvoiceEmailDto
  19. SalesInvoiceFilteredTotalsDto
  20. SalesInvoiceLineItemDto
  21. SalesInvoiceStateDto
  22. SalesInvoiceStateDtoPage
  23. SalesInvoiceTotalsDto
  24. Sort
  25. VatTypeDto
  26. VatTypesDto

AddressDto Up

line1 (optional)
line2 (optional)
line3 (optional)
line4 (optional)
postCode (optional)
country (optional)

BankAccountDto Up

id (optional)
Long format: int64
bankName
displayableName
defaultBankAccount (optional)

CreditNoteDto Up

id (optional)
Long format: int64
date (optional)
date format: date
lineItems (optional)
amount (optional)
refunds (optional)
state (optional)
Enum:
DRAFT
ISSUED
SETTLED

CreditNoteLineItemDto Up

id (optional)
Long format: int64
itemIndex (optional)
Integer format: int32
description (optional)
amount (optional)

CustomerContactDto Up

id (optional)
Long format: int64
name (optional)
role (optional)
telephone (optional)
email (optional)
includedInEmail (optional)
primaryContact (optional)

CustomerDto Up

id (optional)
Long format: int64
name (optional)
defaultCurrency (optional)
telephone (optional)
email (optional)
billingAddress (optional)
contacts (optional)

CustomerPaymentDto Up

id (optional)
Long format: int64
paymentTarget (optional)
amount (optional)
date (optional)
date format: date
reconciled (optional)

NoteDto Up

id (optional)
Long format: int64
text (optional)

Pageable Up

offset (optional)
Long format: int64
sort (optional)
paged (optional)
unpaged (optional)
pageSize (optional)
Integer format: int32
pageNumber (optional)
Integer format: int32

PaymentDto Up

paymentTerms (optional)

PaymentMethodDto Up

paymentMethodName (optional)
paymentMethodDisplayableName (optional)

PaymentMethodsDto Up

paymentMethods (optional)

PaymentTargetDto Up

paymentMethod (optional)
bankAccount (optional)

PaymentTermsDto Up

days (optional)
Integer format: int32
sendReminders (optional)

Resource Up

open (optional)
file (optional)
byte[] format: binary
readable (optional)
url (optional)
String format: url
description (optional)
uri (optional)
String format: uri
filename (optional)
contentAsByteArray (optional)
array[byte[]] format: byte
inputStream (optional)

SalesInvoiceAttachmentDto Up

id (optional)
Long format: int64
fileName (optional)
fileContents (optional)

SalesInvoiceDto Up

id (optional)
Long format: int64
customer (optional)
issuedDate (optional)
date format: date
dueDate (optional)
date format: date
currency (optional)
recurring (optional)
reference (optional)
lineItemType (optional)
Enum:
SIMPLE
DETAILED
netAmount (optional)
vatAmount (optional)
grossAmount (optional)
status (optional)
outstandingBalance (optional)
payment (optional)
items (optional)
payments (optional)
deletable (optional)
note (optional)
purchaseOrder (optional)
creditNotes (optional)
bankAccount (optional)
attachments (optional)

SalesInvoiceEmailDto Up

emailAddresses (optional)
subject (optional)
message (optional)

SalesInvoiceFilteredTotalsDto Up

invoicedSum (optional)
owedToYouSum (optional)
owedByYouSum (optional)

SalesInvoiceLineItemDto Up

id (optional)
Long format: int64
description (optional)
priceExclVat (optional)
amount (optional)
rate (optional)
vatRate (optional)
quantity (optional)
vatAmountCharged (optional)
vatAmountDue (optional)

SalesInvoiceStateDto Up

id (optional)
Long format: int64
invoiceNumber (optional)
customerName (optional)
reference (optional)
customerId (optional)
Long format: int64
netAmount (optional)
vatAmount (optional)
grossAmount (optional)
currency (optional)
Enum:
AUSTRALIAN_DOLLAR
CANADIAN_DOLLAR
EURO
POUND_STERLING
UNITED_STATES_DOLLAR
status (optional)
outstandingBalance (optional)
totalCreditsAmount (optional)
issuedDate (optional)
date format: date
dueDate (optional)
date format: date
deletable (optional)

SalesInvoiceStateDtoPage Up

totalPages (optional)
Integer format: int32
totalElements (optional)
Long format: int64
size (optional)
Integer format: int32
content (optional)
number (optional)
Integer format: int32
sort (optional)
last (optional)
pageable (optional)
numberOfElements (optional)
Integer format: int32
first (optional)
empty (optional)

SalesInvoiceTotalsDto Up

salesTotal (optional)
outstandingTotal (optional)
emptyState (optional)

Sort Up

empty (optional)
sorted (optional)
unsorted (optional)

VatTypeDto Up

displayName (optional)
vatPercent (optional)
Integer format: int32

VatTypesDto Up

vatTypes (optional)