POST payments/create

This method is creating a new payment either in Draft or Posted state

Resource URL

http://host_name/crmapi/rest/$version/payments/create

Parameters

Name

Type

Description

token

String

The token retrieved from the login method

accounts_receivable_identifier

(semi-optional)

Accounts receivable identifier  

The identifier of the accounts receivable in which the payment 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

For releases prior CRM.COM R14.0.0, the accounts_receivable_identifier is mandatory

wallet_identifier

(semi-optional)

Wallet Identifier

The identifier of the wallet in which the payment should be allocated to. The allowed wallet identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the wallet

number

(semi-optional)

String

The number of the wallet

Only unconditional wallet funds can be used in order to pay off

Available from CRM.COM R14.0.0

If the payment using unconditional wallet funds is not enabled through the Wallet Definition, then this parameter is not applicable

type_identifier

(mandatory)

Financial transaction type identifier

The financial transaction type of the payment. 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

From CRM.COM R14.0.0 and onwards, if the wallet_identifier parameter is set, then this parameter cannot include Payment Gateways

life_cycle_state

(mandatory)

String

The state of the retrieved payment which can be one of the following:

DRAFT, POSTED

payment_method_identifier

(mandatory)

Payment method identifier

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

Name

Type

Description

id

(semi-optional)

String

The ID of the payment method

name

(semi-optional)

String

The name of the payment method

alternative_code

(semi-optional)

String

The alternative code of  the payment method

payment_amount

(mandatory)

NumberThe amount of the payment

intended_currency_identifier

(optional)

Currency Identifier

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

received_on

(optional)

DateThe date that the payment was received. It defaults to the issued date if not specified

received_by_user_identifier

(optional)

User identifier

The user who actually received the payment. It defaults to the issued by user if not specified. The allowed user identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the user

username

(semi-optional)

String

The username of the user

received_by_unit_identifier

(optional)

Unit identifier
The unit who actually received the payment. The allowed unit identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the Unit

name

(semi-optional)

String

The name of the Unit

alternative_code

(semi-optional)

String

The alternative code of  the Unit

Deprecated from CRM.COM R18.0.0

received_by_business_unit_identifier

(optional)

Business Unit identifier
The business unit who actually received the payment. The allowed business unit identifier fields are the following:

Unable to render {include} The included page could not be found.

Available from CRM.COM R18.0.0

card_identifier

(mandatory on conditions)

Payment Gateway Card Identifier

The card that will be charged for the amount specified on the payment, by the related payment gateway provider. The allowed payment gateway card identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The id of the payment gateway card

payment_gateway_reference_number

(semi-optional)

String

The card's reference number as provided by the payment gateway

last_digits

(semi-optional)

String The last digits of the card as provided by the payment gateway provider

The card is applicable and mandatory if the specified payment method is linked with a payment gateway system. Note that the retrieved cards are filtered based on the cards owned by the specified accounts receivable owner


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 payment. The specified accounts receivable payment preferences should belong to the specified accounts receivable. This information is applicable and mandatory only if the payment will be processed by a generic payment gateway, as denoted by the selected payment 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 R11.0.0

From CRM.COM R14.0.0 and onwards, this parameter is mandatory only if the accounts_receivable_identifier parameter is specified. If the wallet_identifier parameter is specified then this information is not applicable

notes

(optional)

StringShared notes for the payment

back_office_code

(optional)

String

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

Available from CRM.COM R9.1.0

job_identifier

(optional)

Job Identifier

The job for which the payment was done for. The allowed job identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the job

number

(semi-optional)

String

The number of the job

Available from CRM.COM R14.4.0

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

invoices_to_pay_set

(optional)

Set of invoice objectsThe invoices that are intended to be paid

bills_to_pay_set

(optional)

Set of bill objectsThe bills that are intended to be paid

products_to_pay_set

(optional)

Set of product objects

The subscription service products that are intended to be paid through the payment. Applicable only if the account owner has an effective wallet and the payment type is included in active Wallet Definitions as a wallet credit cause. The payment's amount will be allotted only to services for which the account owner is already subscribed.

Available from CRM.COM R12.0.0

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

Available from CRM.COM R10.0.0

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

 bill parameter object data

Name

Type

Description

bill_identifier

(mandatory)

Bill identifierThe identifier of the bill to be used. The allowed bill identifier fields are the following:

Name

Type

Description

id

(semi-optional)

String

