Saf-t PT suportado

Invoic€xpress

  • PT
  • EN
API

clients.create

Creates a new client.

You call this method submitting an HTTP POST request to the following URL with the xml data of the new client information on the request body:

https://screen-name.invoicexpress.net/clients.xml

Example xml to be submitted with client data:

<client>
  <name>Bruce Norris</name>
  <email>foo@bar.com</email>
  <address>Badgad</address>
  <postal_code>120213920139</postal_code>
  <country>Germany</country>
  <fiscal_id>12</fiscal_id>
  <website>www.brucenorris.com</website>
  <phone>2313423424</phone>
  <fax>2313423425</fax>
  <preferred_contact>
    <name>Bruce Norris</name>
    <email>foo@bar.com</email>
    <phone>2233442233</phone>
  </preferred_contact>
  <observations>Computer Processed</observations>
  <send_options>1</send_options>
</client>

Parameters

Parameters are the data you will pass with the call.

api_key

Your secret identifier. You find your API Key under Account Overview in the Account section.
Rules: Required

name

Client name, normally used for a company name.
Rules: Required

email

Client email, normally used for a company email.
Rules: Optional. Must be a valid email address ex:foo@bar.com

address

Client address, normally used for a company address.
Rules:Optional.

postal_code

Postal code, normally used for a company postal code.
Rules: Optional.

country

Country, normally used for a company country. Although country is optional, when supplied, it should match one of the country list. Rules: Optional.

fiscal_id

Client fiscal id.
Rules: Optional.

website

Client website.
Rules: Optional.

phone

Client phone number, normally used for a company phone number.
Rules: Optional.

fax

Client fax number, normally used for a company fax number.
Rules: Optional.

preferred contact / name

Name of the preferred contact on your new client.
Rules: Optional.

preferred contact / email

Email of the preferred contact on your new client.
Rules: Optional. Must be a valid email address ex:foo@bar.com

preferred contact / phone

Phone number of the preferred contact on your new client.
Rules: Optional.

observations

Client default observations, this is added to the observations field on all the invoices sent to this client.
Rules: Optional.

send_options

This are the send options for the client. Available options are:

  • 1 - send only the original document
  • 2 – the original and duplicate
  • 3 – the original, duplicate and triplicate
  • 4 – the original, duplicate, triplicate and quadriplicate

These affect the generated pdf.

Rules: Optional.

Return Values

This is the result that will be passed back to you when you have sent a call.

Success

HTTP : 201 CREATED

<client>
  <id>1</id>
  <name>Bruce Norris</name>
  <email>foo@bar.com</email>
  <address>Badgad</address>
  <postal_code>120213920139</postal_code>
  <country>Germany</country>
  <fiscal_id>12</fiscal_id>
  <website>www.brucenorris.com</website>
  <phone>2313423424</phone>
  <fax>2313423425</fax>
  <preferred_contact>
    <name>Bruce Norris</name>
    <email>foo@bar.com</email>
    <phone>2233442233</phone>
  </preferred_contact>
  <observations>Computer Processed</observations>
  <send_options>1</send_options>
</client>

Error

HTTP: 401 Access denied
The API Key parameter is missing or incorrect.
HTTP: 422 Unprocessable Entity
Some parameters were incorrect.

Possible errors:

<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Name has already been taken</error>
  <error>Client contact is invalid</error>
  <error>Send options is not a number</error>
  <error>Send options must be within 1 and 3</error>
  <error>Preferred contact: email must be an email</error>
</errors>
<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Country Germani was not found</error>
</errors>