Update correction status

The Update correction status method is used for approving or declining a correction. 1C can use this method to automate the accounting of payments cancelled in the platform or paid from the account balance (see also Create correction). A correction can be approved or declined for the current reseller or any of its downstream resellers. Additionally, the Correction approved event handler can be configured for approving a correction (see Creating an event handler).

An API token of a manager is required for authorization. To get an API token via the Operator Control Panel, see Viewing and updating manager's information

The manager's API token specified in an API request determines:

  • The role and access level of the manager, which determine the availability of a method.
  • The current reseller and downstream resellers accessible within a method.

PATCH {base_url}/api/v3/resellers/{reseller_id}/corrections/{correction_id}
{
    "data": {
        "attributes": {
            "status" : "{status}"
        }
    }
}

Arguments

Name

Parameter Type

Data type

Required/ Optional

Description

X-Api-TokenheaderstringRequiredAPI token of a manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredMedia type of the request. Specify the following: application/vnd.api+json
AcceptheaderstringRequired

Supported media types of the answer. Specify the following: application/vnd.api+json

base_urlpathstringRequiredActivePlatform URL
reseller_idpathintegerRequiredID of the current reseller or any of its downstream resellers (see Viewing and updating reseller general information)
correction_idpathintegerRequiredCorrection ID. To be approved or declined, the correction should have status = approval_required
dataformobjectRequiredInformation about the attributes of the operation

attributesformobjectRequiredAttributes of the operation


statusformstringRequired

Target status of the correction:

  • approved — to approve the correction.

    After approving a correction, several actions are performed in the platform as described at Approving a correction. Also, the account Owner can receive a dedicated notification Correction is approved (see Creating an event handler).

  • declined — to decline the correction.

Response model

If no errors are encountered, the method returns data as the information about the correction (see the response model in Create correction).

Request example

PATCH /api/v3/resellers/1/corrections/correction/738
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
{
    "data": {
        "attributes": {
            "status" : "approved"
        }
    }
}

Response example

{
    "data": {
        "id": "738",
        "type": "corrections",
        "attributes": {
            "created_at": "2021-08-10T12:18:42.721974+0300",
            "updated_at": "2021-08-10T12:19:36.144666+0300",
            "account_id": 710,
            "manager_id": 225,
            "status": "approved",
            "total": "100.25",
            "included_invoice": true,
            "subscription_id": 3008954,
            "period_from": "2021-12-01",
            "period_to": "2021-12-31",
            "comment": "top-up payment",
            "approved_at": "2021-08-10"
        }
    }
}