# Delete invoice DELETE https://api-sandbox.payabli.com/api/Invoice/{idInvoice} Deletes a single invoice from an entrypoint. Reference: https://docs.payabli.com/developers/api-reference/invoice/delete-invoice ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Delete invoice version: endpoint_invoice.DeleteInvoice paths: /Invoice/{idInvoice}: delete: operationId: delete-invoice summary: Delete invoice description: Deletes a single invoice from an entrypoint. tags: - - subpackage_invoice parameters: - name: idInvoice in: path description: Invoice ID required: true schema: type: integer - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_invoice:InvoiceResponseWithoutData' '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_:IsSuccess: type: boolean type_:Responsecode: type: integer type_:Responsedatanonobject: oneOf: - type: string - type: integer type_:ResponseText: type: string type_:PageIdentifier: type: string type_:RoomIdNotInUse: type: integer format: int64 type_invoice:InvoiceResponseWithoutData: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseCode: $ref: '#/components/schemas/type_:Responsecode' responseData: $ref: '#/components/schemas/type_:Responsedatanonobject' description: >- If `isSuccess` = true, this contains the identifier of the invoice. If `isSuccess` = false, this contains the reason for the failure. responseText: $ref: '#/components/schemas/type_:ResponseText' pageidentifier: oneOf: - $ref: '#/components/schemas/type_:PageIdentifier' - type: 'null' roomId: $ref: '#/components/schemas/type_:RoomIdNotInUse' required: - isSuccess - responseCode - responseData - responseText - pageidentifier - roomId ``` ## SDK Code Examples ```python DeleteInvoice from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.invoice.delete_invoice( id_invoice=23548884, ) ``` ```typescript DeleteInvoice import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.invoice.deleteInvoice(23548884); ``` ```go DeleteInvoice import ( context "context" option "github.com/payabli/sdk-go/option" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Invoice.DeleteInvoice( context.TODO(), 23548884, ) ``` ```csharp DeleteInvoice using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Invoice.DeleteInvoiceAsync(23548884); ``` ```ruby DeleteInvoice require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Invoice/23548884") 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 DeleteInvoice HttpResponse response = Unirest.delete("https://api-sandbox.payabli.com/api/Invoice/23548884") .header("requestToken", "") .asString(); ``` ```php DeleteInvoice request('DELETE', 'https://api-sandbox.payabli.com/api/Invoice/23548884', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift DeleteInvoice import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Invoice/23548884")! 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() ```