For the complete documentation index, see llms.txt. This page is also available as Markdown.

Customers

Beta Release

Index

List customers

get
Query parameters
enterprise_idstringOptional
Responses
200

Customers list

application/json
get/api/v1/customers
GET /api/v1/customers HTTP/1.1
Accept: */*
200

Customers list

{
  "data": [
    {
      "id": "1",
      "type": "customer",
      "attributes": {
        "id": 1,
        "enterprise_id": 2,
        "first_name": "Alice",
        "last_name": "Springs",
        "code": "BUYER1",
        "email": "alice@example.com",
        "allow_charges": false,
        "tags": [
          "staff",
          "discount"
        ],
        "terms_and_conditions_accepted_at": "2022-03-12T15:55:00.000+11:00",
        "billing_address": null,
        "shipping_address": {
          "phone": "0404 333 222 111",
          "latitude": -37.8173751,
          "longitude": 144.964803195704,
          "first_name": "Alice",
          "last_name": "Springs",
          "street_address_1": "1 Flinders Street",
          "street_address_2": "",
          "postal_code": "1234",
          "locality": "Melbourne",
          "region": {
            "code": "Vic",
            "name": "Victoria"
          },
          "country": {
            "code": "AU",
            "name": "Australia"
          }
        }
      },
      "relationships": {
        "enterprise": {
          "data": {
            "id": "text",
            "type": "enterprise"
          },
          "links": {
            "related": "text"
          }
        }
      }
    }
  ],
  "meta": {
    "pagination": {
      "results": 250,
      "pages": 5,
      "page": 2,
      "per_page": 50
    }
  },
  "links": {
    "self": "text",
    "first": "text",
    "prev": "text",
    "next": "text",
    "last": "text"
  }
}

Code Examples

Show

Show customer

get
Path parameters
idstringRequired
Responses
200

Customer

application/json
metaobjectOptional
linksobjectOptional
get/api/v1/customers/{id}
GET /api/v1/customers/{id} HTTP/1.1
Accept: */*
{
  "data": {
    "id": "1",
    "type": "customer",
    "attributes": {
      "id": 1,
      "enterprise_id": 2,
      "first_name": "Alice",
      "last_name": "Springs",
      "code": "BUYER1",
      "email": "alice@example.com",
      "allow_charges": false,
      "tags": [
        "staff",
        "discount"
      ],
      "terms_and_conditions_accepted_at": "2022-03-12T15:55:00.000+11:00",
      "billing_address": null,
      "shipping_address": {
        "phone": "0404 333 222 111",
        "latitude": -37.8173751,
        "longitude": 144.964803195704,
        "first_name": "Alice",
        "last_name": "Springs",
        "street_address_1": "1 Flinders Street",
        "street_address_2": "",
        "postal_code": "1234",
        "locality": "Melbourne",
        "region": {
          "code": "Vic",
          "name": "Victoria"
        },
        "country": {
          "code": "AU",
          "name": "Australia"
        }
      }
    },
    "relationships": {
      "enterprise": {
        "data": {
          "id": "text",
          "type": "enterprise"
        },
        "links": {
          "related": "text"
        }
      }
    }
  },
  "meta": {},
  "links": {}
}

Code Examples

Create

Create customer

post
Body
enterprise_idintegerRequiredExample: 2
first_namestring · nullableOptionalExample: Alice
last_namestring · nullableOptionalExample: Springs
codestring · nullableOptionalExample: BUYER1
emailstringRequiredExample: alice@example.com
tagsstring[]OptionalExample: ["staff","discount"]
billing_addressobject · nullableOptional
shipping_addressobject · nullableOptionalExample: {"phone":"0404 333 222 111","latitude":-37.8173751,"longitude":144.964803195704,"first_name":"Alice","last_name":"Springs","street_address_1":"1 Flinders Street","street_address_2":"","postal_code":"1234","locality":"Melbourne","region":{"code":"Vic","name":"Victoria"},"country":{"code":"AU","name":"Australia"}}
Responses
201

Example customer created

application/json
metaobjectOptional
linksobjectOptional
post/api/v1/customers
POST /api/v1/customers HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 490

{
  "enterprise_id": 2,
  "first_name": "Alice",
  "last_name": "Springs",
  "code": "BUYER1",
  "email": "alice@example.com",
  "tags": [
    "staff",
    "discount"
  ],
  "billing_address": null,
  "shipping_address": {
    "phone": "0404 333 222 111",
    "latitude": -37.8173751,
    "longitude": 144.964803195704,
    "first_name": "Alice",
    "last_name": "Springs",
    "street_address_1": "1 Flinders Street",
    "street_address_2": "",
    "postal_code": "1234",
    "locality": "Melbourne",
    "region": {
      "code": "Vic",
      "name": "Victoria"
    },
    "country": {
      "code": "AU",
      "name": "Australia"
    }
  }
}
{
  "data": {
    "id": "1",
    "type": "customer",
    "attributes": {
      "id": 1,
      "enterprise_id": 2,
      "first_name": "Alice",
      "last_name": "Springs",
      "code": "BUYER1",
      "email": "alice@example.com",
      "allow_charges": false,
      "tags": [
        "staff",
        "discount"
      ],
      "terms_and_conditions_accepted_at": "2022-03-12T15:55:00.000+11:00",
      "billing_address": null,
      "shipping_address": {
        "phone": "0404 333 222 111",
        "latitude": -37.8173751,
        "longitude": 144.964803195704,
        "first_name": "Alice",
        "last_name": "Springs",
        "street_address_1": "1 Flinders Street",
        "street_address_2": "",
        "postal_code": "1234",
        "locality": "Melbourne",
        "region": {
          "code": "Vic",
          "name": "Victoria"
        },
        "country": {
          "code": "AU",
          "name": "Australia"
        }
      }
    },
    "relationships": {
      "enterprise": {
        "data": {
          "id": "text",
          "type": "enterprise"
        },
        "links": {
          "related": "text"
        }
      }
    }
  },
  "meta": {},
  "links": {}
}

