Client API Documentation

Overview

Version information

Version : 0.0.1 [v.1]

Tags

  • ClientsController

Paths

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

Create new customer

POST /

Parameters

Type Name Schema
Body body
optional
CustomerDto

Responses

HTTP Code Description Schema
200 New customer was created CustomerDto

Tags

  • ClientsController

Security

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

Example HTTP request

Request path
/
Request body
{
  "billingAddress" : {
    "country" : "string",
    "line1" : "string",
    "line2" : "string",
    "line3" : "string",
    "line4" : "string",
    "postCode" : "string"
  },
  "email" : "string",
  "id" : 0,
  "name" : "string",
  "note" : {
    "id" : 0,
    "text" : "string"
  },
  "paymentTermsDays" : 0
}

Example HTTP response

Response 200
{
  "billingAddress" : {
    "country" : "string",
    "line1" : "string",
    "line2" : "string",
    "line3" : "string",
    "line4" : "string",
    "postCode" : "string"
  },
  "email" : "string",
  "id" : 0,
  "name" : "string",
  "note" : {
    "id" : 0,
    "text" : "string"
  },
  "paymentTermsDays" : 0
}

Get all Clients for the current user in a paged format

GET /clients

Description

The default sorting criterion is companyName,asc.

Parameters

Type Name Description Schema Default
Query page
optional
The index of the page to retrieve, based at 0. integer (int32)
Query size
optional
Number of records returned per page. Maximum value allowed is 200. integer (int32) 20
Query sort
optional
Sorting criteria by a given field. < string (<field>[,asc|desc]) > array(multi)

Responses

HTTP Code Description Schema
200 Clients are successfully returned PageCustomerDto

Produces

  • application/json

Tags

  • ClientsController

Security

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

Example HTTP request

Request path
/clients

Example HTTP response

Response 200
{
  "content" : [ {
    "billingAddress" : {
      "country" : "string",
      "line1" : "string",
      "line2" : "string",
      "line3" : "string",
      "line4" : "string",
      "postCode" : "string"
    },
    "email" : "string",
    "id" : 0,
    "name" : "string",
    "note" : {
      "id" : 0,
      "text" : "string"
    },
    "paymentTermsDays" : 0
  } ],
  "empty" : true,
  "first" : true,
  "last" : true,
  "number" : 0,
  "numberOfElements" : 0,
  "pageable" : {
    "offset" : 0,
    "pageNumber" : 0,
    "pageSize" : 0,
    "paged" : true,
    "sort" : {
      "empty" : true,
      "sorted" : true,
      "unsorted" : true
    },
    "unpaged" : true
  },
  "size" : 0,
  "sort" : {
    "empty" : true,
    "sorted" : true,
    "unsorted" : true
  },
  "totalElements" : 0,
  "totalPages" : 0
}

Deprecated! Please use /list instead.

GET /clients/list

Responses

HTTP Code Description Schema
200 Customers are successfully returned < CustomerDto > array

Tags

  • ClientsController

Security

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

Example HTTP request

Request path
/clients/list

Example HTTP response

Response 200
[ {
  "billingAddress" : {
    "country" : "string",
    "line1" : "string",
    "line2" : "string",
    "line3" : "string",
    "line4" : "string",
    "postCode" : "string"
  },
  "email" : "string",
  "id" : 0,
  "name" : "string",
  "note" : {
    "id" : 0,
    "text" : "string"
  },
  "paymentTermsDays" : 0
} ]

Get all Clients for the current user in a single list

GET /list

Responses

HTTP Code Description Schema
200 Customers are successfully returned < CustomerDto > array

Tags

  • ClientsController

Security

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

Example HTTP request

Request path
/list

Example HTTP response

Response 200
[ {
  "billingAddress" : {
    "country" : "string",
    "line1" : "string",
    "line2" : "string",
    "line3" : "string",
    "line4" : "string",
    "postCode" : "string"
  },
  "email" : "string",
  "id" : 0,
  "name" : "string",
  "note" : {
    "id" : 0,
    "text" : "string"
  },
  "paymentTermsDays" : 0
} ]

