Anular un ajuste aplicado
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{subscription_id}/adjustments/{id}/annul \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"reason": "<string>"
}
'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{subscription_id}/adjustments/{id}/annul', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{subscription_id}/adjustments/{id}/annul"
payload = { "reason": "<string>" }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"payload": {
"id": 123,
"adjustment_type": "debit",
"recurrence_type": "fixed_cycles",
"amount": 123,
"concept": "<string>",
"start_period": "2023-12-25",
"end_period": "2023-12-25",
"lifecycle_status": "pending_application",
"locked_for_editing": true,
"can_cancel_future_applications": true,
"editable_forward": true,
"total_cycles": 123,
"cycles_applied": 123,
"active": true,
"remaining_cycles": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": 123,
"name": "<string>"
},
"status": "<string>",
"release_status": "pending_evidence",
"requires_evidence": true,
"adjustment_concept_id": 123,
"product_id": 123,
"product_snapshot": {},
"product_base_amount": 123,
"vat_rate": 123,
"subscription_id": 123,
"currency": "<string>",
"property": {
"id": 123,
"address": "<string>"
}
}
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Treasury Adjustments
Anular un ajuste aplicado
Saca un ajuste ya aplicado de los meses abiertos que lo congelaron. Esos meses dejan de deberlo, el ajuste queda anulado (release_status: void) y no vuelve a aplicarse, tampoco en los meses que faltan si es recurrente. Los pagos ya recibidos en esos meses dejan de cubrirlo, y un mes que quede cubierto por completo se cierra. Los meses ya pagados conservan lo que recaudaron. Solo es posible mientras applied_change.allowed sea true en el ajuste (mira Ver un ajuste); el motivo queda en la auditoría del ajuste.
POST
/
api
/
v1
/
accounts
/
{account_id}
/
treasury
/
subscriptions
/
{subscription_id}
/
adjustments
/
{id}
/
annul
Anular un ajuste aplicado
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{subscription_id}/adjustments/{id}/annul \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"reason": "<string>"
}
'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{subscription_id}/adjustments/{id}/annul', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/treasury/subscriptions/{subscription_id}/adjustments/{id}/annul"
payload = { "reason": "<string>" }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"payload": {
"id": 123,
"adjustment_type": "debit",
"recurrence_type": "fixed_cycles",
"amount": 123,
"concept": "<string>",
"start_period": "2023-12-25",
"end_period": "2023-12-25",
"lifecycle_status": "pending_application",
"locked_for_editing": true,
"can_cancel_future_applications": true,
"editable_forward": true,
"total_cycles": 123,
"cycles_applied": 123,
"active": true,
"remaining_cycles": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": 123,
"name": "<string>"
},
"status": "<string>",
"release_status": "pending_evidence",
"requires_evidence": true,
"adjustment_concept_id": 123,
"product_id": 123,
"product_snapshot": {},
"product_base_amount": 123,
"vat_rate": 123,
"subscription_id": 123,
"currency": "<string>",
"property": {
"id": 123,
"address": "<string>"
}
}
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}