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 ).

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

Arguments

Name

Parameter Type

Data type

Required/ Optional

Description

X-Api-Token

header

string

Required

API token of a manager that performs the operation (see


)

Content-Type

header

string

Required

Media type of the request. Specify the following: application/vnd.api+json

Accept

header

string

Required

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

base_url

path

string

Required

ActivePlatform URL

reseller_id

path

integer

Required

ID of the current reseller or any of its downstream resellers (see 


)

correction_id

path

integer

Required

Correction ID. To be approved or declined, the correction should have status = approval_required

data

form

object

Required

Information about the attributes of the operation


attributes

form

object

Required

Attributes of the operation



status

form

string

Required

Target status of the correction:

  • approved — to approve the correction.

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

  • 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

XML
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
JSON
{
    "data": {
        "attributes": {
            "status" : "approved"
        }
    }
}

Response example

JSON
{
    "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"
        }
    }
}