---
title: "Delete bill"
method: DELETE
path: "/companies/{companyId}/connections/{connectionId}/push/bills/{billId}"
tags: ["Bills"]
---

# Delete bill

`DELETE /companies/{companyId}/connections/{connectionId}/push/bills/{billId}`

## Request

- Base URL: `https://api.codat.io`
- URL: `https://api.codat.io/companies/{companyId}/connections/{connectionId}/push/bills/{billId}`
- Auth: API key in header `Authorization`

The *Delete bill* endpoint allows you to delete a specified bill from an accounting software. 

[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are itemized records of goods received or services provided to the SMB.

### Process 
1. Pass the `{billId}` to the *Delete bill* endpoint and store the `pushOperationKey` returned.
2. Check the status of the delete operation by checking the status of the push operation either via
    1. [Push operation webhook](https://docs.codat.io/introduction/webhooks/core-rules-types#push-operation-status-has-changed) (advised),
    2. [Push operation status endpoint](https://docs.codat.io/sync-for-payables-api#/operations/get-push-operation).

   A `Success` status indicates that the bill object was deleted from the accounting software.
3. (Optional) Check that the bill was deleted from the accounting software.

### Effect on related objects

Be aware that deleting a bill from an accounting software might cause related objects to be modified. For example, if you delete a paid bill in QuickBooks Online or QuickBooks Desktop, the bill is deleted but the bill payment against that bill is not. The bill payment is converted to a payment on account.

## Integration specifics
Integrations that support soft delete do not permanently delete the object in the accounting software.

| Integration | Soft Delete | Details                                                                                                      |  
|-------------|-------------|--------------------------------------------------------------------------------------------------------------|
| QuickBooks Online | No          | - |
| QuickBooks Desktop | No          | - |
| Oracle NetSuite   | No          | When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. |                                                                                                      |
| Sage Intacct   | No          | When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. |
| Xero   | No          | Draft bills will be deleted. Open bills will be voided instead of deleted since Xero only allows voiding a bill once it's been posted. When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. |

> **Supported Integrations**
> 
> This functionality is currently supported for our QuickBooks Online, QuickBooks Desktop, Xero, Oracle NetSuite and Sage Intacct integrations.

## Response `200`

OK

- PushOperation
  - `changes` PushOperationChange[], nullable: Contains a single entry that communicates which record has changed and the manner in which it changed. (unresolved $ref)
  - `dataType` DataType (unresolved $ref)
  - `companyId` Schema, required (unresolved $ref)
  - `pushOperationKey` string, uuid, required: A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.
  - `dataConnectionKey` Schema, required (unresolved $ref)
  - `requestedOnUtc` Created, required (unresolved $ref)
  - `completedOnUtc` Created (unresolved $ref)
  - `timeoutInMinutes` integer, nullable: Number of minutes the push operation must complete within before it times out.
  - `timeoutInSeconds` integer, nullable: Number of seconds the push operation must complete within before it times out.
  - `status` PushOperationStatus, required (unresolved $ref)
  - `errorMessage` string, nullable: A message about the error.
  - `validation` Validation (unresolved $ref)
  - `statusCode` integer, required: Push status code.

## Other responses

- `401`: Your API request was not properly authorized.
- `402`: An account limit has been exceeded. The type of limit is described in the error property: - You have exceeded the 50-company limit that applies to a Free plan. Delete any companies you no longer need and retry the request. - The requested sync schedule is not allowed. You requested an hourly sync schedule but this functionality is not included in the Free plan. - Your Free account is older than 365 days and has expired. Contact support@codat.io.
- `403`: You are using an outdated API key or a key not associated with that resource.
- `404`: One or more of the resources you referenced could not be found. This might be because your company or data connection id is wrong, or was already deleted.
- `429`: Too many requests were made in a given amount of time. Wait a short period and then try again.
- `500`: There is a problem with our server. Please try again later.
- `503`: The Codat API is temporarily offline for maintenance. Please try again later.

## Changes

- **2024-02-13** (v1) `4107d26779c6`: 7 info
  - added the optional property `validation` to the response with the `401` status
  - added the optional property `validation` to the response with the `402` status
  - added the optional property `validation` to the response with the `403` status
  - added the optional property `validation` to the response with the `404` status
  - …3 more

[Operation history](https://skmtc.dev/codatio/apis/sync-for-payables/changes/companies/:companyId/connections/:connectionId/push/bills/:billId/delete.md)

---

[API](https://skmtc.dev/codatio/apis/sync-for-payables.md) - [All operations](https://skmtc.dev/codatio/apis/sync-for-payables/llms.txt) - [OpenAPI document](https://skmtc.dev/codatio/apis/sync-for-payables/revisions/06163dffa75f?raw)
