Confirmation

You can list your available confirmations with the following URL:

                GET https://api.smallinvoice.com/confirmation/list/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
limitintno0Limit the amount of results
pageintno1When limiting the results, specifies page
sortstringnodatedate
due
number
Sorts the list by the available values
sorttypestringnodescasc
desc
Defines the way of sorting


Example: Making a request with 100 Results, getting second page, and sorting by date ascending

        GET https://api.smallinvoice.com/confirmation/list/limit/100/page/2/sort/date/sorttype/asc/
    

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
pageintCurrent page that was passed in on the request
pagesintTotal number of pages available
countintTotal number of objects available
itemscollectionCollection of confirmation Objects

Example content of data variable:

    {
        "error":false,
        "page":1,
        "pages":1,
        "count":2,
        "items":[
            {
                "id":77,
                "number":10000,
                "client_id":16,
                "client_name":"John Doe",
                "client_address_id":11,
                "client_contact_id":0,
                "currency":"CHF",
                "title":"Rechnung Nr. {1} \/ Kunden Nr. {2}",
				"period":"",
                "date":"2013-02-25",
                "due":"2013-03-27",
                "account_id":0,
                "esr":0,
                "esr_number":"",
                "esr_position":0,
				"lsvplus":0,
				"dd":0,
                "discount":0,
                "discount_type":0,
                "conditions":"",
                "introduction":"",
                "language":"de",
                "paypal":0,
                "paypal_url":"",
                "vat_included":0,
                "totalamount":0,
                "status":7,
                "pages":1,
                "positions":[
                    {
                        "type":1,
                        "number":null,
                        "name":"Service Y",
                        "description":"Cleaning house",
                        "cost":0,
                        "unit":1,
                        "amount":1,
                        "vat":8,
                        "discount":null
                    },
                    {
                        "type":2,
                        "number":null,
                        "name":"Product X",
                        "description":"Repairing car",
                        "cost":0,
                        "unit":7,
                        "amount":1,
                        "vat":8,
                        "discount":null
                    }
                ]
            }
        ]
    }
    

You can get your confirmation with the following URL:

                GET https://api.smallinvoice.com/confirmation/get/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the confirmation


Example: Making a request for confirmation with id 5

                GET https://api.smallinvoice.com/confirmation/get/id/5
            

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
itemobjectObject of confirmation

Example content of data variable:

    {
        "error":false,
        "item":{
            "id":77,
            "number":10000,
            "client_id":16,
            "client_name":"Jane Doe",
            "client_address_id":11,
            "client_contact_id":0,
            "currency":"CHF",
            "title":"Rechnung Nr. {1} \/ Kunden Nr. {2}",
			"period":"",
            "date":"2013-02-25",
            "due":"2013-03-27",
            "account_id":0,
            "esr":0,
            "esr_number":"",
            "esr_position":0,
			"lsvplus":0,
			"dd":0,
            "discount":0,
            "discount_type":0,
            "conditions":"",
            "introduction":"",
            "language":"de",
            "paypal":0,
            "paypal_url":"",
            "vat_included":0,
            "totalamount":0,
            "status":7,
            "pages":1,
            "positions":[
                {
                    "type":1,
                    "number":null,
                    "name":"Service Y",
                    "description":"Cleaning house",
                    "cost":0,
                    "unit":1,
                    "amount":1,
                    "vat":8,
                    "discount":null
                },
                {
                    "type":2,
                    "number":null,
                    "name":"Product X",
                    "description":"Repairing car",
                    "cost":0,
                    "unit":7,
                    "amount":1,
                    "vat":8,
                    "discount":null
                }
            ]
        }
    }
    

You can get your confirmation as pdf with the following URL:

                GET https://api.smallinvoice.com/confirmation/pdf/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the confirmation


Example: Making a request for confirmation with id 5

                GET https://api.smallinvoice.com/confirmation/pdf/id/5
            

Response

NameTypeNotes
HTTP Bodyapplication/pdfThe PDF in raw format

You can get a confirmation preview in PNG form for each page of a document with the following URL:

                GET https://api.smallinvoice.com/confirmation/preview/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the confirmation
pageintno1The page you want to retreive
sizeintno595240
595
600
972
1240
The size in pixels


Example: Getting second page in size 1240 for confirmation with id 5

                GET https://api.smallinvoice.com/confirmation/preview/id/5/page/2/size/1240
            

Response

NameTypeNotes
HTTP Bodyimage/pngThe image in raw format

You can add a new confirmation with the following URL:

                POST https://api.smallinvoice.com/confirmation/add
            

Body parameters

NameTypeRequiredDefaultNotes
numberstringnonext higher numberYour confirmation number
client_idintyesClient's id
client_address_idintyesClient's address id
client_contact_idintno0Client's contact id
currencystringyesThree-letter currency code
titlestringnoTitle of the confirmation
datedateyesDate of confirmation
introductionstringnoIntroduction text printed above positions
conditionsstringnoText printed below positions
languagestringyesTwo-letter language code
vat_includedintno0If VAT is included in positions' prices
positionscollectionyesCollection of Position Objects


