Skip to end of banner
Go to start of banner

POST credit_notes/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 7 Next »

This method is creating a new credit note 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 credit note 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 credit note. 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 credit note which can be one of the following:

DRAFT, POSTED

category_identifier

(optional)

Financial transaction category identifier

The financial transaction category of the credit note 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 identifier 

The member accounts receivable. Applicable only if the Credit Note 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

notes

(optional)

StringShared notes for the credit note

back_office_code

(optional)

String

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

Available from CRM.COM R9.1.0

issue_on

(optional)

Date

The issue date of the financial transaction which is <= to the current date and not included in previous closed accounting periods. If not specified then the current date is applied. 

Available from CRM.COM R14.10.0

issue_reason

(optional)

StringA description of the reason that the credit note is issued

intended_currency_identifier

(optional)

Currency Identifier

The currency that the user was intended to use for the credit note. If specified then it is validated against the currency of the specified accounts receivable and if they don't match then an error is throw. 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

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

invoices_to_credit_set

(optional)

Set of invoice objectsThe invoices that are intended to be credited

credit_note_item_set

(mandatory)

Set of credit item objectsThe items of the credit not

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 parameter object data

Name

Type

Description

invoice_identifier

(mandatory)

Invoice identifierThe identifier of the invoice to be used. 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

 credit_note_item parameter object data

Name

Type

Description

product_identifier

(mandatory)

Products identifier
The product that will be related with the installed 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

quantity

(mandatory based on conditions)

numberThe quantity of the product. Applicable only if a product is credited, not an installed item

cost

(semi-optional)

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

discount_percentage

(optional)

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

discount_amount

(optional)

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

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)

numberThe total amount that will be credited for the specified product. Sub total cannot be specified if the cost is specified

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)

Set of Installed Items

Defines a set of Installed Items which are returned/credited through the related Credit Note.  Applicable and mandatory (at least one installed item must be specified) only if the physical good is a traceable item.

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

 credit note object response data

Name

Type

Description

id

String

The ID of the retrieved credit note

number

String

The number of the retrieved credit note

reference_number

String

The reference number of the retrieved credit note

life_cycle_state

String

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

DRAFT, REJECTED, POSTED, CANCELLED
issued_onDateThe date that the credit note was issued
posted_onDateThe date that the credit note was posted
total_amountNumberThe total amount of the credit note
currency_rate_periodCurrency Rate Period object

The currency rate period based on which the credit note'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": "E55F0CADDDFEAC5C5F269A71039DDA40",
  "accounts_receivable_identifier":{"number":"401"},
  "type_identifier":{"name":"Credit Note 1"},
  "life_cycle_state":"POSTED",
  "category_identifier":{"name":"Credit Note Categories"},
  "notes":"standard credit note",
  "issue_reason":"Cancellation of prepaid service",
  "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",
  "invoices_to_credit_set": 
   [
     {
        "invoice_identifier":{"number":"I0010210"}
     },
     {
        "invoice_identifier":{"number":"I0010211"}
     }
   ],
   "credit_note_item_set":
   [
     {
       "product_identifier":{"code":"Smart Card"},
       "quantity":2,
       "cost":18,
       "discount_amount":3,
       "vat_rate_identifier":{"name":"Standard"},
       "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": 33,
        "issued_on": "2014-10-30T11:34:37",
        "life_cycle_state": "POSTED",
        "number": "CT00000158",
        "id": "48E6B743D21A8F284EE0CB99805E4CF9",
        "reference_number": "171",
        "posted_on": "2014-10-30T11:36:27"
    }
}
 Example 2

HTTP Method: POST


Request:

Body:

{
    "token":"{{token}}",
    "accounts_receivable_identifier":{"number":"ACR0000000214"},
  "type_identifier":{"name":"Credit Note"},
  "life_cycle_state":"POSTED",
  "notes":"standard credit note",
  "issue_reason":"Cancellation of prepaid service",
  "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",
   "credit_note_item_set":
   [
     {
       "product_identifier":{"code":"Smartcard"},
       "quantity":2,
       "cost":18,
       "discount_amount":3,
       "vat_rate_identifier":{"name":"Standard"},
       "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:04:02",
    "number": "107",
    "total_amount": 0,
    "issued_on": "2016-07-05T15:04:02",
    "currency_rate_period": null,
    "id": "1D975E651947499EAC1733ED1E0EE6FD",
    "life_cycle_state": "POSTED",
    "reference_number": "38"
  },
  "status": {
    "code": "OK",
    "description": "",
    "message": ""
  }
}
  • No labels