You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Current »
This method is used to cancel a posted invoice. An invoice cancellation is created and posted to cancel the specified invoice
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 cancelled. 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 |
|
type_identifier (mandatory) | Financial transaction type identifier | The financial transaction type of the invoice cancellation. 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 |
|
category_identifier (optional) | Financial transaction category identifier | The financial transaction category of the invoice cancellation. 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) | String | Shared notes for the invoice cancellation |
back_office_code (optional) | String | A back office code for the invoice cancellation. If specified then it should be unique |
issue_reason (optional) | String | A description of the reason that the invoice cancellation is issued |
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) | 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 |
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 cancelled |
invoice_cancellation | Invoice cancellation object | The invoice cancellation 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_on | Date | The date that the invoice was issued |
posted_on | Date | The date that the invoice was posted |
due_on | Date | The date that the credit period for that specific invoice is ending. |
total_amount | Number | The total amount of the invoice |
outstanding_amount | Number | The total outstanding amount of the invoice |
unsettled_amount | Number | The total unsettled amount of the invoice |
currency_rate_period | Currency Rate Period object | The currency rate period based on which the invoice's amounts were calculated |
Referred Objects Response Data
currency rate period object response data
Name | Type | Description |
---|
id | String | The ID of the retrieved currency rate period |
rate | Number | The exchange rate of the currency rate period |
inverse_rate | Number | The inverse exchange rate of the currency rate period |
from_date | Date | The date from which the exchange rate is valid |
to_date | Date | The date until which the exchange rate is valid |
currency | Currency Object | The 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_symbol | String | The prefix symbol for the specified currency |
suffix_symbol | String | The suffix symbol for the specified currency |
life_cycle_state | String | The life cycle state for the specified currency, which can be EFFECTIVE or NOT EFFECTIVE |
integer_part_name | String | The integer part name for the specified currency |
decimal_part_name | String | The decimal part name for the specified currency |
invoice cancellation object response data
Name | Type | Description |
---|
id | String | The ID of the retrieved invoice cancellation |
number | String | The number of the retrieved invoice cancellation |
reference_number | String | The reference number of the retrieved invoice cancellation |
life_cycle_state | String | The life cycle state of the invoice cancellation. One of the following values is returned: DRAFT, REJECTED, POSTED, CANCELLED |
issued_on | Date | The date that the invoice cancellation was issued |
posted_on | Date | The date that the invoice cancellation was posted |
total_amount | Number | The total amount of the invoice cancellation |
currency_rate_period | Currency Rate Period | The currency rate period based on which the invoice cancellation 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 |
rate | Number | The exchange rate of the currency rate period |
inverse_rate | Number | The inverse exchange rate of the currency rate period |
from_date | Date | The date from which the exchange rate is valid |
to_date | Date | The date until which the exchange rate is valid |
currency | Currency Object | The 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_symbol | String | The prefix symbol for the specified currency |
suffix_symbol | String | The suffix symbol for the specified currency |
life_cycle_state | String | The life cycle state for the specified currency, which can be EFFECTIVE or NOT EFFECTIVE |
integer_part_name | String | The integer part name for the specified currency |
decimal_part_name | String | The decimal part name for the specified currency |
Examples
Example 1
HTTP Method: POST
Request:
Body:
{
"token": "B8D7A12E9F91AFADE914B7330AFD08CB",
"invoice_identifier":{"reference_number":"559"},
"type_identifier":{"name":"Invoice Cancellation"}
}
Response:
{
"status":
{
"message": null,
"description": null,
"code": "OK"
},
"data":
{
"invoice_cancellation":
{
"issued_on": "2014-11-07T11:53:50",
"total_amount": 57,
"life_cycle_state": "POSTED",
"number": "51",
"id": "576831622F3735D9B734B419B4BC6C7A",
"reference_number": "2",
"posted_on": "2014-11-07T11:53:50"
},
"invoice":
{
"total_amount": 57,
"issued_on": "2014-11-07T11:38:48",
"life_cycle_state": "POSTED",
"unsettled_amount": 0,
"number": "I00000519",
"due_on": "2014-11-10T15:49:59",
"id": "7968903798226F14CB73E59E2DD8712B",
"outstanding_amount": 0,
"reference_number": "559",
"posted_on": "2014-11-07T11:45:41"
}
}
}
Example 2
HTTP Method: POST
Request:
Body:
{
"token":"{{token}}",
"invoice_identifier":{"reference_number":"55"},
"type_identifier":{"name":"Invoice Cancellation"}
}
Response:
{
"data": {
"invoice": {
"posted_on": "2016-07-05T15:46:36",
"number": "I00000679",
"total_amount": 5,
"unsettled_amount": 0,
"issued_on": "2015-04-14T06:41:39",
"currency_rate_period": null,
"id": "2C2374687D424D8AA6A3E02772900492",
"life_cycle_state": "POSTED",
"outstanding_amount": 0,
"reference_number": "55",
"due_on": "2016-07-05T20:42:13"
},
"invoice_cancellation": {
"posted_on": "2016-07-05T15:59:57",
"number": "15",
"total_amount": 5,
"issued_on": "2016-07-05T15:59:57",
"id": "CA9A48B203FD413296866132184838DA",
"life_cycle_state": "POSTED",
"reference_number": "15"
}
},
"status": {
"code": "OK",
"description": "",
"message": ""
}
}