# Get next invoice number GET https://api-sandbox.payabli.com/api/Invoice/getNumber/{entry} Retrieves the next available invoice number for a paypoint. Reference: https://docs.payabli.com/developers/api-reference/invoice/get-next-invoicenumber-for-entrypoint ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get next InvoiceNumber for entrypoint version: endpoint_invoice.GetInvoiceNumber paths: /Invoice/getNumber/{entry}: get: operationId: get-invoice-number summary: Get next InvoiceNumber for entrypoint description: Retrieves the next available invoice number for a paypoint. tags: - - subpackage_invoice parameters: - name: entry in: path description: >- The paypoint's entrypoint identifier. [Learn more](/developers/api-reference/api-overview#entrypoint-vs-entry) required: true schema: type: string - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_invoice:InvoiceNumberResponse' '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_:ResponseText: type: string type_invoice:InvoiceNumberResponse: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseText: $ref: '#/components/schemas/type_:ResponseText' responseData: type: string description: >- If `isSuccess` = true, this contains the next available invoice number in the format defined by paypoint settings. If `isSuccess` = false, this contains the reason for the error. required: - isSuccess - responseText - responseData ``` ## SDK Code Examples ```typescript GetNextInvoiceNumber import { PayabliClient, PayabliEnvironment } from "@payabli/sdk-node"; async function main() { const client = new PayabliClient({ environment: PayabliEnvironment.Sandbox, apiKey: "YOUR_API_KEY_HERE", }); await client.invoice.getInvoiceNumber("8cfec329267"); } main(); ``` ```python GetNextInvoiceNumber from payabli import payabli from payabli.environment import payabliEnvironment client = payabli( environment=payabliEnvironment.SANDBOX, api_key="YOUR_API_KEY_HERE" ) client.invoice.get_invoice_number( entry="8cfec329267" ) ``` ```csharp GetNextInvoiceNumber using PayabliApi; using System.Threading.Tasks; namespace Usage; public class Example { public async Task Do() { var client = new PayabliApiClient( apiKey: "YOUR_API_KEY_HERE", clientOptions: new ClientOptions { BaseUrl = PayabliApiEnvironment.Sandbox } ); await client.Invoice.GetInvoiceNumberAsync( "8cfec329267" ); } } ``` ```go GetNextInvoiceNumber package example import ( client "github.com/payabli/sdk-go/v/client" option "github.com/payabli/sdk-go/v/option" payabli "github.com/payabli/sdk-go/v" context "context" ) func do() { client := client.NewClient( option.WithBaseURL( payabli.Environments.Sandbox, ), option.WithApiKey( "YOUR_API_KEY_HERE", ), ) client.Invoice.GetInvoiceNumber( context.TODO(), "8cfec329267", ) } ``` ```ruby GetNextInvoiceNumber require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Invoice/getNumber/8cfec329267") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java GetNextInvoiceNumber import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api-sandbox.payabli.com/api/Invoice/getNumber/8cfec329267") .header("requestToken", "") .asString(); ``` ```php GetNextInvoiceNumber request('GET', 'https://api-sandbox.payabli.com/api/Invoice/getNumber/8cfec329267', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift GetNextInvoiceNumber import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Invoice/getNumber/8cfec329267")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" 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() ```