POST refunds/create

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

DRAFT, POSTED

refund_method_identifier

(optional)

Refund method identifier

The refund method of the refund. If not specified then the refund method which is specified as the default on the selected refund type is applied. The allowed refund method identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the refund method

name

(semi-optional)

String

The name of the refund method

alternative_code

(semi-optional)

String

The alternative code of  the refund method

Available from CRM.COM R13.0.0

refund_amount

(mandatory)

NumberThe amount of the refund

intended_currency_identifier

(optional)

Currency Identifier

The currency that the user was intended to use for the refund. 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

category_identifier

(optional)

Financial transaction category identifier

The financial transaction category of the refund 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

accounts_receivable_payment_preference_identifier

(mandatory on conditions)

Accounts Receivable Payment Preference Identifier

The accounts receivable payment preferences that will be used by generic payment gateways to process the refund. The specified accounts receivable payment preferences should belong to the specified accounts receivable. This information is applicable and mandatory only if the refund will be processed by a generic payment gateway, as denoted by the selected refund method. The allowed accounts receivable payment preference identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of accounts receivable payment preference

payment_preference_identifier

(semi-optional)

Identifier  

The identifier of the payment preference. The allowed payment preference identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of payment preference

name 

(semi-optional)

String

The name of payment preference

alternative_code 

(semi-optional)

String

The alternative code of payment preference

payment_medium_identifier

(semi-optional)

String

The payment medium identifier related with the accounts receivable payment preference

Available from CRM.COM R11.0.0

bank_account_number

(semi-optional)

StringThe bank account number related with the accounts receivable payment preference

Available from CRM.COM R11.0.0

 


Available from CRM.COM R13.0.0

notes

(optional)

StringShared notes for the refund

back_office_code

(optional)

String

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

Available from CRM.COM R9.1.0

issue_on

(optional)

DateThe date on which the refund is issued

issue_reason

(optional)

StringA description of the reason that the refund is issued

posted_on

(optional)

Date

The posting date of the financial transaction which is before or equal to the current date and not included in already closed accounting periods. If not specified then the current date is applied. 

Available from CRM.COM R14.10.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

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

 refund object response data

Name

Type

Description

id

String

The ID of the retrieved refund

number

String

The number of the retrieved refund

reference_number

String

The reference number of the retrieved refund

life_cycle_state

String

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

DRAFT, REJECTED, POSTED, CANCELLED
issued_onDateThe date that the refund was issued
posted_onDateThe date that the refund was posted
refund_amountNumber

The amount that was refunded

currency_rate_periodCurrency Rate Period

The currency rate period based on which the refund was created

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": "E78968BE92E02C3FCCD2D671B9772EF9",
	"accounts_receivable_identifier":{"number":"192"},
	"type_identifier":{"name":"Broken Item Refund"},
	"life_cycle_state":"POSTED",
	"refund_amount":"150",
	"category_identifier":{"name":"Broken Item Refund"},
	"issue_reason":"Item was broken.",
}


Response:

{
    "status":
    {
        "message": null,
        "description": null,
        "code": "OK"
    },
    "data":
    {
        "issued_on": "2014-07-15T15:59:18",
        "life_cycle_state": "POSTED",
        "number": "19",
        "id": "308883971F72E715FC64D005FF0C9B1F",
        "reference_number": "27",
        "posted_on": "2014-07-15T15:59:18",
        "refund_amount": 150
    }
}