API

Application Programming Interface

InvoiceXpress Documentation



Create


sequences.create

Creates a new sequence.

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


    https://{account-name}.app.invoicexpress.com/sequences.xml
      

    https://{account-name}.app.invoicexpress.com/sequences.json
      
Header

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

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

Body
<sequence> <serie>2015</serie> <default_sequence>1</default_sequence> </sequence>

    {
      "sequence": {
        "serie": "2015",
        "default_sequence": "1"
      }
    }
      

Parameters

Parameters are the data you will pass with the call.

Parameter Required Description
api_key Yes Your secret identifier. You can find your API Key under Account >> API in the Account section.
serie Yes Series name
default_sequence No If “1”, this sequence is chosen as the default sequence on your account. Other values are ignored.

Return Values

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

Success
HTTP: 201 CREATED
<sequence> <id>144832</id> <serie>2015</serie> <default_sequence>1</default_sequence> <current_invoice_number>0</current_invoice_number> <current_invoice_sequence_id>144832</current_invoice_sequence_id> <current_invoice_receipt_number>0</current_invoice_receipt_number> <current_invoice_receipt_sequence_id>144834</current_invoice_receipt_sequence_id> <current_simplified_invoice_number>0</current_simplified_invoice_number> <current_simplified_invoice_sequence_id>144833</current_simplified_invoice_sequence_id> <current_credit_note_number>0</current_credit_note_number> <current_credit_note_sequence_id>144837</current_credit_note_sequence_id> <current_debit_note_number>0</current_debit_note_number> <current_debit_note_sequence_id>144836</current_debit_note_sequence_id> <current_receipt_number>0</current_receipt_number> <current_receipt_sequence_id>144835</current_receipt_sequence_id> <current_shipping_number>0</current_shipping_number> <current_shipping_sequence_id>144843</current_shipping_sequence_id> <current_transport_number>0</current_transport_number> <current_transport_sequence_id>144845</current_transport_sequence_id> <current_devolution_number>0</current_devolution_number> <current_devolution_sequence_id>144844</current_devolution_sequence_id> <current_proforma_number>0</current_proforma_number> <current_proforma_sequence_id>144841</current_proforma_sequence_id> <current_quote_number>0</current_quote_number> <current_quote_sequence_id>144840</current_quote_sequence_id> <current_fees_note_number>0</current_fees_note_number> <current_fees_note_sequence_id>144842</current_fees_note_sequence_id> </sequence>

    {
      "sequence": {
        "id": 144832,
        "serie": "2015",
        "default_sequence": 1,
        "current_invoice_number": 0,
        "current_invoice_sequence_id": 144832,
        "current_invoice_receipt_number": 0,
        "current_invoice_receipt_sequence_id": 144834,
        "current_simplified_invoice_number": 0,
        "current_simplified_invoice_sequence_id": 144833,
        "current_credit_note_number": 0,
        "current_credit_note_sequence_id": 144837,
        "current_debit_note_number": 0,
        "current_debit_note_sequence_id": 144836,
        "current_receipt_number": 0,
        "current_receipt_sequence_id": 144835,
        "current_shipping_number": 0,
        "current_shipping_sequence_id": 144843,
        "current_transport_number": 0,
        "current_transport_sequence_id": 144845,
        "current_devolution_number": 0,
        "current_devolution_sequence_id": 144844,
        "current_proforma_number": 0,
        "current_proforma_sequence_id": 144841,
        "current_quote_number": 0,
        "current_quote_sequence_id": 144840,
        "current_fees_note_number": 0,
        "current_fees_note_sequence_id": 144842
      }
    }
      
Error
Code Description
HTTP: 401 Access denied The API Key parameter is missing or is incorrectly entered.
HTTP: 422 Unprocessable Entity Some parameters were incorrect.

Possible error for HTTP: 422

<errors>
  <error>Serie has already been taken</error>
  <error>The sequence name is invalid</error>
</errors>