{"id":4375,"date":"2024-12-26T15:12:45","date_gmt":"2024-12-26T13:12:45","guid":{"rendered":"https:\/\/modulus.help\/kb\/docs\/documentation\/invoicing-v1\/api-update-invoice\/"},"modified":"2024-12-26T16:08:19","modified_gmt":"2024-12-26T14:08:19","slug":"api-update-invoice","status":"publish","type":"docs","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/invoicing-v1\/api-update-invoice\/","title":{"rendered":"API: Update Invoice"},"content":{"rendered":"\n<p>The purpose of this API is to update invoice.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Request<\/h4>\n\n\n<table>\n<tbody>\n<tr>\n<th>URL<\/th>\n<td>https:\/\/your_account.modulus.biz\/api\/inv\/v1\/Invoice?token=YOUR_TOKEN<\/td>\n<\/tr>\n<tr>\n<th>API Name<\/th>\n<td>Invoice<\/td>\n<\/tr>\n<tr>\n<th>Method<\/th>\n<td>PATCH<\/td>\n<\/tr>\n<tr>\n<th>Source<\/th>\n<td>Third Party Server<\/td>\n<\/tr>\n<tr>\n<th>Recipient<\/th>\n<td>modulus\u00ae Server<\/td>\n<\/tr>\n<tr>\n<th>Content Type<\/th>\n<td>application\/json<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n<h4 class=\"wp-block-heading\">Query String Parameters<\/h4>\n\n\n<table>\n<tbody>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<th>token<\/th>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>Your authentication token.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n<h4 class=\"wp-block-heading\">Payload Parameters<\/h4>\n\n\n<table>\n<tbody>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<th>\n<div>\n<div>invoice_id<\/div>\n<\/div>\n<\/th>\n<td>Yes<\/td>\n<td>Int<\/td>\n<td>The id of the invoice we want to change status<\/td>\n<\/tr>\n<tr>\n<th>\n<div>\n<div>status<\/div>\n<\/div>\n<\/th>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>possible values for status (STATUS_SENT,STATUS_VOID)<\/td>\n<\/tr>\n<tr>\n<th>\n<div>\n<div>invoice_number<\/div>\n<\/div>\n<\/th>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The number of the invoice we want to change status<\/td>\n<\/tr>\n<tr>\n<th>\n<div>\n<div>\n<div>\n<div>void_date<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/th>\n<td>No<\/td>\n<td>Date<\/td>\n<td>The date we want to void the invoice in<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n<h4 class=\"wp-block-heading\">Responses<\/h4>\n\n\n<table>\n<tbody>\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<tr>\n<th>Success Responses<\/th>\n<th>\u00a0<\/th>\n<th>\u00a0<\/th>\n<th>\u00a0<\/th>\n<th>\u00a0<\/th>\n<\/tr>\n<tr>\n<td>200 OK<\/td>\n<td>true<\/td>\n<td>Success<\/td>\n<td>Invoice Status changed successfully<\/td>\n<td>\u00a0<\/td>\n<\/tr>\n<tr>\n<th>Failure Responses<\/th>\n<th>\u00a0<\/th>\n<th>\u00a0<\/th>\n<th>\u00a0<\/th>\n<th>\u00a0<\/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><code>{ \"error_code\": xxx }<\/code><\/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><code>{ \"error_code\": xxx }<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n<h4 class=\"wp-block-heading\">Example 1<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Request<\/th><td><code>curl --request PATCH 'https:\/\/your_account.modulus.biz\/api\/inv\/v1\/Invoice?token=YOUR_TOKEN' \\ --header 'Content-Type: application\/json' \\ --data-raw '{ \"customer_details\": { \"invoice_id\": \"35\", \"status\": \"STATUS_SENT\", \"invoice_number\": \"<code>INV_2023_01_01_828<\/code>\", \"void_date\": \"<code>2023-01-14 19:59:22<\/code>\" }'<\/code><\/td><\/tr><tr><th>200 OK<\/th><td><code>{ \"result\": true, \"title\": \"Success\", \"message\": \"Invoice Status changed successfully\"}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Example 2<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Request<\/th><td><code>curl --request PATCH 'https:\/\/your_account.modulus.biz\/api\/inv\/v1\/Invoice?token=YOUR_TOKEN' \\ --header 'Content-Type: application\/json' \\ --data-raw <code>'{ \"customer_details\": { \"invoice_id\": \"35\", \"status\": \"STATUS_VOID\", \"invoice_number\": \"<code>INV_2023_01_01_828<\/code>\", \"void_date\": \"<code>2025-01-14 19:59:22<\/code>\" }'<\/code><\/code><\/td><\/tr><tr><th>400 Bad Request<\/th><td><code>{ \"result\": false, \"title\": \"Error\", \"message\": \"The void date cannot be in the future.\"}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"featured_media":0,"parent":4104,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"comment_count":0,"_links":{"self":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4375"}],"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=4375"}],"version-history":[{"count":12,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4375\/revisions"}],"predecessor-version":[{"id":4392,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4375\/revisions\/4392"}],"up":[{"embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4104"}],"prev":[{"title":"API: Create Return Receipt","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/invoicing-v1\/api-create-return-receipt\/","href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4127"}],"wp:attachment":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/media?parent=4375"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/doc_tag?post=4375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}