Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Latest commit

 

History

History
794 lines (631 loc) · 23.5 KB

InvoicesApi.md

File metadata and controls

794 lines (631 loc) · 23.5 KB

Org.OpenAPITools.Api.InvoicesApi

All URIs are relative to https://api.getlago.com/api/v1

Method HTTP request Description
CreateInvoice POST /invoices Create a new invoice
DownloadInvoice POST /invoices/{id}/download Download an existing invoice
FinalizeInvoice PUT /invoices/{id}/finalize Finalize a draft invoice
FindAllInvoices GET /invoices Find all invoices
FindInvoice GET /invoices/{id} Find invoice by ID
RefreshInvoice PUT /invoices/{id}/refresh Refresh a draft invoice
RetryPayment POST /invoices/{id}/retry_payment Retry invoice payment
UpdateInvoice PUT /invoices/{id} Update an existing invoice status

CreateInvoice

Invoice CreateInvoice (InvoiceOneOffInput invoiceOneOffInput)

Create a new invoice

Create a new one off Invoice

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class CreateInvoiceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.getlago.com/api/v1";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new InvoicesApi(config);
            var invoiceOneOffInput = new InvoiceOneOffInput(); // InvoiceOneOffInput | Invoice payload

            try
            {
                // Create a new invoice
                Invoice result = apiInstance.CreateInvoice(invoiceOneOffInput);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling InvoicesApi.CreateInvoice: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateInvoiceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create a new invoice
    ApiResponse<Invoice> response = apiInstance.CreateInvoiceWithHttpInfo(invoiceOneOffInput);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling InvoicesApi.CreateInvoiceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
invoiceOneOffInput InvoiceOneOffInput Invoice payload

Return type

Invoice

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad Request error -
401 Unauthorized error -
422 Unprocessable entity error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DownloadInvoice

Invoice DownloadInvoice (Guid id)

Download an existing invoice

Download an existing invoice

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class DownloadInvoiceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.getlago.com/api/v1";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new InvoicesApi(config);
            var id = 1a901a90-1a90-1a90-1a90-1a901a901a90;  // Guid | ID of the existing Lago Invoice

            try
            {
                // Download an existing invoice
                Invoice result = apiInstance.DownloadInvoice(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling InvoicesApi.DownloadInvoice: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DownloadInvoiceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Download an existing invoice
    ApiResponse<Invoice> response = apiInstance.DownloadInvoiceWithHttpInfo(id);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling InvoicesApi.DownloadInvoiceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id Guid ID of the existing Lago Invoice

Return type

Invoice

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
401 Unauthorized error -
404 Not Found error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FinalizeInvoice

Invoice FinalizeInvoice (Guid id)

Finalize a draft invoice

Finalize a draft invoice

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FinalizeInvoiceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.getlago.com/api/v1";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new InvoicesApi(config);
            var id = 1a901a90-1a90-1a90-1a90-1a901a901a90;  // Guid | ID of the draft Lago Invoice

            try
            {
                // Finalize a draft invoice
                Invoice result = apiInstance.FinalizeInvoice(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling InvoicesApi.FinalizeInvoice: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the FinalizeInvoiceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Finalize a draft invoice
    ApiResponse<Invoice> response = apiInstance.FinalizeInvoiceWithHttpInfo(id);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling InvoicesApi.FinalizeInvoiceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id Guid ID of the draft Lago Invoice

Return type

Invoice

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
401 Unauthorized error -
404 Not Found error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FindAllInvoices

InvoicesPaginated FindAllInvoices (int? page = null, int? perPage = null, string externalCustomerId = null, DateTime? issuingDateFrom = null, DateTime? issuingDateTo = null, string status = null)

Find all invoices

Find all invoices in certain organisation

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FindAllInvoicesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.getlago.com/api/v1";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new InvoicesApi(config);
            var page = 2;  // int? | Number of page (optional) 
            var perPage = 20;  // int? | Number of records per page (optional) 
            var externalCustomerId = 12345;  // string | External customer ID (optional) 
            var issuingDateFrom = Fri Jul 08 00:00:00 UTC 2022;  // DateTime? | Date from (optional) 
            var issuingDateTo = Tue Aug 09 00:00:00 UTC 2022;  // DateTime? | Date to (optional) 
            var status = "draft";  // string | Status (optional) 

            try
            {
                // Find all invoices
                InvoicesPaginated result = apiInstance.FindAllInvoices(page, perPage, externalCustomerId, issuingDateFrom, issuingDateTo, status);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling InvoicesApi.FindAllInvoices: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the FindAllInvoicesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Find all invoices
    ApiResponse<InvoicesPaginated> response = apiInstance.FindAllInvoicesWithHttpInfo(page, perPage, externalCustomerId, issuingDateFrom, issuingDateTo, status);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling InvoicesApi.FindAllInvoicesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
page int? Number of page [optional]
perPage int? Number of records per page [optional]
externalCustomerId string External customer ID [optional]
issuingDateFrom DateTime? Date from [optional]
issuingDateTo DateTime? Date to [optional]
status string Status [optional]

Return type

InvoicesPaginated

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
401 Unauthorized error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FindInvoice

Invoice FindInvoice (Guid id)

Find invoice by ID

Return a single invoice

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FindInvoiceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.getlago.com/api/v1";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new InvoicesApi(config);
            var id = 1a901a90-1a90-1a90-1a90-1a901a901a90;  // Guid | ID of the existing Lago Invoice

            try
            {
                // Find invoice by ID
                Invoice result = apiInstance.FindInvoice(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling InvoicesApi.FindInvoice: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the FindInvoiceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Find invoice by ID
    ApiResponse<Invoice> response = apiInstance.FindInvoiceWithHttpInfo(id);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling InvoicesApi.FindInvoiceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id Guid ID of the existing Lago Invoice

Return type

Invoice

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
401 Unauthorized error -
404 Not Found error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RefreshInvoice

Invoice RefreshInvoice (Guid id)

Refresh a draft invoice

Refresh a draft invoice

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class RefreshInvoiceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.getlago.com/api/v1";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new InvoicesApi(config);
            var id = 1a901a90-1a90-1a90-1a90-1a901a901a90;  // Guid | ID of the existing Lago Invoice

            try
            {
                // Refresh a draft invoice
                Invoice result = apiInstance.RefreshInvoice(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling InvoicesApi.RefreshInvoice: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the RefreshInvoiceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Refresh a draft invoice
    ApiResponse<Invoice> response = apiInstance.RefreshInvoiceWithHttpInfo(id);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling InvoicesApi.RefreshInvoiceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id Guid ID of the existing Lago Invoice

Return type

Invoice

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
401 Unauthorized error -
404 Not Found error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RetryPayment

void RetryPayment (Guid id)

Retry invoice payment

Retry invoice payment

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class RetryPaymentExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.getlago.com/api/v1";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new InvoicesApi(config);
            var id = 1a901a90-1a90-1a90-1a90-1a901a901a90;  // Guid | ID of the existing Lago Invoice

            try
            {
                // Retry invoice payment
                apiInstance.RetryPayment(id);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling InvoicesApi.RetryPayment: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the RetryPaymentWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Retry invoice payment
    apiInstance.RetryPaymentWithHttpInfo(id);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling InvoicesApi.RetryPaymentWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id Guid ID of the existing Lago Invoice

Return type

void (empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
401 Unauthorized error -
404 Not Found error -
405 Not Allowed error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateInvoice

Invoice UpdateInvoice (Guid id, InvoiceInput invoiceInput)

Update an existing invoice status

Update an existing invoice

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class UpdateInvoiceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.getlago.com/api/v1";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new InvoicesApi(config);
            var id = 1a901a90-1a90-1a90-1a90-1a901a901a90;  // Guid | ID of the existing Lago Invoice
            var invoiceInput = new InvoiceInput(); // InvoiceInput | Update an existing invoice

            try
            {
                // Update an existing invoice status
                Invoice result = apiInstance.UpdateInvoice(id, invoiceInput);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling InvoicesApi.UpdateInvoice: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the UpdateInvoiceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Update an existing invoice status
    ApiResponse<Invoice> response = apiInstance.UpdateInvoiceWithHttpInfo(id, invoiceInput);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling InvoicesApi.UpdateInvoiceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
id Guid ID of the existing Lago Invoice
invoiceInput InvoiceInput Update an existing invoice

Return type

Invoice

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful response -
400 Bad Request error -
401 Unauthorized error -
404 Not Found error -
422 Unprocessable entity error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]