Skip to end of banner
Go to start of banner

POST invoices/write_off

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

Version 1 Current »

Available from CRM.COM R13.0.0

This method is used to write off a single invoice but only as long it is in Posted life cycle state and not fully allocated 

Resource URL

Parameters

Name

Type

Description

token

String

The token retrieved from the login method

invoice_identifier

(mandatory)

Invoice identifier  

The identifier of the invoice that should be written off. Only Invoices in Posted life cycle state are allowed to be specified and only as long as they are not paid. The allowed invoice identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the invoice

number

(semi-optional)

String

The number of the invoice

reference_number

(semi-optional)

String

The reference number of  the invoice

back_office_code

(semi-optional)

String

The back office code of the invoice

Available from CRM.COM R9.1.0

type_identifier

(mandatory)

Financial transaction type identifier

The financial transaction type of the Write Off. The allowed financial transaction type identifier fields 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

category_identifier

(optional)

Financial transaction category identifier

The financial transaction category of the Write Off. 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

notes

(optional)

StringShared notes for the Write off

back_office_code

(optional)

String

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

 

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

fields_set

(optional)

Lis 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

Restrictions

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

Response Data

Name

Type

Description

invoice

Invoice object

The invoice that was written off

write_offWrite Off objectThe write off that was created

Referred Objects 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

 write off object response data

Name

Type

Description

id

String

The ID of the retrieved write off

number

String

The number of the retrieved write off

reference_number

String

The reference number of the invoice write off

life_cycle_state

String

The life cycle state of the write off which can only be POSTED

issued_onDateThe date that the write off was issued
posted_onDateThe date that the write off was posted
total_amountNumberThe total amount of the write off
currency_rate_periodCurrency Rate Period

The currency rate period based on which the invoice write off was created

 

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":"{{token}}",
    "invoice_identifier":{"reference_number":"1542"},
    "type_identifier":{"name":"Write Off"},
    "category_identifier":{"name":"Write Off"},
    "udf_string_1":"Write Off",
     "notes":"Write Off"
}

Response:

 {
  "data": [
    {
      "invoice": {
        "posted_on": "2017-02-16T14:37:01",
        "number": "I00002751",
        "total_amount": 22,
        "unsettled_amount": null,
        "issued_on": "2017-02-16T14:36:24",
        "currency_rate_period": {
          "from_date": "2016-06-23 08:15:08.0",
          "to_date": null,
          "rate": 0.84,
          "inverse_rate": 0.16,
          "currency": {
            "suffix_symbol": null,
            "prefix_symbol": "£",
            "decimal_part_name": null,
            "code": "GBP",
            "integer_part_name": null,
            "id": "9"
          },
          "id": "C7D7ED57F21B47028144967E015DCBE5"
        },
        "id": "D144BEC33B484BF4825344AC696A42D1",
        "life_cycle_state": "WRITTEN_OFF",
        "outstanding_amount": null,
        "reference_number": "1542",
        "due_on": "2017-02-18T14:37:01"
      },
      "write_off": {
        "posted_on": "2017-02-16T14:38:35",
        "number": "8",
        "total_amount": 22,
        "issued_on": "2017-02-16T14:38:34",
        "currency_rate_period": {
          "from_date": "2016-06-23 08:15:08.0",
          "to_date": null,
          "rate": 0.84,
          "inverse_rate": 0.16,
          "currency": null,
          "id": "C7D7ED57F21B47028144967E015DCBE5"
        },
        "id": "7B8017F31804419DB72D5C6A948BB89C",
        "life_cycle_state": "POSTED",
        "reference_number": "8"
      }
    }
  ],
  "status": {
    "code": "OK",
    "description": "",
    "message": ""
  }
}


  • No labels