Skip to end of banner
Go to start of banner

POST invoices/create

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

This method is creating a new invoice either in Draft or Posted state

Resource URL

Parameters

Name

Type

Description

token

String

The token retrieved from the login method

accounts_receivable_identifier

(mandatory)

Accounts receivable identifier  

The identifier of the accounts receivable in which the invoice should be allocated to. The allowed accounts receivable identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the accounts receivable

number

(semi-optional)

String

The number of the accounts receivable

name

(semi-optional)

String

The name of the accounts receivable

type_identifier

(mandatory)

Financial transaction type identifier

The financial transaction type of the invoice. The allowed financial transaction type identifier field are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the financial transaction type

name

(semi-optional)

String

The name of the financial transaction type

alternative_code

(semi-optional)

String

The alternative code of  the financial transaction type

life_cycle_state

(mandatory)

String

The state of the retrieved invoice which can be one of the following:

DRAFT, POSTED

category_identifier

(optional)

Financial transaction category identifier

The financial transaction category of the invoice that should be returned as a result. The allowed financial transaction category identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the financial transaction category

name

(semi-optional)

String

The name of the financial transaction category

code

(semi-optional)

String

The code of  the financial transaction category

member_accounts_receivable_identifier

(optional)

Accounts Receivable IdentifierThe member accounts receivable. Applicable only if the Invoice is issued against a parent accounts receivable within a group which funds its members. The allowed accounts receivable identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the accounts receivable

number

(semi-optional)

String

The number of the accounts receivable

name

(semi-optional)

String

The name of the accounts receivable

due_on

(optional)

DateThe date that the credit period for that specific invoice is ending.

intended_currency_identifier

(optional)

Currency Identifier

The currency that the user was intended to use for the invoice. If specified then it is validated against the currency of the specified accounts receivable and if they don't match then an error is thrown. Note that the intended currency is not saved within CRM.COM; it is just used for validation purposes. The allowed currency identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the currency

code

(semi-optional)

String

The code of the currency

Available from CRM.COM R11.0.0

notes

(optional)

StringShared notes for the invoice

back_office_code

(optional)

String

A back office code for the invoice. If specified then it should be unique

Available from CRM.COM R9.1.0

udf_string_1

(optional)

String

User Defined Field of type String

udf_string_2

(optional)

String

User Defined Field of type String

udf_string_3

(optional)

String

User Defined Field of type String

udf_string_4

(optional)

String

User Defined Field of type String

udf_string_5

(optional)

String

User Defined Field of type String

udf_string_6

(optional)

String

User Defined Field of type String

udf_string_7

(optional)

String

User Defined Field of type String

udf_string_8

(optional)

String

User Defined Field of type String

udf_float_1

(optional)

Float

User Defined Field of type Float

udf_float_2

(optional)

Float

User Defined Field of type Float

udf_float_3

(optional)

Float

User Defined Field of type Float

udf_float_4

(optional)

Float

User Defined Field of type Float

udf_date_1

(optional)

Date

User Defined Field of type Date

udf_date_2

(optional)

Date

User Defined Field of type Date

udf_date_3

(optional)

Date

User Defined Field of type Date

udf_date_4

(optional)

Date

User Defined Field of type Date

invoice_item_set

(mandatory)

Set of invoice item objectsThe items of the invoice

fields_set

(optional)

List of Strings, comma separated 

A list of fields that should be included in the results. If not specified then all the available fields will be returned

Referred Parameter Objects

 invoice_item parameter object data

Name

Type

Description

product_identifier

(mandatory)

Products identifier
The product that will be related with the invoice item. The allowed product identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the product

code

(semi-optional)

String

The code of the product

alternative_code

(semi-optional)

String

The alternative code of  the product

installed_item_identifier

(mandatory based on conditions)

Installed Item identifier

The installed item sold to the account owner. Mandatory only if the physical good sold is a traceable item. The allowed installed item identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the installed item

serial_number

(semi-optional)

String

The serial number of the installed item

alternative_code

(semi-optional)

String

The alternative code of  a installed item

Available from CRM.COM R15.0.0

Deprecated from CRM.COM R17.0.0

from_warehouse

(optional on conditions)

String

The warehouse from which the installed items will be sold to the Partner. Applicable and mandatory only if the Accounts Receivable selected is related to a Partner that owns a warehouse as well. Only the Warehouses which are not owned by any Partner Group can be provided.

Name

