# Delete bill attachment DELETE https://api-sandbox.payabli.com/api/Bill/attachedFileFromBill/{idBill}/{filename} Delete a file attached to a bill. Reference: https://docs.payabli.com/developers/api-reference/bill/delete-attached-file-from-bill ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Delete attached file from bill version: endpoint_bill.deleteAttachedFromBill paths: /Bill/attachedFileFromBill/{idBill}/{filename}: delete: operationId: delete-attached-from-bill summary: Delete attached file from bill description: Delete a file attached to a bill. tags: - - subpackage_bill parameters: - name: idBill in: path description: >- Payabli ID for the bill. Get this ID by querying `/api/Query/bills/` for the entrypoint or the organization. required: true schema: type: integer - name: filename in: path description: |- The filename in Payabli. Filename is `zipName` in response to a request to `/api/Invoice/{idInvoice}`. Here, the filename is `0_Bill.pdf`. ```json "DocumentsRef": { "zipfile": "inva_269.zip", "filelist": [ { "originalName": "Bill.pdf", "zipName": "0_Bill.pdf", "descriptor": null } ] } ``` required: true schema: type: string - name: returnObject in: query description: >- When `true`, the request returns the file content as a Base64-encoded string. required: false schema: type: boolean default: false - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_bill:BillResponse' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} components: schemas: type_:Responsecode: type: integer type_:PageIdentifier: type: string type_:RoomIdNotInUse: type: integer format: int64 type_:IsSuccess: type: boolean type_:ResponseText: type: string type_:Responsedatanonobject: oneOf: - type: string - type: integer type_bill:BillResponse: type: object properties: responseCode: $ref: '#/components/schemas/type_:Responsecode' pageIdentifier: $ref: '#/components/schemas/type_:PageIdentifier' roomId: $ref: '#/components/schemas/type_:RoomIdNotInUse' isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseText: $ref: '#/components/schemas/type_:ResponseText' responseData: $ref: '#/components/schemas/type_:Responsedatanonobject' description: >- If `isSuccess` = true, this contains the bill identifier. If `isSuccess` = false, this contains the reason for the error. required: - responseText ``` ## SDK Code Examples ```python DeleteAttachment from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.bill.delete_attached_from_bill( filename="0_Bill.pdf", id_bill=285, ) ``` ```typescript DeleteAttachment import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.bill.deleteAttachedFromBill(285, "0_Bill.pdf"); ``` ```go DeleteAttachment import ( context "context" option "github.com/payabli/sdk-go/option" sdkgo "github.com/payabli/sdk-go" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Bill.DeleteAttachedFromBill( context.TODO(), "0_Bill.pdf", 285, &sdkgo.DeleteAttachedFromBillRequest{}, ) ``` ```csharp DeleteAttachment using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Bill.DeleteAttachedFromBillAsync( "0_Bill.pdf", 285, new DeleteAttachedFromBillRequest() ); ``` ```ruby DeleteAttachment require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Bill/attachedFileFromBill/285/0_Bill.pdf") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java DeleteAttachment HttpResponse response = Unirest.delete("https://api-sandbox.payabli.com/api/Bill/attachedFileFromBill/285/0_Bill.pdf") .header("requestToken", "") .asString(); ``` ```php DeleteAttachment request('DELETE', 'https://api-sandbox.payabli.com/api/Bill/attachedFileFromBill/285/0_Bill.pdf', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift DeleteAttachment import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Bill/attachedFileFromBill/285/0_Bill.pdf")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```