API-v1

Application Programming Interface

InvoiceXpress Documentation



Update


accounts.update

Updates account data.

Usage

You call this method by submitting an HTTP PUT request to the following URL with the account data in the request body:

https://{account-name}.app.invoicexpress.com/api/accounts/{account-id}/update.xml
  </pre>
</div>
<div id="json-endpoint" class="tab-pane fade">
  <pre>

https://{account-name}.app.invoicexpress.com/api/accounts/{account-id}/update.json
  </pre>
</div>
Header

XML: Content-Type: application/xml; charset=utf-8

JSON: Content-Type: application/json; charset=utf-8

Body
<account><organization_name>SWAT</organization_name> <fiscal_id>508025339</fiscal_id> <address>Saldanha</address> <postal_code>1500-555</postal_code> <city>Lisboa</city> <email>swat@weareswat.com</email> <terms>1</terms> <credentials><username>123456789/1</username> <password>cGFzc3dvcmQ=</password> <context>Sequences</context> <type>AT</type></credentials></account>
{
  "account": {
    "organization_name": "SWAT",
    "fiscal_id": "508025339",
    "address": "Saldanha",
    "postal_code": "1500-555",
    "city": "Lisboa",
    "email": "swat@weareswat.com",
    "terms": 1,
    "credentials": {
      "username": "123456789/1",
      "password": "cGFzc3dvcmQ=",
      "context": "Sequences",
      "type": "AT"
    }
  }
}
  </pre>
</div>

Parameters

Parameters are the data you will pass with the call.

Name Type Required Description
account Object Required Account data to be created
first_name String The user’s first name.
last_name String The user’s last name.
organization_name String Required The name of the company.
phone String The account phone number.
email String Required The account email.
password String Required The account password.
fiscal_id String The company fiscal ID (vat number). The fiscal_id, if present, must be unique in the system.
tax_country String The account country. Options: 1 (Portugal); 2 (Ireland); 3 (UK). See the Appendix for more countries.
language String The account language. Options: pt (Portuguese); en (English); es (Spanish).
terms String Required The terms and conditions. Options: 1 (Accepted); 0 (Not accepted).
marketing String Signing up to receive the marketing newsletter. Options: 1 (Accepted); 0 (Not accepted).
credentials Object Object that contains details about the credentials to be configured.
username String Required if credentials is present Credentials username. Must be in the format 123456789/X.
Regex: (^\d{9}/)
password String Required if credentials is present Credentials password. Must be encoded in Base64.
type String Institution the credentials will be used for. Case sensitive. Defaults to AT.

Possible values:
- AT
context String Context of the credentials. Case sensitive. Defaults to Sequences.

Possible values:
- Sequences

Return Values

These are the results that will be returned on success and error.

Success
HTTP: 200 OK
Error

In case of error it will return one of the following error codes:

Code Description
HTTP: 401 Access denied The API Key parameter is missing or is incorrectly entered.
HTTP: 404 Not Found The account doesn't exist.
HTTP: 422 Unprocessable Entity Some parameters sent were incorrect. See below for possible errors.

Possible Errors for HTTP: 422

<errors>
 <error>Postal Code must have the following format DDDD-DDD</error>
</errors>
<errors>
 <error>Vat Number can't be changed</error>
</errors>
<errors>
  <error>Vat Number is already used in another account</error>
</errors>
<errors>
  <error>Username is not valid.</error>
</errors>
<errors>
  <error>Password is not valid.</error>
</errors>
<errors>
  <error>Username doesn't match required format.</error>
</errors>
<errors>
  <error>Credential type is invalid.</error>
</errors>
<errors>
  <error>Credential context is invalid.</error>
</errors>

Engenharia e Design ao seu serviço!

Uma equipa de Engenharia e Produto que pensam, desenham e executam em detalhe cada pormenor da experiência dos utilizadores.

Uma equipa ao seu dispor que trabalha diariamente para si.

Conhecer o InvoiceXpress