{"id":4340,"date":"2024-12-26T14:04:19","date_gmt":"2024-12-26T12:04:19","guid":{"rendered":"https:\/\/modulus.help\/kb\/docs\/documentation\/cash-apis-v1\/api-update-transaction\/"},"modified":"2024-12-26T16:09:19","modified_gmt":"2024-12-26T14:09:19","slug":"api-update-transaction","status":"publish","type":"docs","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/cash-apis-v1\/api-update-transaction\/","title":{"rendered":"API: Update Transaction"},"content":{"rendered":"\n<p>The purpose of this API is to update transaction.<\/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\/csh\/v1\/Transaction?token=YOUR_TOKEN<\/td>\n<\/tr>\n<tr>\n<th>API Name<\/th>\n<td>Transaction<\/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>transaction_id<\/div>\n<\/div>\n<\/th>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>The id of the transaction want to be updated<\/td>\n<\/tr>\n<tr>\n<th>\n<div>\n<div>transaction_number<\/div>\n<\/div>\n<\/th>\n<td>Yes<\/td>\n<td>Text<\/td>\n<td>Number of the transaction want to be updated<\/td>\n<\/tr>\n<tr>\n<th>\n<div>\n<div>void_date<\/div>\n<\/div>\n<\/th>\n<td>No<\/td>\n<td>Text<\/td>\n<td>Date we want to void the transaction at.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n<h3 class=\"wp-block-heading\">Responses<\/h3>\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>Transaction updated successfully.<\/td>\n<td><code>{ \"transaction_id\": xxx, \"transaction_number\": \"YYY_ZZZZ\", \"void_date\": \"yyy-mm-dd hh:MM:ss\" }<\/code><\/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<p>\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\/csh\/v1\/Transaction?token=YOUR_TOKEN' \\ --header 'Content-Type: application\/json' \\ --data-raw '{ \"transaction_id\": \"17\", \"transaction_number\": \"TSH-2024-0155\", \"void_date\": \"2024-02-01\"}'<\/code><\/td><\/tr><tr><th>200 OK<\/th><td><code>{ \"result\": true, \"title\": \"Success\", \"message\": \"Transaction voided successfully\" }<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<\/p>\n\n\n<h4 class=\"wp-block-heading\">Example 2<\/h4>\n\n\n<p>\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\/csh\/v1\/Transaction?token=YOUR_TOKEN' \\ --header 'Content-Type: application\/json' \\ --data-raw '{ \"transaction_id\": \"12\", \"transaction_number\": \"RCT-2024-0055\", \"void_date\": \"2024-01-01\"} }'<\/code><\/td><\/tr><tr><th>400 Bad Request<\/th><td><code>{ \"result\": false, \"title\": \"Error\", \"message\": \"The void date cannot be before the transaction date\"}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<\/p>","protected":false},"featured_media":0,"parent":4165,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"comment_count":0,"_links":{"self":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4340"}],"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=4340"}],"version-history":[{"count":20,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4340\/revisions"}],"predecessor-version":[{"id":4393,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4340\/revisions\/4393"}],"up":[{"embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4165"}],"prev":[{"title":"API: Create Transaction","link":"https:\/\/modulus.help\/kb\/docs\/documentation\/cash-apis-v1\/api-create-transaction\/","href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/docs\/4166"}],"wp:attachment":[{"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/media?parent=4340"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/modulus.help\/kb\/wp-json\/wp\/v2\/doc_tag?post=4340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}