|
/*
* NexPort Web API
*
* The NexPort Open Web API allows NexPort Campus Organizations to integrate, programatically, with remote systems. This is achieved by exposing most of the administrative features of Nexport through a JSON based, RPC style Web API.
*
* The version of the OpenAPI document: v1
* Contact: support@nexportcampus.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Threading.Tasks;
using NexportApi.Client;
using NexportApi.Model;
namespace NexportApi.Api
{
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IPointOfSaleApiSync : IApiAccessor
{
#region Synchronous Operations
/// <summary>
/// Creates a new invoice item and saves it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice item information</param>
/// <returns>AddInvoiceItemResponse</returns>
AddInvoiceItemResponse PointOfSaleApiAddInvoiceItem(string accessToken, CreateInvoiceItemRequest request);
/// <summary>
/// Creates a new invoice item and saves it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice item information</param>
/// <returns>ApiResponse of AddInvoiceItemResponse</returns>
ApiResponse<AddInvoiceItemResponse> PointOfSaleApiAddInvoiceItemWithHttpInfo(string accessToken, CreateInvoiceItemRequest request);
/// <summary>
/// Creates a new invoice payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice payment information</param>
/// <returns>AddInvoicePaymentResponse</returns>
AddInvoicePaymentResponse PointOfSaleApiAddInvoicePayment(string accessToken, InvoicePaymentRequest request);
/// <summary>
/// Creates a new invoice payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice payment information</param>
/// <returns>ApiResponse of AddInvoicePaymentResponse</returns>
ApiResponse<AddInvoicePaymentResponse> PointOfSaleApiAddInvoicePaymentWithHttpInfo(string accessToken, InvoicePaymentRequest request);
/// <summary>
/// Creates a new invoice scheduled payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice scheduled payment information</param>
/// <returns>AddInvoiceScheduledPaymentResponse</returns>
AddInvoiceScheduledPaymentResponse PointOfSaleApiAddInvoiceScheduledPayment(string accessToken, InvoiceScheduledPaymentRequest request);
/// <summary>
/// Creates a new invoice scheduled payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice scheduled payment information</param>
/// <returns>ApiResponse of AddInvoiceScheduledPaymentResponse</returns>
ApiResponse<AddInvoiceScheduledPaymentResponse> PointOfSaleApiAddInvoiceScheduledPaymentWithHttpInfo(string accessToken, InvoiceScheduledPaymentRequest request);
/// <summary>
/// Creates a new invoice and saves it to the database. Requires the Manage Invoices permission in the given organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains purchasing user id, organization short name, and note</param>
/// <returns>BeginInvoiceTransactionResponse</returns>
BeginInvoiceTransactionResponse PointOfSaleApiBeginInvoiceTransaction(string accessToken, CreateInvoiceMessageRequest request);
/// <summary>
/// Creates a new invoice and saves it to the database. Requires the Manage Invoices permission in the given organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains purchasing user id, organization short name, and note</param>
/// <returns>ApiResponse of BeginInvoiceTransactionResponse</returns>
ApiResponse<BeginInvoiceTransactionResponse> PointOfSaleApiBeginInvoiceTransactionWithHttpInfo(string accessToken, CreateInvoiceMessageRequest request);
/// <summary>
/// This method is used to enroll a student into sections. Only creates enrollments if auto_redeem is set to true. Requires current user to be the sales agent on the invoice AND the Manage Invoices permission in the invoice organization or an ancestor. NOTE: the auto_redeem functionality has been superceded by the RedeemInvoiceItem method. Use that method instead of setting auto_redeem to true.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice information</param>
/// <returns>CommitInvoiceResponse</returns>
CommitInvoiceResponse PointOfSaleApiCommitInvoiceTransaction(string accessToken, CommitInvoiceRequest request);
/// <summary>
/// This method is used to enroll a student into sections. Only creates enrollments if auto_redeem is set to true. Requires current user to be the sales agent on the invoice AND the Manage Invoices permission in the invoice organization or an ancestor. NOTE: the auto_redeem functionality has been superceded by the RedeemInvoiceItem method. Use that method instead of setting auto_redeem to true.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice information</param>
/// <returns>ApiResponse of CommitInvoiceResponse</returns>
ApiResponse<CommitInvoiceResponse> PointOfSaleApiCommitInvoiceTransactionWithHttpInfo(string accessToken, CommitInvoiceRequest request);
/// <summary>
/// Gets an invoice and it's list of invoice items'.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>GetInvoiceResponse</returns>
GetInvoiceResponse PointOfSaleApiGetInvoice(Guid invoiceId, string accessToken);
/// <summary>
/// Gets an invoice and it's list of invoice items'.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>ApiResponse of GetInvoiceResponse</returns>
ApiResponse<GetInvoiceResponse> PointOfSaleApiGetInvoiceWithHttpInfo(Guid invoiceId, string accessToken);
/// <summary>
/// Gets the invoice redemption information corresponding to the given invoice item. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR the Manage Invoices permission in the invoice item's invoice organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceItemId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>InvoiceRedemptionResponse</returns>
InvoiceRedemptionResponse PointOfSaleApiGetInvoiceRedemption(Guid invoiceItemId, string accessToken);
/// <summary>
/// Gets the invoice redemption information corresponding to the given invoice item. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR the Manage Invoices permission in the invoice item's invoice organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceItemId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>ApiResponse of InvoiceRedemptionResponse</returns>
ApiResponse<InvoiceRedemptionResponse> PointOfSaleApiGetInvoiceRedemptionWithHttpInfo(Guid invoiceItemId, string accessToken);
/// <summary>
/// Redeems the invoice item associated with the invoice item id or redemption id/code. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR current user to have the Manage Invoices permission in the invoice organization or an ancestor thereof.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains fields for redeeming the invoice item</param>
/// <returns>InvoiceRedemptionResponse</returns>
InvoiceRedemptionResponse PointOfSaleApiRedeemInvoiceItem(string accessToken, RedeemInvoiceItemRequest request);
/// <summary>
/// Redeems the invoice item associated with the invoice item id or redemption id/code. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR current user to have the Manage Invoices permission in the invoice organization or an ancestor thereof.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains fields for redeeming the invoice item</param>
/// <returns>ApiResponse of InvoiceRedemptionResponse</returns>
ApiResponse<InvoiceRedemptionResponse> PointOfSaleApiRedeemInvoiceItemWithHttpInfo(string accessToken, RedeemInvoiceItemRequest request);
#endregion Synchronous Operations
}
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IPointOfSaleApiAsync : IApiAccessor
{
#region Asynchronous Operations
/// <summary>
/// Creates a new invoice item and saves it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice item information</param>
/// <returns>Task of AddInvoiceItemResponse</returns>
Task<AddInvoiceItemResponse> PointOfSaleApiAddInvoiceItemAsync(string accessToken, CreateInvoiceItemRequest request);
/// <summary>
/// Creates a new invoice item and saves it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice item information</param>
/// <returns>Task of ApiResponse (AddInvoiceItemResponse)</returns>
Task<ApiResponse<AddInvoiceItemResponse>> PointOfSaleApiAddInvoiceItemAsyncWithHttpInfo(string accessToken, CreateInvoiceItemRequest request);
/// <summary>
/// Creates a new invoice payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice payment information</param>
/// <returns>Task of AddInvoicePaymentResponse</returns>
Task<AddInvoicePaymentResponse> PointOfSaleApiAddInvoicePaymentAsync(string accessToken, InvoicePaymentRequest request);
/// <summary>
/// Creates a new invoice payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice payment information</param>
/// <returns>Task of ApiResponse (AddInvoicePaymentResponse)</returns>
Task<ApiResponse<AddInvoicePaymentResponse>> PointOfSaleApiAddInvoicePaymentAsyncWithHttpInfo(string accessToken, InvoicePaymentRequest request);
/// <summary>
/// Creates a new invoice scheduled payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice scheduled payment information</param>
/// <returns>Task of AddInvoiceScheduledPaymentResponse</returns>
Task<AddInvoiceScheduledPaymentResponse> PointOfSaleApiAddInvoiceScheduledPaymentAsync(string accessToken, InvoiceScheduledPaymentRequest request);
/// <summary>
/// Creates a new invoice scheduled payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice scheduled payment information</param>
/// <returns>Task of ApiResponse (AddInvoiceScheduledPaymentResponse)</returns>
Task<ApiResponse<AddInvoiceScheduledPaymentResponse>> PointOfSaleApiAddInvoiceScheduledPaymentAsyncWithHttpInfo(string accessToken, InvoiceScheduledPaymentRequest request);
/// <summary>
/// Creates a new invoice and saves it to the database. Requires the Manage Invoices permission in the given organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains purchasing user id, organization short name, and note</param>
/// <returns>Task of BeginInvoiceTransactionResponse</returns>
Task<BeginInvoiceTransactionResponse> PointOfSaleApiBeginInvoiceTransactionAsync(string accessToken, CreateInvoiceMessageRequest request);
/// <summary>
/// Creates a new invoice and saves it to the database. Requires the Manage Invoices permission in the given organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains purchasing user id, organization short name, and note</param>
/// <returns>Task of ApiResponse (BeginInvoiceTransactionResponse)</returns>
Task<ApiResponse<BeginInvoiceTransactionResponse>> PointOfSaleApiBeginInvoiceTransactionAsyncWithHttpInfo(string accessToken, CreateInvoiceMessageRequest request);
/// <summary>
/// This method is used to enroll a student into sections. Only creates enrollments if auto_redeem is set to true. Requires current user to be the sales agent on the invoice AND the Manage Invoices permission in the invoice organization or an ancestor. NOTE: the auto_redeem functionality has been superceded by the RedeemInvoiceItem method. Use that method instead of setting auto_redeem to true.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice information</param>
/// <returns>Task of CommitInvoiceResponse</returns>
Task<CommitInvoiceResponse> PointOfSaleApiCommitInvoiceTransactionAsync(string accessToken, CommitInvoiceRequest request);
/// <summary>
/// This method is used to enroll a student into sections. Only creates enrollments if auto_redeem is set to true. Requires current user to be the sales agent on the invoice AND the Manage Invoices permission in the invoice organization or an ancestor. NOTE: the auto_redeem functionality has been superceded by the RedeemInvoiceItem method. Use that method instead of setting auto_redeem to true.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice information</param>
/// <returns>Task of ApiResponse (CommitInvoiceResponse)</returns>
Task<ApiResponse<CommitInvoiceResponse>> PointOfSaleApiCommitInvoiceTransactionAsyncWithHttpInfo(string accessToken, CommitInvoiceRequest request);
/// <summary>
/// Gets an invoice and it's list of invoice items'.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>Task of GetInvoiceResponse</returns>
Task<GetInvoiceResponse> PointOfSaleApiGetInvoiceAsync(Guid invoiceId, string accessToken);
/// <summary>
/// Gets an invoice and it's list of invoice items'.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>Task of ApiResponse (GetInvoiceResponse)</returns>
Task<ApiResponse<GetInvoiceResponse>> PointOfSaleApiGetInvoiceAsyncWithHttpInfo(Guid invoiceId, string accessToken);
/// <summary>
/// Gets the invoice redemption information corresponding to the given invoice item. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR the Manage Invoices permission in the invoice item's invoice organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceItemId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>Task of InvoiceRedemptionResponse</returns>
Task<InvoiceRedemptionResponse> PointOfSaleApiGetInvoiceRedemptionAsync(Guid invoiceItemId, string accessToken);
/// <summary>
/// Gets the invoice redemption information corresponding to the given invoice item. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR the Manage Invoices permission in the invoice item's invoice organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceItemId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>Task of ApiResponse (InvoiceRedemptionResponse)</returns>
Task<ApiResponse<InvoiceRedemptionResponse>> PointOfSaleApiGetInvoiceRedemptionAsyncWithHttpInfo(Guid invoiceItemId, string accessToken);
/// <summary>
/// Redeems the invoice item associated with the invoice item id or redemption id/code. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR current user to have the Manage Invoices permission in the invoice organization or an ancestor thereof.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains fields for redeeming the invoice item</param>
/// <returns>Task of InvoiceRedemptionResponse</returns>
Task<InvoiceRedemptionResponse> PointOfSaleApiRedeemInvoiceItemAsync(string accessToken, RedeemInvoiceItemRequest request);
/// <summary>
/// Redeems the invoice item associated with the invoice item id or redemption id/code. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR current user to have the Manage Invoices permission in the invoice organization or an ancestor thereof.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains fields for redeeming the invoice item</param>
/// <returns>Task of ApiResponse (InvoiceRedemptionResponse)</returns>
Task<ApiResponse<InvoiceRedemptionResponse>> PointOfSaleApiRedeemInvoiceItemAsyncWithHttpInfo(string accessToken, RedeemInvoiceItemRequest request);
#endregion Asynchronous Operations
}
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public interface IPointOfSaleApi : IPointOfSaleApiSync, IPointOfSaleApiAsync
{
}
/// <summary>
/// Represents a collection of functions to interact with the API endpoints
/// </summary>
public class PointOfSaleApi : IPointOfSaleApi
{
private ExceptionFactory _exceptionFactory = (name, response) => null;
/// <summary>
/// Initializes a new instance of the <see cref="PointOfSaleApi"/> class.
/// </summary>
/// <returns></returns>
public PointOfSaleApi() : this((string)null)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="PointOfSaleApi"/> class.
/// </summary>
/// <returns></returns>
public PointOfSaleApi(string basePath)
{
Configuration = NexportApi.Client.Configuration.MergeConfigurations(
GlobalConfiguration.Instance,
new Configuration { BasePath = basePath }
);
Client = new ApiClient(Configuration.BasePath);
AsynchronousClient = new ApiClient(Configuration.BasePath);
ExceptionFactory = NexportApi.Client.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// Initializes a new instance of the <see cref="PointOfSaleApi"/> class
/// using Configuration object
/// </summary>
/// <param name="configuration">An instance of Configuration</param>
/// <returns></returns>
public PointOfSaleApi(Configuration configuration)
{
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
Configuration = NexportApi.Client.Configuration.MergeConfigurations(
GlobalConfiguration.Instance,
configuration
);
Client = new ApiClient(Configuration.BasePath);
AsynchronousClient = new ApiClient(Configuration.BasePath);
ExceptionFactory = NexportApi.Client.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// Initializes a new instance of the <see cref="PointOfSaleApi"/> class
/// using a Configuration object and client instance.
/// </summary>
/// <param name="client">The client interface for synchronous API access.</param>
/// <param name="asyncClient">The client interface for asynchronous API access.</param>
/// <param name="configuration">The configuration object.</param>
public PointOfSaleApi(ISynchronousClient client, IAsynchronousClient asyncClient, IReadableConfiguration configuration)
{
Client = client ?? throw new ArgumentNullException(nameof(client));
AsynchronousClient = asyncClient ?? throw new ArgumentNullException(nameof(asyncClient));
Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
ExceptionFactory = NexportApi.Client.Configuration.DefaultExceptionFactory;
}
/// <summary>
/// The client for accessing this underlying API asynchronously.
/// </summary>
public IAsynchronousClient AsynchronousClient { get; set; }
/// <summary>
/// The client for accessing this underlying API synchronously.
/// </summary>
public ISynchronousClient Client { get; set; }
/// <summary>
/// Gets the base path of the API client.
/// </summary>
/// <value>The base path</value>
public string GetBasePath()
{
return Configuration.BasePath;
}
/// <summary>
/// Gets or sets the configuration object
/// </summary>
/// <value>An instance of the Configuration</value>
public IReadableConfiguration Configuration { get; set; }
/// <summary>
/// Provides a factory method hook for the creation of exceptions.
/// </summary>
public ExceptionFactory ExceptionFactory
{
get
{
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
{
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
}
return _exceptionFactory;
}
set => _exceptionFactory = value;
}
/// <summary>
/// Creates a new invoice item and saves it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice item information</param>
/// <returns>AddInvoiceItemResponse</returns>
public AddInvoiceItemResponse PointOfSaleApiAddInvoiceItem(string accessToken, CreateInvoiceItemRequest request)
{
var localVarResponse = PointOfSaleApiAddInvoiceItemWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// Creates a new invoice item and saves it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice item information</param>
/// <returns>ApiResponse of AddInvoiceItemResponse</returns>
public ApiResponse<AddInvoiceItemResponse> PointOfSaleApiAddInvoiceItemWithHttpInfo(string accessToken, CreateInvoiceItemRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiAddInvoiceItem");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiAddInvoiceItem");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = ClientUtils.SelectHeaderAccept(accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = Client.Post<AddInvoiceItemResponse>("/api/v1/PointOfSaleApi/AddInvoiceItem", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiAddInvoiceItem", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Creates a new invoice item and saves it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice item information</param>
/// <returns>Task of AddInvoiceItemResponse</returns>
public async Task<AddInvoiceItemResponse> PointOfSaleApiAddInvoiceItemAsync(string accessToken, CreateInvoiceItemRequest request)
{
var localVarResponse = await PointOfSaleApiAddInvoiceItemAsyncWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// Creates a new invoice item and saves it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice item information</param>
/// <returns>Task of ApiResponse (AddInvoiceItemResponse)</returns>
public async Task<ApiResponse<AddInvoiceItemResponse>> PointOfSaleApiAddInvoiceItemAsyncWithHttpInfo(string accessToken, CreateInvoiceItemRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiAddInvoiceItem");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiAddInvoiceItem");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
foreach (var contentType in contentTypes)
localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType);
foreach (var accept in accepts)
localVarRequestOptions.HeaderParameters.Add("Accept", accept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = await AsynchronousClient.PostAsync<AddInvoiceItemResponse>("/api/v1/PointOfSaleApi/AddInvoiceItem", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiAddInvoiceItem", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Creates a new invoice payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice payment information</param>
/// <returns>AddInvoicePaymentResponse</returns>
public AddInvoicePaymentResponse PointOfSaleApiAddInvoicePayment(string accessToken, InvoicePaymentRequest request)
{
var localVarResponse = PointOfSaleApiAddInvoicePaymentWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// Creates a new invoice payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice payment information</param>
/// <returns>ApiResponse of AddInvoicePaymentResponse</returns>
public ApiResponse<AddInvoicePaymentResponse> PointOfSaleApiAddInvoicePaymentWithHttpInfo(string accessToken, InvoicePaymentRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiAddInvoicePayment");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiAddInvoicePayment");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = ClientUtils.SelectHeaderAccept(accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = Client.Post<AddInvoicePaymentResponse>("/api/v1/PointOfSaleApi/AddInvoicePayment", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiAddInvoicePayment", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Creates a new invoice payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice payment information</param>
/// <returns>Task of AddInvoicePaymentResponse</returns>
public async Task<AddInvoicePaymentResponse> PointOfSaleApiAddInvoicePaymentAsync(string accessToken, InvoicePaymentRequest request)
{
var localVarResponse = await PointOfSaleApiAddInvoicePaymentAsyncWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// Creates a new invoice payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice payment information</param>
/// <returns>Task of ApiResponse (AddInvoicePaymentResponse)</returns>
public async Task<ApiResponse<AddInvoicePaymentResponse>> PointOfSaleApiAddInvoicePaymentAsyncWithHttpInfo(string accessToken, InvoicePaymentRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiAddInvoicePayment");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiAddInvoicePayment");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
foreach (var contentType in contentTypes)
localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType);
foreach (var accept in accepts)
localVarRequestOptions.HeaderParameters.Add("Accept", accept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = await AsynchronousClient.PostAsync<AddInvoicePaymentResponse>("/api/v1/PointOfSaleApi/AddInvoicePayment", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiAddInvoicePayment", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Creates a new invoice scheduled payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice scheduled payment information</param>
/// <returns>AddInvoiceScheduledPaymentResponse</returns>
public AddInvoiceScheduledPaymentResponse PointOfSaleApiAddInvoiceScheduledPayment(string accessToken, InvoiceScheduledPaymentRequest request)
{
var localVarResponse = PointOfSaleApiAddInvoiceScheduledPaymentWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// Creates a new invoice scheduled payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice scheduled payment information</param>
/// <returns>ApiResponse of AddInvoiceScheduledPaymentResponse</returns>
public ApiResponse<AddInvoiceScheduledPaymentResponse> PointOfSaleApiAddInvoiceScheduledPaymentWithHttpInfo(string accessToken, InvoiceScheduledPaymentRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiAddInvoiceScheduledPayment");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiAddInvoiceScheduledPayment");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = ClientUtils.SelectHeaderAccept(accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = Client.Post<AddInvoiceScheduledPaymentResponse>("/api/v1/PointOfSaleApi/AddInvoiceScheduledPayment", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiAddInvoiceScheduledPayment", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Creates a new invoice scheduled payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice scheduled payment information</param>
/// <returns>Task of AddInvoiceScheduledPaymentResponse</returns>
public async Task<AddInvoiceScheduledPaymentResponse> PointOfSaleApiAddInvoiceScheduledPaymentAsync(string accessToken, InvoiceScheduledPaymentRequest request)
{
var localVarResponse = await PointOfSaleApiAddInvoiceScheduledPaymentAsyncWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// Creates a new invoice scheduled payment and adds it to the database. Requires the current user to be the sales agent on the invoice.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice scheduled payment information</param>
/// <returns>Task of ApiResponse (AddInvoiceScheduledPaymentResponse)</returns>
public async Task<ApiResponse<AddInvoiceScheduledPaymentResponse>> PointOfSaleApiAddInvoiceScheduledPaymentAsyncWithHttpInfo(string accessToken, InvoiceScheduledPaymentRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiAddInvoiceScheduledPayment");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiAddInvoiceScheduledPayment");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
foreach (var contentType in contentTypes)
localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType);
foreach (var accept in accepts)
localVarRequestOptions.HeaderParameters.Add("Accept", accept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = await AsynchronousClient.PostAsync<AddInvoiceScheduledPaymentResponse>("/api/v1/PointOfSaleApi/AddInvoiceScheduledPayment", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiAddInvoiceScheduledPayment", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Creates a new invoice and saves it to the database. Requires the Manage Invoices permission in the given organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains purchasing user id, organization short name, and note</param>
/// <returns>BeginInvoiceTransactionResponse</returns>
public BeginInvoiceTransactionResponse PointOfSaleApiBeginInvoiceTransaction(string accessToken, CreateInvoiceMessageRequest request)
{
var localVarResponse = PointOfSaleApiBeginInvoiceTransactionWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// Creates a new invoice and saves it to the database. Requires the Manage Invoices permission in the given organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains purchasing user id, organization short name, and note</param>
/// <returns>ApiResponse of BeginInvoiceTransactionResponse</returns>
public ApiResponse<BeginInvoiceTransactionResponse> PointOfSaleApiBeginInvoiceTransactionWithHttpInfo(string accessToken, CreateInvoiceMessageRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiBeginInvoiceTransaction");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiBeginInvoiceTransaction");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = ClientUtils.SelectHeaderAccept(accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = Client.Post<BeginInvoiceTransactionResponse>("/api/v1/PointOfSaleApi/BeginInvoiceTransaction", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiBeginInvoiceTransaction", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Creates a new invoice and saves it to the database. Requires the Manage Invoices permission in the given organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains purchasing user id, organization short name, and note</param>
/// <returns>Task of BeginInvoiceTransactionResponse</returns>
public async Task<BeginInvoiceTransactionResponse> PointOfSaleApiBeginInvoiceTransactionAsync(string accessToken, CreateInvoiceMessageRequest request)
{
var localVarResponse = await PointOfSaleApiBeginInvoiceTransactionAsyncWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// Creates a new invoice and saves it to the database. Requires the Manage Invoices permission in the given organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains purchasing user id, organization short name, and note</param>
/// <returns>Task of ApiResponse (BeginInvoiceTransactionResponse)</returns>
public async Task<ApiResponse<BeginInvoiceTransactionResponse>> PointOfSaleApiBeginInvoiceTransactionAsyncWithHttpInfo(string accessToken, CreateInvoiceMessageRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiBeginInvoiceTransaction");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiBeginInvoiceTransaction");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
foreach (var contentType in contentTypes)
localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType);
foreach (var accept in accepts)
localVarRequestOptions.HeaderParameters.Add("Accept", accept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = await AsynchronousClient.PostAsync<BeginInvoiceTransactionResponse>("/api/v1/PointOfSaleApi/BeginInvoiceTransaction", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiBeginInvoiceTransaction", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// This method is used to enroll a student into sections. Only creates enrollments if auto_redeem is set to true. Requires current user to be the sales agent on the invoice AND the Manage Invoices permission in the invoice organization or an ancestor. NOTE: the auto_redeem functionality has been superceded by the RedeemInvoiceItem method. Use that method instead of setting auto_redeem to true.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice information</param>
/// <returns>CommitInvoiceResponse</returns>
public CommitInvoiceResponse PointOfSaleApiCommitInvoiceTransaction(string accessToken, CommitInvoiceRequest request)
{
var localVarResponse = PointOfSaleApiCommitInvoiceTransactionWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// This method is used to enroll a student into sections. Only creates enrollments if auto_redeem is set to true. Requires current user to be the sales agent on the invoice AND the Manage Invoices permission in the invoice organization or an ancestor. NOTE: the auto_redeem functionality has been superceded by the RedeemInvoiceItem method. Use that method instead of setting auto_redeem to true.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice information</param>
/// <returns>ApiResponse of CommitInvoiceResponse</returns>
public ApiResponse<CommitInvoiceResponse> PointOfSaleApiCommitInvoiceTransactionWithHttpInfo(string accessToken, CommitInvoiceRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiCommitInvoiceTransaction");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiCommitInvoiceTransaction");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = ClientUtils.SelectHeaderAccept(accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = Client.Post<CommitInvoiceResponse>("/api/v1/PointOfSaleApi/CommitInvoiceTransaction", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiCommitInvoiceTransaction", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// This method is used to enroll a student into sections. Only creates enrollments if auto_redeem is set to true. Requires current user to be the sales agent on the invoice AND the Manage Invoices permission in the invoice organization or an ancestor. NOTE: the auto_redeem functionality has been superceded by the RedeemInvoiceItem method. Use that method instead of setting auto_redeem to true.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice information</param>
/// <returns>Task of CommitInvoiceResponse</returns>
public async Task<CommitInvoiceResponse> PointOfSaleApiCommitInvoiceTransactionAsync(string accessToken, CommitInvoiceRequest request)
{
var localVarResponse = await PointOfSaleApiCommitInvoiceTransactionAsyncWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// This method is used to enroll a student into sections. Only creates enrollments if auto_redeem is set to true. Requires current user to be the sales agent on the invoice AND the Manage Invoices permission in the invoice organization or an ancestor. NOTE: the auto_redeem functionality has been superceded by the RedeemInvoiceItem method. Use that method instead of setting auto_redeem to true.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains relevant invoice information</param>
/// <returns>Task of ApiResponse (CommitInvoiceResponse)</returns>
public async Task<ApiResponse<CommitInvoiceResponse>> PointOfSaleApiCommitInvoiceTransactionAsyncWithHttpInfo(string accessToken, CommitInvoiceRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiCommitInvoiceTransaction");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiCommitInvoiceTransaction");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
foreach (var contentType in contentTypes)
localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType);
foreach (var accept in accepts)
localVarRequestOptions.HeaderParameters.Add("Accept", accept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = await AsynchronousClient.PostAsync<CommitInvoiceResponse>("/api/v1/PointOfSaleApi/CommitInvoiceTransaction", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiCommitInvoiceTransaction", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Gets an invoice and it's list of invoice items'.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>GetInvoiceResponse</returns>
public GetInvoiceResponse PointOfSaleApiGetInvoice(Guid invoiceId, string accessToken)
{
var localVarResponse = PointOfSaleApiGetInvoiceWithHttpInfo(invoiceId, accessToken);
return localVarResponse.Data;
}
/// <summary>
/// Gets an invoice and it's list of invoice items'.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>ApiResponse of GetInvoiceResponse</returns>
public ApiResponse<GetInvoiceResponse> PointOfSaleApiGetInvoiceWithHttpInfo(Guid invoiceId, string accessToken)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiGetInvoice");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new string[] {
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = ClientUtils.SelectHeaderAccept(accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "invoice_id", invoiceId))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
// make the HTTP request
var localVarResponse = Client.Post<GetInvoiceResponse>("/api/v1/PointOfSaleApi/GetInvoice", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiGetInvoice", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Gets an invoice and it's list of invoice items'.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>Task of GetInvoiceResponse</returns>
public async Task<GetInvoiceResponse> PointOfSaleApiGetInvoiceAsync(Guid invoiceId, string accessToken)
{
var localVarResponse = await PointOfSaleApiGetInvoiceAsyncWithHttpInfo(invoiceId, accessToken);
return localVarResponse.Data;
}
/// <summary>
/// Gets an invoice and it's list of invoice items'.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>Task of ApiResponse (GetInvoiceResponse)</returns>
public async Task<ApiResponse<GetInvoiceResponse>> PointOfSaleApiGetInvoiceAsyncWithHttpInfo(Guid invoiceId, string accessToken)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiGetInvoice");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new string[] {
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
foreach (var contentType in contentTypes)
localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType);
foreach (var accept in accepts)
localVarRequestOptions.HeaderParameters.Add("Accept", accept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "invoice_id", invoiceId))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
// make the HTTP request
var localVarResponse = await AsynchronousClient.PostAsync<GetInvoiceResponse>("/api/v1/PointOfSaleApi/GetInvoice", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiGetInvoice", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Gets the invoice redemption information corresponding to the given invoice item. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR the Manage Invoices permission in the invoice item's invoice organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceItemId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>InvoiceRedemptionResponse</returns>
public InvoiceRedemptionResponse PointOfSaleApiGetInvoiceRedemption(Guid invoiceItemId, string accessToken)
{
var localVarResponse = PointOfSaleApiGetInvoiceRedemptionWithHttpInfo(invoiceItemId, accessToken);
return localVarResponse.Data;
}
/// <summary>
/// Gets the invoice redemption information corresponding to the given invoice item. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR the Manage Invoices permission in the invoice item's invoice organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceItemId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>ApiResponse of InvoiceRedemptionResponse</returns>
public ApiResponse<InvoiceRedemptionResponse> PointOfSaleApiGetInvoiceRedemptionWithHttpInfo(Guid invoiceItemId, string accessToken)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiGetInvoiceRedemption");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new string[] {
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = ClientUtils.SelectHeaderAccept(accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "invoice_item_id", invoiceItemId))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
// make the HTTP request
var localVarResponse = Client.Get<InvoiceRedemptionResponse>("/api/v1/PointOfSaleApi/GetInvoiceRedemption", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiGetInvoiceRedemption", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Gets the invoice redemption information corresponding to the given invoice item. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR the Manage Invoices permission in the invoice item's invoice organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceItemId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>Task of InvoiceRedemptionResponse</returns>
public async Task<InvoiceRedemptionResponse> PointOfSaleApiGetInvoiceRedemptionAsync(Guid invoiceItemId, string accessToken)
{
var localVarResponse = await PointOfSaleApiGetInvoiceRedemptionAsyncWithHttpInfo(invoiceItemId, accessToken);
return localVarResponse.Data;
}
/// <summary>
/// Gets the invoice redemption information corresponding to the given invoice item. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR the Manage Invoices permission in the invoice item's invoice organization or an ancestor.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="invoiceItemId"></param>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <returns>Task of ApiResponse (InvoiceRedemptionResponse)</returns>
public async Task<ApiResponse<InvoiceRedemptionResponse>> PointOfSaleApiGetInvoiceRedemptionAsyncWithHttpInfo(Guid invoiceItemId, string accessToken)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiGetInvoiceRedemption");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new string[] {
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
foreach (var contentType in contentTypes)
localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType);
foreach (var accept in accepts)
localVarRequestOptions.HeaderParameters.Add("Accept", accept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "invoice_item_id", invoiceItemId))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
// make the HTTP request
var localVarResponse = await AsynchronousClient.GetAsync<InvoiceRedemptionResponse>("/api/v1/PointOfSaleApi/GetInvoiceRedemption", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiGetInvoiceRedemption", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Redeems the invoice item associated with the invoice item id or redemption id/code. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR current user to have the Manage Invoices permission in the invoice organization or an ancestor thereof.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains fields for redeeming the invoice item</param>
/// <returns>InvoiceRedemptionResponse</returns>
public InvoiceRedemptionResponse PointOfSaleApiRedeemInvoiceItem(string accessToken, RedeemInvoiceItemRequest request)
{
var localVarResponse = PointOfSaleApiRedeemInvoiceItemWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// Redeems the invoice item associated with the invoice item id or redemption id/code. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR current user to have the Manage Invoices permission in the invoice organization or an ancestor thereof.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains fields for redeeming the invoice item</param>
/// <returns>ApiResponse of InvoiceRedemptionResponse</returns>
public ApiResponse<InvoiceRedemptionResponse> PointOfSaleApiRedeemInvoiceItemWithHttpInfo(string accessToken, RedeemInvoiceItemRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiRedeemInvoiceItem");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiRedeemInvoiceItem");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
var localVarContentType = ClientUtils.SelectHeaderContentType(contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = ClientUtils.SelectHeaderAccept(accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = Client.Post<InvoiceRedemptionResponse>("/api/v1/PointOfSaleApi/RedeemInvoiceItem", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiRedeemInvoiceItem", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
/// <summary>
/// Redeems the invoice item associated with the invoice item id or redemption id/code. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR current user to have the Manage Invoices permission in the invoice organization or an ancestor thereof.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains fields for redeeming the invoice item</param>
/// <returns>Task of InvoiceRedemptionResponse</returns>
public async Task<InvoiceRedemptionResponse> PointOfSaleApiRedeemInvoiceItemAsync(string accessToken, RedeemInvoiceItemRequest request)
{
var localVarResponse = await PointOfSaleApiRedeemInvoiceItemAsyncWithHttpInfo(accessToken, request);
return localVarResponse.Data;
}
/// <summary>
/// Redeems the invoice item associated with the invoice item id or redemption id/code. Requires current user to be sales agent on the invoice OR current user to be purchasing agent on the invoice OR current user to have the Manage Invoices permission in the invoice organization or an ancestor thereof.
/// </summary>
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
/// <param name="accessToken">Use the AdminApi Authenticate method to get the access_token</param>
/// <param name="request">Contains fields for redeeming the invoice item</param>
/// <returns>Task of ApiResponse (InvoiceRedemptionResponse)</returns>
public async Task<ApiResponse<InvoiceRedemptionResponse>> PointOfSaleApiRedeemInvoiceItemAsyncWithHttpInfo(string accessToken, RedeemInvoiceItemRequest request)
{
// verify the required parameter 'accessToken' is set
if (accessToken == null)
throw new ApiException(400, "Missing required parameter 'accessToken' when calling PointOfSaleApi->PointOfSaleApiRedeemInvoiceItem");
// verify the required parameter 'request' is set
if (request == null)
throw new ApiException(400, "Missing required parameter 'request' when calling PointOfSaleApi->PointOfSaleApiRedeemInvoiceItem");
var localVarRequestOptions = new RequestOptions();
var contentTypes = new[] {
"application/json",
"text/json"
};
// to determine the Accept header
var accepts = new[] {
"application/json",
"text/json"
};
foreach (var contentType in contentTypes)
localVarRequestOptions.HeaderParameters.Add("Content-Type", contentType);
foreach (var accept in accepts)
localVarRequestOptions.HeaderParameters.Add("Accept", accept);
foreach (var kvp in ClientUtils.ParameterToMultiMap("", "access_token", accessToken))
{
foreach (var kvpValue in kvp.Value)
{
localVarRequestOptions.QueryParameters.Add(kvp.Key, kvpValue);
}
}
localVarRequestOptions.Data = request;
// make the HTTP request
var localVarResponse = await AsynchronousClient.PostAsync<InvoiceRedemptionResponse>("/api/v1/PointOfSaleApi/RedeemInvoiceItem", localVarRequestOptions, Configuration);
var exception = ExceptionFactory?.Invoke("PointOfSaleApiRedeemInvoiceItem", localVarResponse);
if (exception != null) throw exception;
return localVarResponse;
}
}
}
|
Loading...