Saf-t PT suportado

Invoic€xpress

  • PT
  • EN
API

sequences.create

Creates a new sequence.

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

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

Example xml to be submitted with sequence data:

<?xml version="1.0" encoding="UTF-8"?>
<sequence>
 <serie>2009</serie>
 <current_invoice_number>3</current_invoice_number>
 <current_credit_note_number>1</current_credit_note_number>
 <current_debit_note_number>1</current_debit_note_number>
 <default_sequence>1</default_sequence>
</sequence>

Parameters

Parameters are the data you will pass with the call.

api_key

Your secret identifier. Your API Key is on Account Overview in the Account section.
Rules: Required

serie

Series name.
Rules: Required

current_invoice_number

Current invoice number for this sequence. Must be a number equal or greater than 0.
Rules: Required.

current_credit_note_number

Current credit note number for this sequence. Must be a number equal or greater than 0.
Rules: Required.

current_debit_note_number

Current debit note number for this sequence. Must be a number equal or greater than 0.
Rules: Required.

default_sequence

If “1″, this sequence is chosen as the default sequence on your account.Other values are ignored.
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

<?xml version="1.0" encoding="UTF-8"?>
<sequence>
  <id>1</id>
  <serie>0001</serie>
  <current_invoice_number>3</current_invoice_number>
  <current_credit_note_number>1</current_credit_note_number>
  <current_debit_note_number>1</current_debit_note_number>
  <default_sequence>1</default_sequence>
  <!-- default sequence -->
</sequence>

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>Serie has already been taken</error>
</errors>
<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Current number is not a number</error>
</errors>
<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Credit note: is not a number</error>
</errors>
<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Credit note: must be greater than or equal to 0</error>
</errors>
<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Debit note: is not a number</error>
</errors>
<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Debit note: must be greater than or equal to 0</error>
</errors>