PayPal.Api.Invoice.GetAll C# (CSharp) Method

GetAll() public static method

Lists merchant invoices. Optionally, you can specify one or more query parameters to filter the response.
public static GetAll ( APIContext apiContext, int page = 1, int pageSize = 20, bool totalCountRequired = false ) : PayPal.Api.InvoiceSearchResponse
apiContext APIContext APIContext used for the API call.
page int A *zero-relative* index of the list of merchant invoices.
pageSize int The number of invoices to list beginning with the specified `page`.
totalCountRequired bool Indicates whether the total count appears in the response. Default is `false`.
return PayPal.Api.InvoiceSearchResponse
        public static InvoiceSearchResponse GetAll(APIContext apiContext, int page = 1, int pageSize = 20, bool totalCountRequired = false)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);

            var queryParameters = new QueryParameters();
            queryParameters["page"] = page.ToString();
            queryParameters["page_size"] = pageSize.ToString();
            queryParameters["total_count_required"] = totalCountRequired.ToString();

            // Configure and send the request
            var resourcePath = "v1/invoicing/invoices" + queryParameters.ToUrlFormattedString();
            return PayPalResource.ConfigureAndExecute<InvoiceSearchResponse>(apiContext, HttpMethod.GET, resourcePath);
        }