Back to Aligni.com

GET /api/v2/:api_token/customer
List customers.

Retrieve the list of all customers.

Examples

# request
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/customer

# response
<?xml version="1.0" encoding="UTF-8"?>
<customers>
  <customer>
    <id>4</id>
    <name>Markus, Inc.</name>
    <email></email>
    <discount>10.00</discount>
    <tax_identification_number>12-3456789</tax_identification_number>
    <account_number>1234</account_number>
    <credit_terms></credit_terms>
    <credit_limit></credit_limit>
    <payment_method></payment_method>
    <contacts>
      <contact>
        <id>1</id>
      <contact>
    </contacts>
  </customer>
  ...
</customers>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String

GET /api/v2/:api_token/customer/:id
Show a customer.

Retrieve one particular customer by its id.

Examples

# request
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/customer/4

# response
<?xml version="1.0" encoding="UTF-8"?>
<customer>
  <id>4</id>
  <name>Markus, Inc.</name>
  <email></email>
  <discount>10.00</discount>
  <tax_identification_number>12-3456789</tax_identification_number>
  <account_number>1234</account_number>
  <credit_terms></credit_terms>
  <credit_limit></credit_limit>
  <payment_method></payment_method>
  <contacts>
    <contact>
      <id>1</id>
    <contact>
  </contacts>
</customer>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Value: Must be a number.

POST /api/v2/:api_token/customer
Create a new customer.

Also see show action for detailed XML customer response example.

Create a new customer.

Examples

# request
curl -X POST -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<customer>
  <name>Markus, Inc.</name>
  <email>boss@example.com</email>
  <discount>10.00</discount>
  <tax_identification_number>12-3456789</tax_identification_number>
  <account_number>1234</account_number>
  <credit_terms></credit_terms>
  <credit_limit></credit_limit>
  <payment_method></payment_method>
</customer>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/customer

# response (for detailed customer XML see show action)
<customer>
  ...
</customer>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String

PUT /api/v2/:api_token/customer/:id
Update a customer.

Also see show action for detailed XML customer response example.

Updates a customer record.

Examples

# request
curl -X PUT -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<customer>
  <name>Markus, Inc.</name>
  <email>manager@example.com</email>
</customer>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/customer/4

# response (for detailed customer XML see show action)
<customer>
  ...
</customer>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Value: Must be a number.

DELETE /api/v2/:api_token/customer/:id
Delete a customer.

Delete a customer by its id.

Examples

# request
curl -X DELETE -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/customer/4

# no response

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Value: Must be a number.