POST invoices/reject

This method is used to reject an invoice which is in draft state.

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 rejected. 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

rejection_reason_identifier

(optional)

Rejection reason identifier

The reason that the invoice is rejected. The allowed rejection reason identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the rejection reason

name

(semi-optional)

String

The name of the rejection reason

alternative_code

(semi-optional)

String

The alternative code of  the rejection reason

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

 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": "B8D7A12E9F91AFADE914B7330AFD08CB",
	"invoice_identifier":{"reference_number":"559"},
	"rejection_reason_identifier":{"name":"Reject Due to Business Request"}
}


Response:

{
    "status":
    {
        "message": null,
        "description": null,
        "code": "OK"
    },
    "data":
    {
        "total_amount": 57,
        "issued_on": "2014-11-07T11:38:48",
        "life_cycle_state": "REJECTED",
        "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 1

HTTP Method: POST


Request:

Body:

{
    "token":"{{token}}",
    "invoice_identifier":{"reference_number":"541"},
    "rejection_reason_identifier":{"name":"Reject Due to Error"}
}


Response:

{
  "data": {
    "posted_on": "2016-04-14T06:43:24",
    "number": "542",
    "total_amount": 100,
    "unsettled_amount": 0,
    "issued_on": "2016-04-15T00:00:00",
    "currency_rate_period": null,
    "id": "01A75EF631294253B24B2401CA65F15D",
    "life_cycle_state": "REJECTED",
    "outstanding_amount": 0,
    "reference_number": "541",
    "due_on": "2016-04-16T06:43:24"
  },
  "status": {
    "code": "OK",
    "description": "",
    "message": ""
  }
}