Example: Creating a new confirmation

                POST https://api.smallinvoice.com/confirmation/add/
            

Example content of data variable:
{
    "number":10000,
    "client_id":16,
    "client_name":"John Doe",
    "client_address_id":11,
    "client_contact_id":0,
    "currency":"CHF",
    "title":"Rechnung Nr. {1} \/ Kunden Nr. {2}",
	"period":"",
    "date":"2013-02-25",
    "due":"2013-03-27",
    "account_id":0,
    "esr":0,
    "esr_number":"",
    "esr_position":0,
	"lsvplus":0,
	"dd":0,
    "discount":0,
    "discount_type":0,
    "conditions":"",
    "introduction":"",
    "language":"de",
    "paypal":0,
    "vat_included":0,
    "positions":[
        {
            "type":2,
            "number":null,
            "name":"Product X",
            "description":"Repairing car",
            "cost":0,
            "unit":1,
            "amount":1,
            "vat":8,
            "discount":null
        },
        {
            "type":1,
            "number":null,
            "name":"Service Y",
            "description":"Cleaning house",
            "cost":0,
            "unit":7,
            "amount":1,
            "vat":8,
            "discount":null
        }
    ]
}

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
idintThe Id of the confirmation Object that was created

Example response:

    {
        "error":false,
        "id": 43
    }
    

You can edit an confirmation with the following URL:

                POST https://api.smallinvoice.com/confirmation/edit
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the confirmation

Body parameters

NameTypeNotes
numberstringYour confirmation number
client_idintClient's id
client_address_idintClient's address id
client_contact_idintClient's contact id
currencystringThree-letter currency code
titlestringTitle of the confirmation
datedateDate of confirmation
introductionstringIntroduction text printed above positions
conditionsstringText printed below positions
languagestringTwo-letter language code
vat_includedintIf VAT is included in positions' prices
positionscollectionCollection of Position Objects


Example: Editing an confirmation with id 5

                POST https://api.smallinvoice.com/confirmation/edit/id/5
            

Example content of data variable:
{
    "number":10000,
    "client_id":16,
    "client_name":"Jane Doe",
    "client_address_id":11,
    "client_contact_id":0,
    "currency":"CHF",
    "title":"Rechnung Nr. {1} \/ Kunden Nr. {2}",
	"period":"",
    "date":"2013-02-25",
    "due":"2013-03-27",
    "account_id":0,
    "esr":0,
    "esr_number":"",
    "esr_position":0,
	"lsvplus":0,
	"dd":0,
    "discount":0,
    "discount_type":0,
    "conditions":"",
    "introduction":"",
    "language":"de",
    "paypal":0,
    "vat_included":0,
}

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.

Example response:

    {
        "error":false
    }
    

You can delete an confirmation with the following URL:

                POST https://api.smallinvoice.com/confirmation/delete/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the confirmation


Example: Making a request for deleting confirmation with id 5

                POST https://api.smallinvoice.com/confirmation/delete/id/5
            

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.

Example response:

    {
        "error":false
    }
    

You can email your confirmation with the following URL:

                POST https://api.smallinvoice.com/confirmation/email
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the confirmation

Body parameters

NameTypeRequiredDefaultNotes
subjectstringYesSubject of email
bodystringYesContent of the email
afterstatusintNoThe status the document should take after sending
recipientscollectionYesList of recipients. See example


Example: Sending an confirmation with id 5 via email

                POST https://api.smallinvoice.com/confirmation/email/id/5
            

Example content of data variable
{
  "subject" : "Email subject",
  "body" : "Email body",
  "afterstatus" : 1,
  "recipients" : [
      {
        "cc" : false,
        "email" : "email@domain.com",
        "name" : "Client Name"
      }
    ]
}
     

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.

Example response:

    {
        "error":false
    }
    

You can send your confirmation via postmail with the following URL:

                POST https://api.smallinvoice.com/confirmation/post
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the confirmation

Body parameters

NameTypeRequiredDefaultNotes
speedintYes1 = Priority / 2 = Economy
colorintNo00 = B/W / 1 = Color
sendstatusintNoThe status the document should be sent in
afterstatusintNoThe status the document should take after sending


Example: Sending an confirmation with id 5 via postmail

                POST https://api.smallinvoice.com/confirmation/post/id/5
            

Example content of data variable
{
  "afterstatus" : 1,
  "sendstatus" : 1,
  "speed" : 1
}
     

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.

Example response:

    {
        "error":false
    }
    

You can change status of your confirmation with the following URL:

                POST https://api.smallinvoice.com/confirmation/status/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the confirmation

Body parameters

NameTypeRequiredDefaultNotes
statusintYesSee Status Types


Example: Making a request for confirmation with id 5

                POST https://api.smallinvoice.com/confirmation/status/id/5
            

Example content of data variable
{
  "status" : 1
}
     

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.

Example response:

    {
        "error":false
    }