Type

Description

id

(semi-optional)

String

The ID of the warehouse

name

(semi-optional)

String

The name of the warehouse

alternative_code

(semi-optional)

String

The alternative code of  the warehouse

Available from CRM.COM R15.0.0

 to_warehouse

(optional on conditions)

 String

 The warehouse to which the installed items sold to the Partner are moved to. Applicable and mandatory only if the Accounts Receivable selected is related to a Partner owning a Warehouse. Only the Warehouses owned by the specified Partner Group can be provided.

Name

Type

Description

id

(semi-optional)

String

The ID of the warehouse

name

(semi-optional)

String

The name of the warehouse

alternative_code

(semi-optional)

String

The alternative code of  the warehouse

Available from CRM.COM R15.0.0

quantity

(mandatory)

number

The quantity of the product.

From CRM.COM R15.0.0, the quantity is applicable if the product provided is non-traceable

cost

(semi-optional)

number

The cost of the product. Cost cannot be specified if the sub total is specified

From CRM.COM R15.0.0, the cost or sub-total will be automatically provided by the pricing strategy thus they are not mandatory. If provided, then the specified value will be considered

discount_percentage

(optional)

number

The discount percentage that is applied. Discount percentage cannot be specified if the discount amount is specified.

From CRM.COM R15.0.0, discount_percentage should not be available for stockable physical goods.

discount_amount

(optional)

number

The discount amount that is applied. Discount amount cannot be specified if the discount percentage is specified

From CRM.COM R15.0.0, discount_amount should not be available for stockable physical goods.

vat_rate_identifier

(optional)

VAT rate identifier

The VAT rate that should be applied. If not specified then the VAT rate specified on the product will be applied. The allowed VAT rate identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the VAT rate

name

(semi-optional)

String

The name of the VAT rate

alternative_code

(semi-optional)

String

The alternative code of  the VAT rate

Deprecated from CRM.COM R12.0.0

sub_total

(semi-optional)

number

The total amount that will be invoiced for the specified product. Sub total cannot be specified if the cost is specified

From CRM.COM R15.0.0, the cost or sub-total will be automatically provided by the pricing strategy thus they are not mandatory. If provided, then the specified value will be considered

udf_string_1

(optional)

String

User Defined Field of type String

udf_string_2

(optional)

String

User Defined Field of type String

udf_string_3

(optional)

String

User Defined Field of type String

udf_string_4

(optional)

String

User Defined Field of type String

udf_string_5

(optional)

String

User Defined Field of type String

udf_string_6

(optional)

String

User Defined Field of type String

udf_string_7

(optional)

String

User Defined Field of type String

udf_string_8

(optional)

String

User Defined Field of type String

udf_float_1

(optional)

Float

User Defined Field of type Float

udf_float_2

(optional)

Float

User Defined Field of type Float

udf_float_3

(optional)

Float

User Defined Field of type Float

udf_float_4

(optional)

Float

User Defined Field of type Float

udf_date_1

(optional)

Date

User Defined Field of type Date

udf_date_2

(optional)

Date

User Defined Field of type Date

udf_date_3

(optional)

Date

User Defined Field of type Date

udf_date_4

(optional)

Date

User Defined Field of type Date

installed_items_set

(mandatory based on conditions, applicable on add or remove)

Set of Installed Items

Defines a set of Installed Items to be sold to he account owner through the related Invoice.  Applicable and mandatory (at least one installed item must be specified) only if the physical good sold is a traceable item.

If no records are specified in the set then nothing will be updated. To update a record use "action" : "update". To remove a record use "action" : "remove". To add a record use "action" : "add". Different actions can be used within the same set. For example:

"set": [
	   		{
            	"action": "update",
            	...........
        	},
			{
            	"action": "remove",
            	...........
			},
			{
            	"action": "add",
            	...........
			}
		]

Available from CRM.COM R17.0.0

Referred Parameter Objects Data

 finacial_transaction_line_item parameter object data

Name

Type

Description

installed_item_identifier

(mandatory)

Installed Item identifier

The installed item which is related to the financial transaction line item. The allowed installed item identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the installed item

serial_number

(semi-optional)

String

The serial number of the installed item

alternative_code

(semi-optional)

String

The alternative code of  a installed item

       

       

Restrictions

  • It is mandatory to specify one of the semi-optional parameters. Only one of those parameters is allowed to be specified.

Response Data

 invoice object response data

Name

Type

