{"id":4127,"date":"2024-04-04T16:13:08","date_gmt":"2024-04-04T14:13:08","guid":{"rendered":"https:\/\/modulus.help\/kb\/?post_type=docs&#038;p=4127"},"modified":"2025-02-25T13:37:50","modified_gmt":"2025-02-25T11:37:50","slug":"api-create-return-receipt","status":"publish","type":"docs","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/invoicing-v1\/api-create-return-receipt\/","title":{"rendered":"API: Create Return Receipt"},"content":{"rendered":"<p>The purpose of this API is to create new return receipt.<\/p>\n<h4>Request<\/h4>\n<table style=\"width: auto;\">\n<tbody>\n<tr>\n<th style=\"text-align: left;\">URL<\/th>\n<td>https:\/\/your_account.modulus.biz\/api\/inv\/v1\/Return Receipt?token=YOUR_TOKEN<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">API Name<\/th>\n<td>Return Receipt<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">Method<\/th>\n<td>POST<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">Source<\/th>\n<td>Third Party Server<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">Recipient<\/th>\n<td>modulus\u00ae Server<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">Content Type<\/th>\n<td>application\/json<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Query String Parameters<\/h4>\n<table style=\"width: auto;\">\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th style=\"text-align: left;\">token<\/th>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>Your authentication token.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Payload Parameters<\/h4>\n<table style=\"width: auto;\">\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th style=\"text-align: left;\">customer_details<\/th>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>Refers to customer info the return receipt issued to. The structure explained <a href=\"#customer_details\">here <\/a>.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">branch_code<\/th>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The code of an active branch.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">account_code<\/th>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The code of the cash account receives the cash amount.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">date<\/th>\n<td>Yes<\/td>\n<td>Date<\/td>\n<td>Date format must be ISO 8601 (Example: \u201c2020-01-10\u201d).<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">book_id<\/th>\n<td>Yes<\/td>\n<td>Number<\/td>\n<td>Refers to cash book used for the return receipt.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">exchange_rate<\/th>\n<td>No<\/td>\n<td>Decimal Number<\/td>\n<td>The exchange rate when the receipt is issued. Mandatory if the customer has foreign currency.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">salesperson_id<\/th>\n<td>No<\/td>\n<td>Number<\/td>\n<td>Refers to salesperson linked to the branch of this Return Receipt.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">reference<\/th>\n<td>No<\/td>\n<td>Text<\/td>\n<td>Return Receipt reference.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">description<\/th>\n<td>No<\/td>\n<td>Text<\/td>\n<td>Return Receipt description.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">items<\/th>\n<td>Yes<\/td>\n<td>Array<\/td>\n<td>An array that contains at least one item. The structure explained <a href=\"#items_details\">here<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 id=\"items_details\">Item Parameter Details<\/h4>\n<table style=\"width: auto;\">\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th style=\"text-align: left;\">item_code<\/th>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>Item code.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">unit_id<\/th>\n<td>Yes<\/td>\n<td>Number<\/td>\n<td>Refer to the unit of the sent quantity.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">quantity<\/th>\n<td>Yes<\/td>\n<td>Decimal<\/td>\n<td>Number The quantity of the item can not be less than or equal to 0.<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left;\">unit_price<\/th>\n<td>No<\/td>\n<td>Decimal<\/td>\n<td>Number The price of the item. If not sent will defined price in the customer or branch default price list.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 id=\"customer_details\">Customer Parameter Details<\/h4>\n<table style=\"width: auto;\">\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">code<\/td>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The code of the customer the return receipt issued to.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">name<\/td>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The name of the customer the return receipt issued to.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">type<\/td>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The type of the customer the return receipt issued to. Possible values are: (individual\/organization).<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">tax_registration_number<\/td>\n<td>No<\/td>\n<td>Number<\/td>\n<td>Customer&#8217;s Tax Registration Number.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">account_code<\/td>\n<td>No<\/td>\n<td>Text<\/td>\n<td>The code of the cash account of the customer.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">price_list_code<\/td>\n<td>No<\/td>\n<td>Number<\/td>\n<td>The code of the price list of the customer. It must have the same currency as the customer and account.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">address<\/td>\n<td>No<\/td>\n<td>Object<\/td>\n<td>The address of the customer. The structure explained <a href=\"#address_details\">here<\/a>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">contact<\/td>\n<td>No<\/td>\n<td>Object<\/td>\n<td>The contact of the customer. The structure explained <a href=\"#contact_details\">here<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 id=\"address_details\">Address Parameter Details<\/h4>\n<table style=\"width: auto;\">\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">label<\/td>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The label of the address.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">country_code<\/td>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The country code of the address (Example: &#8220;EG&#8221;).<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">city<\/td>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The name of the city in the specified country.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">address<\/td>\n<td>No<\/td>\n<td>Text<\/td>\n<td>Additional info of the address.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 id=\"contact_details\">Contact Parameter Details<\/h4>\n<table style=\"width: auto;\">\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">type<\/td>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The type of the contact provided. Possible values are: (mobile\/phone\/email\/fax\/website\/other).<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">label<\/td>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The label of the contact.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">value<\/td>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The value of the contact.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Responses<\/h4>\n<table style=\"width: auto;\">\n<thead>\n<tr>\n<th>HTTP Status<\/th>\n<th>result<\/th>\n<th>title<\/th>\n<th>message<\/th>\n<th>object<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th colspan=\"5\">Success Responses<\/th>\n<\/tr>\n<tr>\n<td>200 OK<\/td>\n<td>true<\/td>\n<td>Success<\/td>\n<td>Return Receipt added successfully.<\/td>\n<td>\n<pre><code class=\"json\">{\n    \"return_receipt_id\": xxx,\n    \"return_receipt_serial\": \"YYYY_ZZZ\",\n    \"document_type\": \"Return Receipt\",\n    \"creation_date_time\": \"yyy-mm-dd hh:MM:ss\"\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<th colspan=\"5\">Failure Responses<\/th>\n<\/tr>\n<tr>\n<td>400 Bad Request<\/td>\n<td>false<\/td>\n<td>Error<\/td>\n<td>Error message as elaborated here.<\/td>\n<td>\n<pre><code class=\"json\">{\n    \"error_code\": xxx\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>500 Internal Server Error<\/td>\n<td>false<\/td>\n<td>Error<\/td>\n<td>Error message as elaborated here.<\/td>\n<td>\n<pre><code class=\"json\">{\n    \"error_code\": xxx\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Example 1<\/h4>\n<table style=\"width: auto;\">\n<tbody>\n<tr>\n<th>Request<\/th>\n<td>\n<pre><code class=\"json\">curl --request POST 'https:\/\/your_account.modulus.biz\/api\/inv\/v1\/ReturnReceipt=YOUR_TOKEN' \\\n--header 'Content-Type: application\/json' \\\n--data-raw '{ \n    \"customer_details\": {\n        \"code\": \"1\",\n        \"name\": \"Test name\",\n        \"type\": \"individual\",\n        \"account_code\": \"1.6.10.2\",\n        \"price_list_code\": \"1\",\n        \"tax_registration_number\": \"1\",\n        \"contact\": {\n            \"type\": \"mobile\",\n            \"label\": \"\u0627\u0644\u0642\u0627\u0647\u0631\u0629 \u0627\u0644\u062c\u062f\u064a\u062f\u0629\",\n            \"value\": \"0102224791\"\n        },\n        \"address\": {\n            \"label\": \"HEADOFFICE\",\n            \"country_code\": \"EG\",\n            \"city\": \"Alexandria\",\n            \"address\": \"Test Address\"\n        }\n    },\n    \"account_code\": \"3.6\",\n    \"exchange_rate\": 20,\n    \"branch_code\": \"2\",\n    \"date\": \"2024-01-01\",\n    \"book_id\": 4,\n    \"payment_term_id\": 2,\n    \"items\": [\n        {\n            \"item_code\": \"451\",\n            \"unit_id\": 3,\n            \"quantity\": 50,\n            \"unit_price\": 100\n        }\n    ]\n}'<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<th>200 OK<\/th>\n<td>\n<pre><code class=\"json\">{\n    \"result\": true,\n    \"title\": \"Success\",\n    \"message\": \"Return Receipt added successfully.\",\n    \"object\": {\n        \"return_receipt_id\": 34,\n        \"return_receipt_serial\": \"RCT_2024_01_01_005\",\n        \"document_type\": \"Return Receipt\",\n        \"creation_date_time\": \"2024-01-14 00:09:00\"\n    }\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Example 2<\/h4>\n<table style=\"width: auto;\">\n<tbody>\n<tr>\n<th>Request<\/th>\n<td>\n<pre><code class=\"json\">curl --request POST 'https:\/\/your_account.modulus.biz\/api\/inv\/v1\/ReturnReceipt=YOUR_TOKEN' \\\n--header 'Content-Type: application\/json' \\\n--data-raw '{ \n    \"customer_details\": {\n        \"code\": \"1\",\n        \"name\": \"Test name\",\n        \"type\": \"individual\",\n        \"account_code\": \"1.6.10.2\",\n        \"price_list_code\": \"1\",\n        \"tax_registration_number\": \"1\",\n        \"contact\": {\n            \"type\": \"mobile\",\n            \"label\": \"\u0627\u0644\u0642\u0627\u0647\u0631\u0629 \u0627\u0644\u062c\u062f\u064a\u062f\u0629\",\n            \"value\": \"0102224791\"\n        },\n        \"address\": {\n            \"label\": \"HEADOFFICE\",\n            \"country_code\": \"EG\",\n            \"city\": \"Alexandria\",\n            \"address\": \"Test Address\"\n        }\n    },\n    \"account_code\": \"3.3.5\",\n    \"exchange_rate\": 20,\n    \"branch_code\": \"2\",\n    \"date\": \"2024-01-01\",\n    \"book_id\": 4,\n    \"payment_term_id\": 2,\n    \"reference\": \"CSH-084\",\n    \"items\": [\n        {\n            \"item_code\": \"6\",\n            \"unit_id\": 2,\n            \"quantity\": 15,\n            \"unit_price\": 40\n        }\n    ]\n}'<\/code><\/pre>\n<\/td>\n<\/tr>\n<tr>\n<th>400 Bad Request<\/th>\n<td>\n<pre><code class=\"json\">{\n    \"result\": false,\n    \"title\": \"Error\",\n    \"message\": \"Account currency is different than customer currency.\",\n    \"object\": {\n        \"error_code\": xxx\n    }\n}<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"featured_media":0,"parent":4104,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"comment_count":0,"_links":{"self":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4127"}],"collection":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/comments?post=4127"}],"version-history":[{"count":13,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4127\/revisions"}],"predecessor-version":[{"id":4398,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4127\/revisions\/4398"}],"up":[{"embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4104"}],"next":[{"title":"API: Update Invoice","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/invoicing-v1\/api-update-invoice\/","href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4375"}],"prev":[{"title":"API: Create Collection Receipt","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/invoicing-v1\/api-create-collection-receipt\/","href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4113"}],"wp:attachment":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/media?parent=4127"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/doc_tag?post=4127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}