Record Tax Reversal Action

Reverses the recorded tax transactions in an external system, such as Stripe, after an order is returned or canceled.

This action is available in API version 62.0 and later for users with these licenses:

  • B2B Commerce, or D2C Commerce
  • Salesforce Order Management

Only store administrators can access this action.

Supported REST HTTP Methods 

URI: /services/data/vXX.X/actions/standard/recordTaxReversal

Formats: JSON, XML

HTTP Methods: POST

Authentication: Authorization: Bearer token

Inputs 

InputTypeDescription
taxReversalInfosApex-definedRequired. A list of Apex commercestoretax__TaxReversalInfo records containing details about the tax transactions for the order that was returned or canceled.

Outputs 

OutputTypeDescription
taxReversalResultApex-definedAn Apex commercestoretax__TaxReversalResult record containing details about each tax transaction in the reversal request. The details include whether each reversal was successful and, if not, any error messages returned.

Example 

Sample Request

1{
2   "inputs": [
3      {
4         "taxReversalInfos": {
5            "taxReversalInfoList": [
6               {
7                  "orderItemSummaryId": "10uxx0000004EdmAAE",
8                  "quantity": 1,
9                  "amount": -10,
10                  "taxAmount": 1.0
11               }
12            ]
13         }
14      }
15   ]
16}

Sample Response

1[
2   {
3      "actionName": "RECORD_TAX_REVERSAL",
4      "errors": null,
5      "invocationId": null,
6      "isSuccess": true,
7      "outputValues": {
8         "taxReversalResult": {
9            "success": true,
10            "resultItems": [
11               {
12                  "transactionReferenceNumber": "tax_1PcknrITDqIkouLURfR4pNAM",
13                  "success": true,
14                  "orderItemSummaryId": "10uxx0000004EicAAE",
15                  "lineItemReference": tax_li_QZM99en1lXKf9s,
16                  "errorMessage": null
17               }
18            ],
19            "errorMessage": null
20         }
21      },
22      "sortOrder": -1,
23      "version": 1
24   }
25]