The ID of the bill

number

(semi-optional)

String

The number of the bill

bill_number_check_digit

(mandatory on conditions)

Number

The check digit of the bill's number. Applicable and mandatory if the bill to be paid has such a check digit

Available from CRM.COM R14.0.0

accounts_receivable_check_digit

(mandatory on conditions)

Number

The check digit of the bill's accounts receivable number. Applicable and mandatory if the bill to be paid has such a check digit

Available from CRM.COM R14.0.0


bill_amount_check_digit

(mandatory on conditions)

Number

The check digit of the bill's amount. Applicable and mandatory if the bill to be paid has such a check digit

Available from CRM.COM R14.0.0


 payment_product parameter object data

Name

Type

Description

product_identifier

(mandatory)

Product IdentifierThe service product for which the payment is submitted. Only products classified as Termed services are allowed to be specified and only as long as they exist on one of the account owner's subscriptions. 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

From CRM.COM R14.0.0 onward, any product can be specified as one of the payment's products regardless of its classification

Restrictions

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

Response Data

 payment object response data

Name

Type

Description

id

String

The ID of the retrieved payment

number

String

The number of the retrieved payment

reference_number

String

The reference number of the retrieved payment

life_cycle_state

String

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

DRAFT, REJECTED, POSTED, CANCELLED, PENDING_VERIFICATION
issued_onDateThe date that the payment was issued
posted_onDateThe date that the payment was posted
payment_amountNumberThe total amount of the payment
processed_by_payment_gatewayString

The payment gateway that processed the payment. This information becomes available only if the selected payment method is included in the payment gateway provider as a linked payment method, or if the payment is already posted and the information was already completed

payment_gateway_reference_numberString

A reference to the number of the payment that was created on the payment gateway. This information becomes available only if the selected payment method is included in the payment gateway provider as a linked payment method, or if the payment is already posted and the information was already completed

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": "825D7B5BB7F62E043A7C73B0FFBF124F",
    "accounts_receivable_identifier":{"number":"200"},
    "type_identifier":{"name":"Payment 1"},
    "life_cycle_state":"POSTED",
    "payment_method_identifier":{"name":"Stripe Payment Gateway"},
    "card_identifier":{"payment_gateway_reference_number":"card_15S0w0E0IcJRGs11e6ffmDXK"},
    "payment_amount":"50",
    "received_on":"2015-03-02T09:12:54",
    "received_by_user_identifier":{"username":"mpadministrator"},
    "received_by_unit_identifier":{"name":"Admin Unit"},
    "description":"Payment",
    "notes":"Payment note",
    "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_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",
    "bills_to_pay_set": [
    {
       "bill_identifier":{"number":"163"},
    }]
}

Response:

{
       "status":
       {
           "message": null,
           "description": null,
           "code": "OK"
       },
       "data":
       {
           "payment_gateway_reference_number": "ch_15S1nyE0IcJRGs11wD2c3TUn",
           "payment_amount": 50,
           "issued_on": "2015-02-03T10:12:48",
           "processed_by_payment_gateway": "STRIPE",
           "life_cycle_state": "POSTED",
           "number": "245",
           "id": "BF2392E94DB88F496656F6AFE860A673",
           "reference_number": "277",
           "posted_on": "2015-02-03T10:12:52"
       }
}
 Example 2

HTTP Method: POST


Request:

Body:

{
    "token": "825D7B5BB7F62E043A7C73B0FFBF124F",
    "fields_set":"number,payment_amount,id,payment_gateway_reference_number,posted_on",
    "accounts_receivable_identifier":{"name":"Dina Mika"},
    "type_identifier":{"name":"Payment 1"},
    "life_cycle_state":"POSTED",
    "payment_method_identifier":{"name":"Cash"},
    "payment_amount":"50",
    "received_on":"2016-08-06T09:12:54",
    "received_by_user_identifier":{"username":"mpadministrator"},
    "received_by_unit_identifier":{"name":"Admin Unit"},
    "description":"Payment",
    "notes":"Payment note",
    "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_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": "",
    "description": "",
    "code": "OK"
  },
  "data": {
    "payment_amount": 50,
    "number": "366",
    "id": "B8D20D3D27E543F18C09D66945BAF7D2",
    "posted_on": "2016-06-09T13:10:43"
  }
}
 Example 3

HTTP Method: POST


Request:

Body:

{
    "token": "825D7B5BB7F62E043A7C73B0FFBF124F",
    "accounts_receivable_identifier":{"number":"ACR0000000739"},
    "type_identifier":{"name":"Payment"},
    "life_cycle_state":"DRAFT",
    "payment_method_identifier":{"name":"Cash"},
    "payment_amount":"50",
    "intended_currency_identifier":{"code":"USD"},
    "received_on":"2016-05-09T09:12:54",
    "received_by_user_identifier":{"username":"mpadministrator"},
    "received_by_unit_identifier":{"name":"Admin Unit"},
    "description":"Payment",
    "notes":"Payment note"
 
}

Response:

 {
  "status": {
    "code": "COM.CRM.EXCEPTION.INVALIDCURRENCYEXCEPTION",
    "description": "Invalid currency %1. The currency must be %2.",
    "message": "Invalid Currency USD. The Currency Must Be EUR."
  }
}
 Example 4

HTTP Method: POST


Request:

Body:

{
    "token":{{token}},
    "wallet_identifier": {
    	"number": "W0000007376"
    },
    "type_identifier": {
    	"name": "Cash Payment"
    },
    "life_cycle_state":"POSTED",
    "payment_method_identifier": {
    	"name": "Cash Payment"
    },
    "payment_amount": "10.00",
    "received_on": "2017-09-15T09:20:00",
    "received_by_user_identifier": {
    	"username":"mpadministrator"
    },
    "received_by_unit_identifier": {
    	"name": "Admin Unit"
    },
    "description": "Payment for invoice I00003802",
    "notes": "Pay with cash",
   "invoices_to_pay_set": [
   		{
   			"invoice_identifier": {
   				"id" : "54F3A49F23024C51AFF21B7C728F3549"
   			}
		}
   	]
}

Response:

{
    "data": {
        "posted_on": "2017-09-15T11:23:29",
        "number": "3868",
        "payment_amount": 10,
        "issued_on": "2017-09-15T11:23:29",
        "currency_rate_period": null,
        "id": "43461750EE734AD7978C94A9D5D74D81",
        "life_cycle_state": "POSTED",
        "reference_number": "4877"
    },
    "status": {
        "code": "OK",
        "description": "",
        "message": ""
    }
}
 Example 5

HTTP Method: POST


Request:

Body:

{
    "token":{{token}},
    "wallet_identifier": {
    	"number": "W0000007376"
    },
    "type_identifier": {
    	"name": "Cash Payment"
    },
    "life_cycle_state":"POSTED",
    "payment_method_identifier": {
    	"name": "Cash Payment"
    },
    "payment_amount": "30.00",
    "received_on": "2017-09-15T09:20:00",
    "received_by_user_identifier": {
    	"username":"mpadministrator"
    },
    "received_by_unit_identifier": {
    	"name": "Admin Unit"
    },
    "description": "Payment for Bill 1196",
    "notes": "Pay with cash",
   "bills_to_pay_set": [
   		{
   			"bill_identifier": {
   				"number" : "1196"
   			}
		}
   	]
}

Response:

{
    "data": {
        "posted_on": "2017-09-15T11:35:23",
        "number": "3872",
        "payment_amount": 30,
        "issued_on": "2017-09-15T11:35:23",
        "currency_rate_period": null,
        "id": "0643BEAB8E2D4E639435AD7081E95C95",
        "life_cycle_state": "POSTED",
        "reference_number": "4881"
    },
    "status": {
        "code": "OK",
        "description": "",
        "message": ""
    }
}
 Example 6

HTTP Method: POST


Request:

Body:

{
    "token":{{token}},
    "accounts_receivable_identifier": {
        "number": "ACR0000001146"
    },
    "type_identifier": {
        "name": "Voucher Payment "
    },
    "life_cycle_state":"DRAFT",
    "payment_method_identifier": {
        "name": "Cash"
    },
    "payment_amount": "10.00",
   "products_to_pay_set": [
        {
            "product_identifier": {
                "code" : "MTV"
            }
        }
    ]
}

Response:

    {
        "data":
        {
            "posted_on": null,
            "number": null,
            "payment_amount": 10,
            "issued_on": "2017-09-18T18:09:58",
            "currency_rate_period": null,
            "id": "C877EF68E82C4B52ACEC5334E445A4B9",
            "life_cycle_state": "DRAFT",
            "reference_number": "642"
        },
        "status":
        {
            "code": "OK",
            "description": "",
            "message": ""
        }
    }