Get all customer details for a customer

GET /{id}

Parameters

Type Name Schema
Path id
required
integer (int64)

Responses

HTTP Code Description Schema
200 Customer details found and successfully returned CustomerDto
404 Customer details not found No Content
500 An issue getting the Customer details occurred No Content

Tags

  • ClientsController

Security

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

Example HTTP request

Request path
/0

Example HTTP response

Response 200
{
  "billingAddress" : {
    "country" : "string",
    "line1" : "string",
    "line2" : "string",
    "line3" : "string",
    "line4" : "string",
    "postCode" : "string"
  },
  "email" : "string",
  "id" : 0,
  "name" : "string",
  "note" : {
    "id" : 0,
    "text" : "string"
  },
  "paymentTermsDays" : 0
}

Create new customer

PUT /{id}

Parameters

Type Name Schema
Path id
required
integer (int64)
Body body
optional
CustomerDto

Responses

HTTP Code Description Schema
200 Customer details successfully updated CustomerDto
404 Customer details not found No Content
500 An issue updating the Customer details occurred No Content

Produces

  • application/json

Tags

  • ClientsController

Security

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

Example HTTP request

Request path
/0
Request body
{
  "billingAddress" : {
    "country" : "string",
    "line1" : "string",
    "line2" : "string",
    "line3" : "string",
    "line4" : "string",
    "postCode" : "string"
  },
  "email" : "string",
  "id" : 0,
  "name" : "string",
  "note" : {
    "id" : 0,
    "text" : "string"
  },
  "paymentTermsDays" : 0
}

Example HTTP response

Response 200
{
  "billingAddress" : {
    "country" : "string",
    "line1" : "string",
    "line2" : "string",
    "line3" : "string",
    "line4" : "string",
    "postCode" : "string"
  },
  "email" : "string",
  "id" : 0,
  "name" : "string",
  "note" : {
    "id" : 0,
    "text" : "string"
  },
  "paymentTermsDays" : 0
}

Definitions

AddressDto

Name Description Schema
country
optional
Length : 0 - 50
Example : "string"
string
line1
optional
Length : 0 - 150
Example : "string"
string
line2
optional
Length : 0 - 150
Example : "string"
string
line3
optional
Length : 0 - 150
Example : "string"
string
line4
optional
Length : 0 - 150
Example : "string"
string
postCode
optional
Length : 0 - 8
Example : "string"
string

CustomerDto

Name Description Schema
billingAddress
optional
Example : "[addressdto](#addressdto)" AddressDto
email
optional
Example : "string" string
id
optional
Example : 0 integer (int64)
name
optional
Example : "string" string
note
optional
Example : "[notedto](#notedto)" NoteDto
paymentTermsDays
optional
Example : 0 integer (int32)

NoteDto

Name Description Schema
id
optional
Example : 0 integer (int64)
text
optional
Example : "string" string

PageCustomerDto

Name Description Schema
content
optional
Example : [ "[customerdto](#customerdto)" ] < CustomerDto > array
empty
optional
Example : true boolean
first
optional
Example : true boolean
last
optional
Example : true boolean
number
optional
Example : 0 integer (int32)
numberOfElements
optional
Example : 0 integer (int32)
pageable
optional
Example : "[pageable](#pageable)" Pageable
size
optional
Example : 0 integer (int32)
sort
optional
Example : "[sort](#sort)" Sort
totalElements
optional
Example : 0 integer (int64)
totalPages
optional
Example : 0 integer (int32)

Pageable

Name Description Schema
offset
optional
Example : 0 integer (int64)
pageNumber
optional
Example : 0 integer (int32)
pageSize
optional
Example : 0 integer (int32)
paged
optional
Example : true boolean
sort
optional
Example : "[sort](#sort)" Sort
unpaged
optional
Example : true boolean

Sort

Name Description Schema
empty
optional
Example : true boolean
sorted
optional
Example : true boolean
unsorted
optional
Example : true boolean