The Create correction method is used for generating a correction for the specified account and including it in an invoice. 1C can use this method to automate the accounting of payments cancelled in the platform or paid from the account balance (see also Update correction status). A correction can be generated for the current reseller or any of its downstream resellers.
POST {base_url}/api/v3/resellers/{reseller_id}/corrections
{
"data": {
"attributes": {
"account_id" : {account_id},
"included_invoice" : {included_invoice},
"subscription_id" : {subscription_id},
"period_from" : "{period_from}",
"period_to" : "{period_to}",
"total" : "{total}",
"comment" : "{comment}"
}
}
}
Arguments
Response model
If no errors are encountered, the method returns data as the information about the created correction with the 201 Created status.
|
Name |
Data type |
Description |
|||||
|---|---|---|---|---|---|---|---|
|
data |
object |
Response data |
|||||
|
|
id |
string |
Correction ID |
||||
|
|
type |
string |
Data type |
||||
|
|
attributes |
object |
Correction information |
||||
|
|
|
created_at |
string |
Date and time of the correction creation |
|||
|
|
|
updated_at |
string |
Date and time of the correction update |
|||
|
|
|
account_id |
integer |
ID of an account for which the correction is applied |
|||
|
|
|
manager_id |
integer |
ID of a manager who created the correction |
|||
|
|
|
status |
string |
Current status of the correction:
|
|||
|
|
|
total |
string |
Correction amount |
|||
|
|
|
included_invoice |
bool |
Indicates whether the correction should be included in an invoice:
|
|||
|
|
|
subscription_id |
integer |
ID of a subscription for which the correction is applied if |
|||
|
|
|
period_from |
string |
The start date of a period for which the correction is applied (YYYY-MM-DD) if |
|||
|
|
|
period_to |
string |
The finish date of a period for which the correction is applied (YYYY-MM-DD) if |
|||
|
|
|
сomment |
string |
Comment by the manager |
|||
|
|
|
approved_at |
string |
Date of the correction approval (YYYY-MM-DD) |
|||
Request example
POST /api/v3/resellers/1/corrections
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
{
"data": {
"attributes": {
"account_id" : 710,
"included_invoice" : true,
"subscription_id" : 3008954,
"period_from" : "2021-12-01",
"period_to" : "2021-12-31",
"total" : "100.25",
"comment" : "top-up payment"
}
}
}
Response example
{
"data": {
"id": "738",
"type": "corrections",
"attributes": {
"created_at": "2021-08-10T12:18:42.721974+0300",
"updated_at": "2021-08-10T12:18:42.721974+0300",
"account_id": 710,
"manager_id": 225,
"status": "approval_required",
"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": null
}
}
}