Payments

Get payments list

GET /payments/payments/[/start_date/#{start_date}][/end_date/#{end_date}][/clients/#{clients}][/number/#{number}][/amount_operator/#{amount_operator}][/amount/#{amount}][/currency/#{currency}]

URI arguments

Argument Type Required Value/Description
start_date date If the argument is not specified, the default is the first day of the current month.
end_date date If the argument is not specified, the default is the last day of the current month.
clients string One or more clients to filter. You can pass several clients at the same time by using “:” as a separator.
For example: /clients/Client%20Name:Another%20Client%20Name
number string All or part of a payment number to filter (equivalent to the MySQL function “LIKE ‘#{number}%’”.
amount_operator string See the possible values ​​of operator.
amount double An amount.
currency string See the possible values ​​of currency.

cURL request example

curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-X GET https://#{subdomain}.iscriba.com/api/payments/payments/currency/EUR

XML response example

HTTP Status: 200 OK

<?xml version="1.0" encoding="utf-8"?>
<xml>
	<payments>
		<payment>
			<payment_id>2</payment_id>
			<number>000002</number>
			<client_name>Client Name</client_name>
			<amount>80.4</amount>
			<amount_unapplied>0</amount_unapplied>
			<currency>EUR</currency>
			<date>2010-12-09</date>
			<method>CRE</method>
			<method_specified></method_specified>
			<reference_number>000001</reference_number>
			<notes></notes>
			<invoices>
				<invoice>
					<invoice_id>29</invoice_id>
					<invoice_number>F10120002</invoice_number>
					<grand_total>119.6</grand_total>
					<amount_applied>80.4</amount_applied>
					<amount_unapplied>0</amount_unapplied>
					<status>ppaid</status>
				</invoice>
			</invoices>
		</payment>
		<payment>
			<payment_id>1</payment_id>
			<number>000001</number>
			<client_name>Client Name</client_name>
			<amount>200</amount>
			<amount_unapplied>0</amount_unapplied>
			<currency>EUR</currency>
			<date>2010-12-09</date>
			<method>CHQ</method>
			<method_specified></method_specified>
			<reference_number>2125232</reference_number>
			<notes></notes>
			<invoices>
			    <invoice>
			    	<invoice_id>28</invoice_id>
			    	<invoice_number>F10120001</invoice_number>
			    	<grand_total>119.6</grand_total>
			    	<amount_applied>119.6</amount_applied>
			    	<amount_unapplied>0</amount_unapplied>
			    	<status>paid</status>
			    </invoice>
			</invoices>
			<credits>
			    <credit>
			    	<payment_id>2</payment_id>
			    	<number>000002</number>
			    	<date>2010-12-09</date>
			    	<amount>80.4</amount>
			    </credit>
			</credits>
		</payment>
		<payment>
		...
		</payment>
	</payments>
</xml>


Top


Get a payment

GET /payments/payment/id/#{payment_id}

URI arguments

Argument Type Required Value
id integer yes Le #{payment_id} du paiement que vous souhaitez obtenir.

cURL request example

curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-X GET https://#{subdomain}.iscriba.com/api/payments/payment/id/1

XML response example

HTTP Status: 200 OK

<?xml version="1.0" encoding="utf-8"?>
<xml>
	<payment>
		<payment_id>1</payment_id>
		<number>000001</number>
		<client_name>Client Name</client_name>
		<amount>200</amount>
		<amount_unapplied>0</amount_unapplied>
		<currency>EUR</currency>
		<date>2010-12-09</date>
		<method>CHQ</method>
		<method_specified></method_specified>
		<reference_number>2125232</reference_number>
		<notes></notes>
		<invoices>
			<invoice>
				<invoice_id>28</invoice_id>
				<invoice_number>F10120001</invoice_number>
				<grand_total>119.6</grand_total>
				<amount_applied>119.6</amount_applied>
				<amount_unapplied>0</amount_unapplied>
				<status>paid</status>
			</invoice>
		</invoices>
		<credits>
			<credit>
				<payment_id>2</payment_id>
				<number>000002</number>
				<date>2010-12-09</date>
				<amount>80.4</amount>
			</credit>
		</credits>
	</payment>
</xml>

Top


Record a payment

POST /payments/payment

Request fields

Field Type Required Description
amount double yes The amount of the payment.
client_id integer yes The #{client_id} of the client for which you want to record a payment.
currency string yes Currency of the payment. See the possible values ​​of currency.
date date Date of the payment. If the field is not specified, the default value is the current day.
payment string Method of payment. The default is the one from your account settings. See the possible values ​​of payment.
reference_number string A reference number for the payment. For example, it can be a check number.
notes string Notes you may want to add to the payment.
invoices array yes (at least a line) The invoices on which you want the payment distributed.
invoices[#{invoice_id}] double yes The amount you want to distribute to the invoice.

cURL request example

curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-d "amount=99.99&client_id=10&currency=EUR&invoices[10]=99.99"\
https://#{subdomain}.iscriba.com/api/payments/payment

XML response example

HTTP Status: 201 Created

<?xml version="1.0" encoding="utf-8"?>
<xml>
	<payment_id>1</payment_id>
</xml>	

Top


Supprimer un paiement

DELETE /payments/payment/id/#{payment_id}

URI arguments

Argument Type Required Value
id integer yes The #{payment_id} of the payment you wish to delete.

cURL request example

curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-X DELETE https://#{subdomain}.iscriba.com/api/payments/payment/id/1

XML response example

HTTP Response: 200 OK

<?xml version="1.0" encoding="utf-8"?>
<xml>
	<payment_id>1</payment_id>
</xml>	


Top


Utiliser un crédit

POST /payments/credit

Request fields

Field Type Required Description
payment_id integer yes THe #{payment_id} of the payment for which you want to use the amount available.
client_id integer yes The #{client_id} the client for whom you receive the payment.
currency string yes Currency of the payment. See the possible values ​​of currency.
date date Date of the payment. If the field is not specified, the default value is the current day.
notes string Notes you may want to add to the payment.
invoices array yes (at least a line) The invoices on which you want the payment distributed.
invoices[#{invoice_id}] double yes The amount you want to distribute to the invoice.

cURL request example

curl -u #:#{password}'\
-H 'User-Agent: #{user_agent}'\
-d "payment_id=1&client_id=10&currency=EUR&invoices[15]=12.30"\
https://#{subdomain}.iscriba.com/api/payments/credit

XML response example

HTTP Status: 201 Created

<?xml version="1.0" encoding="utf-8"?>
<xml>
	<payment_id>1</payment_id>
</xml>	

Top