Code Examples

Update

Update customer

put
Path parameters
idstringRequired
Body
enterprise_idintegerRequiredExample: 2
first_namestring · nullableOptionalExample: Alice
last_namestring · nullableOptionalExample: Springs
codestring · nullableOptionalExample: BUYER1
emailstringRequiredExample: alice@example.com
tagsstring[]OptionalExample: ["staff","discount"]
billing_addressobject · nullableOptional
shipping_addressobject · nullableOptionalExample: {"phone":"0404 333 222 111","latitude":-37.8173751,"longitude":144.964803195704,"first_name":"Alice","last_name":"Springs","street_address_1":"1 Flinders Street","street_address_2":"","postal_code":"1234","locality":"Melbourne","region":{"code":"Vic","name":"Victoria"},"country":{"code":"AU","name":"Australia"}}
Responses
200

Customer updated

application/json
metaobjectOptional
linksobjectOptional
put/api/v1/customers/{id}
PUT /api/v1/customers/{id} HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 490

{
  "enterprise_id": 2,
  "first_name": "Alice",
  "last_name": "Springs",
  "code": "BUYER1",
  "email": "alice@example.com",
  "tags": [
    "staff",
    "discount"
  ],
  "billing_address": null,
  "shipping_address": {
    "phone": "0404 333 222 111",
    "latitude": -37.8173751,
    "longitude": 144.964803195704,
    "first_name": "Alice",
    "last_name": "Springs",
    "street_address_1": "1 Flinders Street",
    "street_address_2": "",
    "postal_code": "1234",
    "locality": "Melbourne",
    "region": {
      "code": "Vic",
      "name": "Victoria"
    },
    "country": {
      "code": "AU",
      "name": "Australia"
    }
  }
}
{
  "data": {
    "id": "1",
    "type": "customer",
    "attributes": {
      "id": 1,
      "enterprise_id": 2,
      "first_name": "Alice",
      "last_name": "Springs",
      "code": "BUYER1",
      "email": "alice@example.com",
      "allow_charges": false,
      "tags": [
        "staff",
        "discount"
      ],
      "terms_and_conditions_accepted_at": "2022-03-12T15:55:00.000+11:00",
      "billing_address": null,
      "shipping_address": {
        "phone": "0404 333 222 111",
        "latitude": -37.8173751,
        "longitude": 144.964803195704,
        "first_name": "Alice",
        "last_name": "Springs",
        "street_address_1": "1 Flinders Street",
        "street_address_2": "",
        "postal_code": "1234",
        "locality": "Melbourne",
        "region": {
          "code": "Vic",
          "name": "Victoria"
        },
        "country": {
          "code": "AU",
          "name": "Australia"
        }
      }
    },
    "relationships": {
      "enterprise": {
        "data": {
          "id": "text",
          "type": "enterprise"
        },
        "links": {
          "related": "text"
        }
      }
    }
  },
  "meta": {},
  "links": {}
}

Destroy

Delete customer

delete
Path parameters
idstringRequired
Responses
200

Customer deleted

application/json
metaobjectOptional
linksobjectOptional
delete/api/v1/customers/{id}
DELETE /api/v1/customers/{id} HTTP/1.1
Accept: */*
200

Customer deleted

{
  "data": {
    "id": "1",
    "type": "customer",
    "attributes": {
      "id": 1,
      "enterprise_id": 2,
      "first_name": "Alice",
      "last_name": "Springs",
      "code": "BUYER1",
      "email": "alice@example.com",
      "allow_charges": false,
      "tags": [
        "staff",
        "discount"
      ],
      "terms_and_conditions_accepted_at": "2022-03-12T15:55:00.000+11:00",
      "billing_address": null,
      "shipping_address": {
        "phone": "0404 333 222 111",
        "latitude": -37.8173751,
        "longitude": 144.964803195704,
        "first_name": "Alice",
        "last_name": "Springs",
        "street_address_1": "1 Flinders Street",
        "street_address_2": "",
        "postal_code": "1234",
        "locality": "Melbourne",
        "region": {
          "code": "Vic",
          "name": "Victoria"
        },
        "country": {
          "code": "AU",
          "name": "Australia"
        }
      }
    },
    "relationships": {
      "enterprise": {
        "data": {
          "id": "text",
          "type": "enterprise"
        },
        "links": {
          "related": "text"
        }
      }
    }
  },
  "meta": {},
  "links": {}
}

Code Examples

Last updated