Undo and Backout Activity
Use the Aria Allegro Operations GraphQL API to reverse completed billing runs, remove usage file transactions processed in error, and clear job schedule records so billing can re-run for the same date. All API calls target the Allegro Operations GraphQL endpoint, which is environment-specific.
Before calling any operation, obtain a valid bearer token. See Allegro API Authentication for instructions.
Back Out an Anniversary Date Billing Run
Use the undoJobSchedule mutation to reverse a completed billing run and re-trigger it correctly. After the undo completes, you can re-run billing for the same date.
When to Use This
Two situations require you to undo a billing run:
Situation 1—Price Correction
A pricing error was found after billing completed. This applies to two types of corrections:
- Usage price offer correction—The wrong rate or usage price plan was applied to your customers. All usage records must be discarded and re-rated under the corrected pricing.
- Commitment price offer correction—The commitment contract value (Quantity/Amount Commitment) was set incorrectly. Because the commitment value drives the true-up calculation, the entire billing batch must be reversed and re-run against the corrected contract.
Use Situation 1 when:
- A usage rate plan or price offer was incorrectly configured and has since been corrected.
- A customer's commitment contract value was wrong and has since been corrected.
- All usage records for the affected period must be discarded and re-rated under the corrected pricing or commitment value.
Note: Correct pricing in Aria Allegro or Aria Core before submitting the undo request. The system re-rates usage immediately after the undo completes, so corrected pricing must already be in place.
Complete the following steps before submitting the undo request:
| Step | Action | Where |
|---|---|---|
| 1 | Correct the rate plan, price offer, or commitment contract value. | Aria Core—if the customer uses custom pricing configured in Aria Core Aria Allegro—if the customer uses standard pricing configured directly in Allegro |
| 2 | Discard all usages and orders for the billing period if data was already synced to Aria Core. | Aria Core |
| 3 | Submit the undoJobSchedule API call with discardUsage: true. |
Aria Allegro Operations API |
| 4 | Wait for status COMPLETED via getUndoJobScheduleStatus. |
Aria Allegro Operations API |
| 5 | Process all usage files for the billing period to re-rate usage under the corrected pricing. | Aria Allegro usage processing |
| 6 | Re-trigger the billing job for the same billing date. | Aria Allegro job scheduling |
Situation 2—Missed Usage or Wrong True-Up
Usage records were not processed before billing ran. As a result, the true-up amount (the end-of-period adjustment for commitment-based customers) was calculated incorrectly. Only the billing output needs to be reversed—the usage records are correct and do not need to be discarded.
Use Situation 2 when:
- Usage files or feeds were delayed and missed the billing window.
- The billing job ran but true-up values are wrong because not all usage was accounted for.
- You want to preserve existing usage and re-run billing with the complete set of usage records.
| Step | Action | Where |
|---|---|---|
| 1 | Submit the undoJobSchedule API call with discardUsage: false. |
Aria Allegro Operations API |
| 2 | Wait for status COMPLETED via getUndoJobScheduleStatus. |
Aria Allegro Operations API |
| 3 | Process all missed usage records for the billing period. | Aria Allegro usage processing |
| 4 | Re-trigger the billing job for the same billing date. | Aria Allegro job scheduling |
Quick Decision Guide
- Was there a pricing or rate error on a usage offer? Use
discardUsage: true. Discard and re-rate all usage from scratch under the corrected pricing. - Was a customer’s Volume Commitment contract value wrong? Use
discardUsage: true. Discard usage and re-run billing against the corrected commitment contract. - Were some usage records missing before billing ran, causing a wrong true-up? Use
discardUsage: false. Keep existing usage and re-run billing with the complete usage set.
API Reference
undoJobSchedule—Reverse a Billing Run
Type: Mutation
Submits an undo request for a completed billing run. The operation runs in the background and returns immediately with a tracking ID (<undoBatchId>).
Input Parameters
| Parameter | Required | Description |
|---|---|---|
<billingDate> |
Yes | The billing period date to undo. Format: YYYY-MM-DD or YYYY-MM-DD HH:mm:ss. |
<clientId> |
Yes | The client (tenant) ID. |
<discardUsage> |
No | true for price correction (re-rate all usage). false or omitted for missed usage or wrong true-up. |
<userId> |
No | The user ID performing the action. If omitted, the system default user is used. |
Response Fields
| Field | Description |
|---|---|
<undoBatchId> |
A unique tracking ID for this undo request. Save this value to check the outcome. |
<status> |
PROCESSING on a successful submission, or ERROR if the request was rejected. |
<errorCode> |
Populated if the request was rejected before processing started. |
<errorMessage> |
A description of the error. |
<clientId> |
The client ID provided in the request. |
getUndoJobScheduleStatus—Check the Outcome
Type: Query
Retrieves the current status of a previously submitted undo request using the <undoBatchId> returned by undoJobSchedule.
Input Parameters
| Parameter | Required | Description |
|---|---|---|
<batchId> |
Yes | The <undoBatchId> returned from the undoJobSchedule mutation. |
<clientId> |
Yes | The client (tenant) ID. |
Response Fields
| Field | Description |
|---|---|
<undoBatchId> |
The tracking ID of the undo request. |
<status> |
PROCESSING—still running. COMPLETED—finished successfully. ERROR—failed. |
<totalCount> |
Number of billing records reversed. Populated once status is COMPLETED. |
<errorCode> |
Populated if the undo failed during background processing. |
<errorMessage> |
A description of what went wrong. |
<clientId> |
The client ID associated with this request. |
Procedure
Step 1: Submit the Undo Request
The undo runs in the background. You receive an immediate response containing a <undoBatchId> and status PROCESSING.
Situation 1—Price correction (discard usage):
mutation {
undoJobSchedule(undoJobScheduleInput: {
billingDate: "2026-04-01 00:00:00"
clientId: 1001
discardUsage: true
userId: "ops.admin"
}) {
undoBatchId
status
errorCode
errorMessage
clientId
}
}
Situation 2—Missed usage or wrong true-up (keep usage):
mutation {
undoJobSchedule(undoJobScheduleInput: {
billingDate: "2026-04-01 00:00:00"
clientId: 1001
discardUsage: false
userId: "ops.admin"
}) {
undoBatchId
status
errorCode
errorMessage
clientId
}
}
Example successful response:
{
"data": {
"undoJobSchedule": {
"undoBatchId": "a3f1c2d4-89ab-4c56-a012-b4567890cdef",
"status": "PROCESSING",
"errorCode": null,
"errorMessage": null,
"clientId": 1001
}
}
}
Note: Save the <undoBatchId> value from the response. You need it to check whether the undo completed successfully.
Step 2: Check the Status
Use the <undoBatchId> from Step 1 to poll for the result. The background process typically completes within a few seconds to a few minutes depending on data volume.
query {
getUndoJobScheduleStatus(
batchId: "a3f1c2d4-89ab-4c56-a012-b4567890cdef"
clientId: 1001
) {
undoBatchId
status
totalCount
errorCode
errorMessage
clientId
}
}
Example response—still running:
{
"data": {
"getUndoJobScheduleStatus": {
"undoBatchId": "a3f1c2d4-89ab-4c56-a012-b4567890cdef",
"status": "PROCESSING",
"totalCount": 0,
"errorCode": null,
"errorMessage": null,
"clientId": 1001
}
}
}
Example response—completed successfully:
{
"data": {
"getUndoJobScheduleStatus": {
"undoBatchId": "a3f1c2d4-89ab-4c56-a012-b4567890cdef",
"status": "COMPLETED",
"totalCount": 842,
"errorCode": null,
"errorMessage": null,
"clientId": 1001
}
}
}
Example response—failed:
{
"data": {
"getUndoJobScheduleStatus": {
"undoBatchId": "a3f1c2d4-89ab-4c56-a012-b4567890cdef",
"status": "ERROR",
"totalCount": 0,
"errorCode": "SYSTEM_ERROR",
"errorMessage": "No billing batch found for the given billing date",
"clientId": 1001
}
}
}
Step 3: Re-run Billing
Once the status is COMPLETED, the billing cycle for the given date has been fully reset. Re-trigger the billing job for that date through the normal job scheduling process.
Notes
Note: This operation reverses the billing run in Aria Allegro only. It does not make any changes in Aria Core. If billing data was already synced to Aria Core, discard those records in Aria Core before re-running billing. Coordinate with the Aria Core operations team to ensure both systems are aligned before triggering a re-run.
- Only one undo can be processed at a time per client. Wait for the current undo to reach
COMPLETEDorERRORbefore submitting another. - The
<billingDate>value must exactly match a date for which a billing run was completed. If no billing batch is found for that date, the request returns an error. - Commitment-based customer balances are handled automatically. The system preserves and restores them correctly in both situations.
- Contact the engineering team if the status remains
PROCESSINGfor more than 10 minutes.
Back Out Usage File Transactions
Use the backoutUsageFileTransactions mutation to reverse the impact of one or more usage files that were processed in error.
When to Use This
Two situations require you to back out usage file transactions:
Situation 1—File Processed in Error, Billing Has Not Yet Run
A usage file was ingested and rated that should not have been—for example, a duplicate file, a test file submitted to production, the wrong file for the wrong client, or a file with incorrect data. The billing cycle for the affected period has not yet completed.
Use Situation 1 when:
- A usage file was processed that should not have been ingested.
- Transactions from the file are contaminating accumulator, allowance, or balance buckets.
- Billing has not yet run for the affected billing period.
- You want to remove the file’s impact entirely so usage can be resubmitted correctly.
| Step | Action | Where |
|---|---|---|
| 1 | Submit the backoutUsageFileTransactions API call with undoBilling: false. |
Aria Allegro Operations API |
| 2 | Wait for status COMPLETED via getUsageFileTxnsBackoutStatus. |
Aria Allegro Operations API |
| 3 | Correct the usage data or file and resubmit through normal usage processing. | Aria Allegro usage processing |
Situation 2—File Processed in Error and Billing Has Already Run
A usage file was ingested and rated incorrectly, and the billing cycle that covered that usage period has already completed. The incorrect usage records contributed to the true-up calculations for commitment-based customers, meaning the billing output is also affected.
Use Situation 2 when:
- A usage file was processed in error and the billing job for that period has already run.
- True-up billing amounts for commitment-based customers are incorrect because the bad usage was included.
- You need to reverse both the usage transactions and the completed billing cycle so billing can re-run against corrected usage.
Note: If the underlying issue was a pricing error, correct pricing before submitting the backout request. Usage resubmission happens after the backout completes.
| Step | Action | Where |
|---|---|---|
| 1 | Confirm whether billing data was already synced to Aria Core. If so, discard it in Aria Core first. | Aria Core |
| 2 | Submit the backoutUsageFileTransactions API call with undoBilling: true. |
Aria Allegro Operations API |
| 3 | Wait for status COMPLETED via getUsageFileTxnsBackoutStatus. |
Aria Allegro Operations API |
| 4 | Resubmit the corrected usage file through normal usage processing. | Aria Allegro usage processing |
| 5 | Re-trigger the billing job for the same billing date. | Aria Allegro job scheduling |
Quick Decision Guide
- Was the file submitted by mistake (duplicate, wrong file, or test data in production)?
- Has billing already run for the period covered by the file?
- No—Use
undoBilling: false. Remove usage transactions only, then resubmit the correct file. - Yes—Use
undoBilling: true. Remove usage transactions and reverse the billing cycle, then resubmit usage and re-run billing.
- No—Use
- Has billing already run for the period covered by the file?
- Was the file correct but the data inside it was wrong (bad CDR records)? Apply the same decision based on whether billing has already run for the affected period.
API Reference
backoutUsageFileTransactions—Reverse Usage File Transactions
Type: Mutation
Submits a backout request for one or more usage files. The operation runs in the background and returns immediately with a tracking ID (<backoutBatchId>).
Input Parameters
| Parameter | Required | Description |
|---|---|---|
<fileNames> |
Yes | Comma-separated list of file names to back out. Values must exactly match the file names stored in the system. |
<clientId> |
Yes | The client (tenant) ID. |
<userId> |
Yes | The user ID initiating the backout. Used for audit logging. |
<undoBilling> |
No | true to also reverse the billing cycle (true-up transactions and billing profile pointers). false or omitted to reverse usage transactions only. |
<backoutBatchId> |
No | Optional UUID to use as the tracking ID. If omitted, a new UUID is generated automatically. Useful for idempotent retries. |
Response Fields
| Field | Description |
|---|---|
<backoutBatchId> |
A unique tracking ID for this backout request. Save this value to check the outcome. |
<fileNames> |
The file names provided in the request. |
<clientId> |
The client ID provided in the request. |
<status> |
PROCESSING on a successful submission, or ERROR if the request was rejected before processing started. |
<errorMessage> |
A description of the error. Populated only if status is ERROR. |
getUsageFileTxnsBackoutStatus—Check the Outcome
Type: Query
Retrieves the current status of a previously submitted backout request using the <backoutBatchId> returned by backoutUsageFileTransactions.
Input Parameters
| Parameter | Required | Description |
|---|---|---|
<backoutBatchId> |
Yes | The <backoutBatchId> returned from the backoutUsageFileTransactions mutation. |
<clientId> |
Yes | The client (tenant) ID. |
Response Fields
| Field | Description |
|---|---|
<backoutBatchId> |
The tracking ID of the backout request. |
<fileNames> |
The file names that were backed out. |
<clientId> |
The client ID associated with this request. |
<userId> |
The user who submitted the request. |
<status> |
PROCESSING—still running. COMPLETED—finished successfully. ERROR—failed. |
<transactionsDeleted> |
Number of transaction records deleted. Populated once status is COMPLETED. |
<cdrStatsDeleted> |
Number of CDR (Call Detail Record) file processing stat records deleted. Populated once status is COMPLETED. |
<createDate> |
Timestamp when the request was submitted. |
<updateDate> |
Timestamp of the last status update. |
Procedure
Step 1: Submit the Backout Request
The backout runs in the background. You receive an immediate response containing a <backoutBatchId> and status PROCESSING.
Situation 1—File processed in error, billing not yet run (usage reversal only):
mutation {
backoutUsageFileTransactions(input: {
fileNames: "usage_file_001.csv,usage_file_002.csv"
clientId: 1001
userId: "ops.admin"
undoBilling: false
}) {
backoutBatchId
fileNames
clientId
status
errorMessage
}
}
Situation 2—File processed in error, billing has already run (full reversal including billing):
mutation {
backoutUsageFileTransactions(input: {
fileNames: "usage_file_001.csv,usage_file_002.csv"
clientId: 1001
userId: "ops.admin"
undoBilling: true
}) {
backoutBatchId
fileNames
clientId
status
errorMessage
}
}
Example successful response:
{
"data": {
"backoutUsageFileTransactions": {
"backoutBatchId": "a3f1c2d4-89ab-4c56-a012-b4567890cdef",
"fileNames": "usage_file_001.csv,usage_file_002.csv",
"clientId": 1001,
"status": "PROCESSING",
"errorMessage": null
}
}
}
Note: Save the <backoutBatchId> value from the response. You need it to check whether the backout completed successfully.
Step 2: Check the Status
Use the <backoutBatchId> from Step 1 to poll for the result. The background process typically completes within a few seconds to a few minutes depending on transaction volume.
query {
getUsageFileTxnsBackoutStatus(
backoutBatchId: "a3f1c2d4-89ab-4c56-a012-b4567890cdef"
clientId: 1001
) {
backoutBatchId
fileNames
clientId
userId
status
transactionsDeleted
cdrStatsDeleted
createDate
updateDate
}
}
Example response—still running:
{
"data": {
"getUsageFileTxnsBackoutStatus": {
"backoutBatchId": "a3f1c2d4-89ab-4c56-a012-b4567890cdef",
"fileNames": "usage_file_001.csv,usage_file_002.csv",
"clientId": 1001,
"userId": "ops.admin",
"status": "PROCESSING",
"transactionsDeleted": 0,
"cdrStatsDeleted": 0,
"createDate": "2026-06-01 10:00:00.0",
"updateDate": null
}
}
}
Example response—completed successfully:
{
"data": {
"getUsageFileTxnsBackoutStatus": {
"backoutBatchId": "a3f1c2d4-89ab-4c56-a012-b4567890cdef",
"fileNames": "usage_file_001.csv,usage_file_002.csv",
"clientId": 1001,
"userId": "ops.admin",
"status": "COMPLETED",
"transactionsDeleted": 4250,
"cdrStatsDeleted": 2,
"createDate": "2026-06-01 10:00:00.0",
"updateDate": "2026-06-01 10:00:43.0"
}
}
}
Example response—failed:
{
"data": {
"getUsageFileTxnsBackoutStatus": {
"backoutBatchId": "a3f1c2d4-89ab-4c56-a012-b4567890cdef",
"fileNames": "usage_file_001.csv,usage_file_002.csv",
"clientId": 1001,
"userId": "ops.admin",
"status": "ERROR",
"transactionsDeleted": 0,
"cdrStatsDeleted": 0,
"createDate": "2026-06-01 10:00:00.0",
"updateDate": "2026-06-01 10:00:05.0"
}
}
}
Step 3: Complete Post-Backout Actions
Once the status is COMPLETED, the file’s impact has been fully reversed. Next steps depend on the situation:
Situation 1 (usage reversal only): Correct or replace the usage file and resubmit it through normal usage processing. All CDR stats were deleted, so the system accepts the file as a fresh submission.
Situation 2 (full reversal including billing):
- Process the corrected usage file through normal usage processing.
- Re-trigger the billing job for the same billing date through the normal job scheduling process. The billing cycle pointers have been rolled back so billing will re-run for the correct period.
Notes
Note: This operation reverses usage file transactions in Aria Allegro only. It does not make any changes in Aria Core. If billing data was already synced to Aria Core, discard those records in Aria Core before re-running billing. Coordinate with the Aria Core operations team to ensure both systems are aligned before triggering a re-run.
- Concurrent backout protection: Only one backout can run at a time for the same set of files per client. If you submit a second backout for the same files while one is already running, the request immediately returns
ERRORwith the message “A backout is already running for one or more of these files; retry after it completes.” Wait for the in-flight backout to reachCOMPLETEDorERRORbefore retrying. - File names must match exactly: The
<fileNames>value must match the file names as stored in the system (case-sensitive, no path prefix, comma-separated with no extra spaces). If no transactions are found for a file name, that file is skipped and the counts reflect only records that were found. - Idempotent retry: To retry a failed backout, pass the original
<backoutBatchId>in the retry request. The system reuses that batch ID and overwrites the previous audit row rather than creating a duplicate. undoBilling: truerequires transactions to exist: The billing rollback step runs only if usage transactions were found and deleted. If the file names produce zero matching transactions, billing pointers are left untouched regardless of the<undoBilling>flag.- Contact the engineering team if the status remains
PROCESSINGfor more than 10 minutes.
Clear a Job Schedule
Use the clearJobSchedule mutation to delete all job scheduling records for a specific date and client. This operation is synchronous and returns the final status immediately—no polling is required.
When to Use This
Job schedule records track the state of every billing and usage processing run. Each scheduled date has a job_schedule entry with associated items and work unit records for the individual account payloads.
Use this operation when:
- A billing run completed successfully for a date.
- New accounts were onboarded or existing accounts were updated after the billing run completed.
- Those accounts need to be billed for the same billing period.
- You need to clear the completed job schedule so billing can re-run for that date to include the new accounts.
| Step | Action | Where |
|---|---|---|
| 1 | Confirm the original billing run has status COMPLETED for the target date. |
Aria Allegro job scheduling |
| 2 | Confirm all new or corrected accounts are set up correctly before re-running. | Aria Allegro / Aria Core |
| 3 | Submit the clearJobSchedule API call with the billing date. | Aria Allegro Operations API |
| 4 | Confirm the response status is COMPLETED. |
Aria Allegro Operations API |
| 5 | Re-trigger the billing job for the same date through the normal job scheduling process. | Aria Allegro job scheduling |
API Reference
clearJobSchedule—Clear Job Schedule Records for a Date
Type: Mutation
Deletes all job schedule records—including work items and job schedule list entries—for the specified schedule date and client. This operation is synchronous and returns the final status immediately.
Input Parameters
| Parameter | Required | Description |
|---|---|---|
<clientId> |
Yes | The client (tenant) ID. |
<scheduleDate> |
Yes | The schedule date to clear. Format: YYYY-MM-DD or YYYY-MM-DD HH:mm:ss. All job schedule records for this exact date will be deleted. |
Response Fields
| Field | Description |
|---|---|
<status> |
COMPLETED—all records for the date were deleted successfully. ERROR—the operation failed. |
<errorCode> |
Populated if status is ERROR. |
<errorMessage> |
A description of what went wrong. Populated only if status is ERROR. |
<clientId> |
The client ID provided in the request. |
Procedure
Step 1: Submit the Clear Job Schedule Request
This call runs synchronously. The result—COMPLETED or ERROR—is returned in the same response. No polling is required.
mutation {
clearJobSchedule(
clientId: 1001
scheduleDate: "2026-04-01 00:00:00"
) {
status
errorCode
errorMessage
clientId
}
}
Example response—completed successfully:
{
"data": {
"clearJobSchedule": {
"status": "COMPLETED",
"errorCode": null,
"errorMessage": null,
"clientId": 1001
}
}
}
Example response—failed:
{
"data": {
"clearJobSchedule": {
"status": "ERROR",
"errorCode": "SYSTEM_ERROR",
"errorMessage": "clientid is required",
"clientId": 1001
}
}
}
Note: A COMPLETED response means all job schedule records for the given date have been deleted. The date is now clear and the billing run can be re-triggered.
Step 2: Re-trigger the Billing Job
Once you receive COMPLETED, re-trigger the billing job for that date through the normal job scheduling process. The new accounts will be included in the fresh run.
Notes
Note: This operation is irreversible. Once records are deleted, the job schedule history and work item payloads for that date are gone. Confirm you are targeting the correct <clientId> and <scheduleDate> before executing.
- Date format is flexible: Both
YYYY-MM-DDandYYYY-MM-DD HH:mm:ssare accepted. The system normalizes the input to midnight (00:00:00) of the given date before matching against stored schedule records. - Only the specified date is affected: Only records whose schedule date exactly matches the normalized input date are deleted. Records for other dates under the same client are not affected.
COMPLETEDdoes not confirm records existed: If no job schedule records exist for the given date and client, the operation completes without error and returnsCOMPLETED. This is safe to call even if you are not certain records are present.- Do not use this as part of an undo billing workflow: The undoJobSchedule API already handles resetting job schedules as part of reversing a billing run. Use clearJobSchedule only when billing completed successfully and needs to re-run for new accounts.
- Contact the engineering team if the call returns
ERRORwith an unexpected message.