Description

id

String

The ID of the retrieved invoice

number

String

The number of the retrieved invoice

reference_number

String

The reference number of the retrieved invoice

life_cycle_state

String

The life cycle state of the invoice. One of the following values is returned:

DRAFT, REJECTED, POSTED, CANCELLED
issued_onDateThe date that the invoice was issued
posted_onDateThe date that the invoice was posted
due_onDateThe date that the credit period for that specific invoice is ending.
total_amountNumberThe total amount of the invoice
outstanding_amountNumberThe total outstanding amount of the invoice
unsettled_amountNumberThe total unsettled amount of the invoice
currency_rate_periodCurrency Rate Period object

The currency rate period based on which the invoice's amounts were calculated

Available from CRM.COM R10.0.0

Referred Objects Response Data

 currency rate period object response data

Name

Type

Description

id

String

The ID of the retrieved currency rate period

rateNumberThe exchange rate of the currency rate period
inverse_rateNumberThe inverse exchange rate of the currency rate period
from_dateDateThe date from which the exchange rate is valid
to_dateDateThe date until which the exchange rate is valid
currencyCurrency ObjectThe Currency with which the returned exchange rate information refers to

Referred Objects Response Data

 currency object response data

Name

Type

Description

id

String

The ID of the retrieved currency

code

String

The code of the retrieved currency

prefix_symbolStringThe prefix symbol for the specified currency

suffix_symbol

StringThe suffix symbol for the specified currency
life_cycle_stateString

The life cycle state for the specified currency, which can be EFFECTIVE or NOT EFFECTIVE

Available from CRM.COM R14.0.0

integer_part_nameStringThe integer part name for the specified currency
decimal_part_nameStringThe decimal part name for the specified currency

Examples

 Example 1

HTTP Method: POST

 

Request:

Body:

{
   "token":"4BCD003AC90E8DECBA474A03AB185CBB",
   "accounts_receivable_identifier":{"number":"401"},
   "type_identifier":{"name":"Invoice 1"},
   "life_cycle_state":"POSTED",
   "category_identifier":{"name":"Invoice Category 1"},
   "due_on":"2014-11-05T15:49:59",
   "notes":"to be issued later",
   "udf_string_1":"udf string 1",
   "udf_string_2":"udf string 2",
   "udf_string_3":"udf string 3",
   "udf_string_4":"udf string 4",
   "udf_string_5":"udf string 5",
   "udf_string_6":"udf string 6",
   "udf_string_7":"udf string 7",
   "udf_string_8":"udf string 8",
   "udf_float_1":10,
   "udf_float_2":20,
   "udf_float_3":30,
   "udf_float_4":40,
   "udf_float_5":50,
   "udf_float_6":60,
   "udf_float_7":70,
   "udf_float_8":80,
   "udf_date_1":"2014-05-05T15:49:59",
   "udf_date_2":"2014-06-05T15:49:59",
   "udf_date_3":"2014-07-05T15:49:59",
   "udf_date_4":"2014-08-05T15:49:59",
   "invoice_item_set":
   [
      {
         "product_identifier": {"code": "Smart Card"},
         "quantity":3,
         "cost":20,
         "discount_percentage":5,
         "vat_rate_identifier":{"name":"Zero"},
         "udf_string_1":"udf string 1",
         "udf_string_2":"udf string 2",
         "udf_string_3":"udf string 3",
         "udf_string_4":"udf string 4",
         "udf_string_5":"udf string 5",
         "udf_string_6":"udf string 6",
         "udf_string_7":"udf string 7",
         "udf_string_8":"udf string 8",
         "udf_float_1":10,
         "udf_float_2":20,
         "udf_float_3":30,
         "udf_float_4":40,
         "udf_float_5":50,
         "udf_float_6":60,
         "udf_float_7":70,
         "udf_float_8":80,
         "udf_date_1":"2014-05-05T15:49:59",
         "udf_date_2":"2014-06-05T15:49:59",
         "udf_date_3":"2014-07-05T15:49:59",
         "udf_date_4":"2014-08-05T15:49:59"
       }
    ]
}

Response:

      {
    "status":
    {
        "message": null,
        "description": null,
        "code": "OK"
    },
    "data":
    {
        "total_amount": 57,
        "issued_on": "2014-10-29T18:20:40",
        "life_cycle_state": "POSTED",
		"unsettled_amount": null,
        "number": "I00000498",
        "due_on": "2014-11-05T15:49:59",
        "id": "399ABC9CAAFF820100582EDEB842F026",
        "outstanding_amount": null,
        "reference_number": "542",
        "posted_on": "2014-10-29T18:20:40"
    }
}
 Example 2

