Update a Reseller's 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 a Reseller's 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).
A Manager with the Product owner role cannot approve or decline a Correction (see Managers' roles and Get the Reseller's Manager by ID).
The Manager's API token specified in an API request determines 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-Token | header | string | Required | API token of a Manager that performs the operation (see Viewing and updating manager's information) | |||||
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 Viewing and updating reseller general information) | |||||
correction_id | path | integer | Required | Correction ID. To be approved or declined, the Correction should have the approval_required current status | |||||
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:
|
Response model
If no errors are encountered, the method returns data as the information about the Correction (see the response model in Create a Reseller's 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"
}
}
}