Customer API (1.0)

Download OpenAPI specification:

Customer REST API Documentation

Register a customer

Register a customer

Request Body schema: application/json
required

the customer data (identifier must be null)

id
integer
firstName
required
string non-empty
lastName
required
string non-empty
email
required
string <email>
required
object (Address)
required
object (CreditCard)

Responses

Request samples

Content type
application/json
{
  • "firstName": "Alice",
  • "lastName": "Smith",
  • "email": "alice@example.org",
  • "address": {
    },
  • "creditCard": {
    }
}

Response samples

Content type
application/json
{
  • "id": 215,
  • "firstName": "Alice",
  • "lastName": "Smith",
  • "email": "alice@example.org",
  • "address": {
    },
  • "creditCard": {
    }
}

Search for customers

Search for customers

query Parameters
name
required
string
Example: name=smith

the name to search for

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Find a customer

Find a customer

path Parameters
id
required
integer
Example: 217

the customer identifier

Responses

Response samples

Content type
application/json
{
  • "id": 217,
  • "firstName": "Alice",
  • "lastName": "Smith",
  • "email": "alice@example.org",
  • "address": {
    },
  • "creditCard": {
    }
}

Update a customer

Update a customer

path Parameters
id
required
integer
Example: 215

the customer identifier

Request Body schema: application/json
required

the new customer data (identifier must match path parameter)

id
integer
firstName
required
string non-empty
lastName
required
string non-empty
email
required
string <email>
required
object (Address)
required
object (CreditCard)

Responses

Request samples

Content type
application/json
{
  • "id": 215,
  • "firstName": "Alice",
  • "lastName": "Smith",
  • "email": "smith@example.org",
  • "address": {
    },
  • "creditCard": {
    }
}

Response samples

Content type
application/json
{
  • "id": 215,
  • "firstName": "Alice",
  • "lastName": "Smith",
  • "email": "smith@example.org",
  • "address": {
    },
  • "creditCard": {
    }
}