HTTP Method: POST

 

Request:

Body:

{
    "token":"{{token}}",
    "accounts_receivable_identifier":{"number":"ACR0000000214"},
    "type_identifier":{"name":"Invoice"},
   "life_cycle_state":"POSTED",
   "notes":"to be issued later",
   "udf_string_1":"udf string 1",
   "udf_string_2":"udf string 2",
   "udf_string_3":"udf string 3",
   "udf_string_4":"udf string 4",
   "udf_string_5":"udf string 5",
   "udf_string_6":"udf string 6",
   "udf_string_7":"udf string 7",
   "udf_string_8":"udf string 8",
   "udf_float_1":10,
   "udf_float_2":20,
   "udf_float_3":30,
   "udf_float_4":40,
   "udf_float_5":50,
   "udf_float_6":60,
   "udf_float_7":70,
   "udf_float_8":80,
   "udf_date_1":"2014-05-05T15:49:59",
   "udf_date_2":"2014-06-05T15:49:59",
   "udf_date_3":"2014-07-05T15:49:59",
   "udf_date_4":"2014-08-05T15:49:59",
   "invoice_item_set":
   [
      {
         "product_identifier": {"code": "Smartcard"},
         "quantity":3,
         "cost":20,
         "discount_percentage":5,
         "vat_rate_identifier":{"name":"Zero"},
         "udf_string_1":"udf string 1",
         "udf_string_2":"udf string 2",
         "udf_string_3":"udf string 3",
         "udf_string_4":"udf string 4",
         "udf_string_5":"udf string 5",
         "udf_string_6":"udf string 6",
         "udf_string_7":"udf string 7",
         "udf_string_8":"udf string 8",
         "udf_float_1":10,
         "udf_float_2":20,
         "udf_float_3":30,
         "udf_float_4":40,
         "udf_float_5":50,
         "udf_float_6":60,
         "udf_float_7":70,
         "udf_float_8":80,
         "udf_date_1":"2014-05-05T15:49:59",
         "udf_date_2":"2014-06-05T15:49:59",
         "udf_date_3":"2014-07-05T15:49:59",
         "udf_date_4":"2014-08-05T15:49:59"
       }
    ]
}

Response:

{
  "data": {
    "posted_on": "2016-07-05T15:33:48",
    "number": "I00000678",
    "total_amount": 57,
    "unsettled_amount": null,
    "issued_on": "2016-07-05T15:33:48",
    "currency_rate_period": null,
    "id": "C83F011A58E0450EB9ADAF3416692284",
    "life_cycle_state": "POSTED",
    "outstanding_amount": null,
    "reference_number": "97",
    "due_on": "2016-07-07T15:33:48"
  },
  "status": {
    "code": "OK",
    "description": "",
    "message": ""
  }
}
 Example 3

HTTP Method: POST

 

Request:

Body:

{
    "token": "{{token}}",
    "accounts_receivable_identifier":{"number":"ACR0000008050"},
    "type_identifier":{"name":"Invoice"},
    "life_cycle_state":"POSTED",
    "member_accounts_receivable_identifier":{"number":"ACR0000008052"},
    "invoice_item_set":
    [
        {
            "product_identifier":{"code":"Gold"},
            "quantity":1,
            "cost":30,
            "discount_percentage":10,
            "vat_rate_identifier":{"name":"Standard"}
        },
         {
            "product_identifier":{"code":"Sports 1"},
            "quantity":2,
            "cost":10,
            "discount_percentage":5,
            "vat_rate_identifier":{"name":"Standard"}
        }
    ]
}
       

Response:

{
  "data": {
    "posted_on": "2017-04-05T17:28:29",
    "number": "I00002949",
    "total_amount": 57.5,
    "unsettled_amount": null,
    "issued_on": "2017-04-05T17:28:29",
    "currency_rate_period": null,
    "id": "2415A59E46F347CAB2392B4A000EB0A1",
    "life_cycle_state": "POSTED",
    "outstanding_amount": null,
    "reference_number": "2762",
    "due_on": "2017-04-07T17:28:29"
  },
  "status": {
    "code": "OK",
    "description": "",
    "message": ""
  }
}   

 

 

 

  • No labels