Skip to end of metadata
Go to start of metadata

Overview

This document provides a high level detail on the API functions available for Accounts Integration. A separate document exists for details on the Enquiry submission API.
The general process is that the InvoiceDetails are retrieved up to a specified date (for example Invoices may have been reviewed up to Friday 14th June. Once the invoices are processed successfully, the MarkInvoice function allows the calling system to record that the specified invoices have been successfully pushed to the Accounting System.
Similarly Payments can be retrieved and processed then marked as sent to Accounts.

API Connection

Connection to the Ascora is achieved utilising Basic Authentication with an Ascora Account. This must be added to the headers in the HTTP Get/Post operations.


Invoice Functions

[Route("/invoicedetails")]

[Route("/invoicedetails/{CompanyId}")]

public class InvoiceDetails : InvoiceDetailResponse

{

public DateTime InvoicesPriorToDate { get; set; }

}

Retrieves all Invoices prior to the specified Date which have not yet been marked as sent to the Accounting System.

 

[Route("/MarkInvoice", "POST")]

public class MarkInvoice

{

public List<Guid> InvoiceIds { get; set; }

}

Marks the specified Invoices as having been successfully pushed  to the Accounting System.



Note: Invoices must be marked as successfully pushed once retrieve or they will be retrieved again in future requests.

Invoice Response Data

This represents the data returned from the Invoice Details request.

public class InvoiceDetailResponse
{
public List<InvoiceHeader> Results { get; set; }
}

Invoice Details



public class InvoiceHeader
{
public Guid Id { get; set; }
public DateTime InvoiceDate { get; set; }

public DateTime InvoiceDueDate { get; set; }

public string InvoiceNumber { get; set; }


public decimal AmountExTax { get; set; }
public decimal AdjustedAmountExTax { get; set; }

public decimal Tax { get; set; }
public bool SentToMyob { get; set; }


public Guid? BillingCustomerId { get; set; }


public string CompanyName { get; set; }

public string ContactFirstName { get; set; }

public string ContactLastName { get; set; }

public string EmailAddress { get; set; }

public string Phone { get; set; }
public string Mobile { get; set; }

public string Fax { get; set; }
public string Description { get; set; }

public string JobNumber { get; set; }


public string LeadSource { get; set; }
public string StreetAddressLine1 { get; set; }

public string StreetAddressLine2 { get; set; }

public string StreetAddressSuburb { get; set; }

public string StreetAddressCountry { get; set; }

public string StreetAddressPostcode { get; set; }

public string StreetAddressState { get; set; }

public string BillingAddressLine1 { get; set; }

public string BillingAddressLine2 { get; set; }

public string BillingAddressSuburb { get; set; }

public string BillingAddressCountry { get; set; }

public string BillingAddressPostcode { get; set; }

public string BillingAddressState { get; set; }


public string PurchaseOrderNumber { get; set; }
public List<InvoiceDetailLine> InvoiceLines { get; set; }
}

Invoice Detail Lines


public class InvoiceDetailLine
{
public string PartNumber { get; set; }

public string Description { get; set; }

public decimal Quantity { get; set; }

/// <summary>
/// Unit Price exclusive of Tax
/// </summary>
public decimal UnitPriceExTax
{
get { return AmountExTax / Quantity; }
}


/// <summary>
/// Total Amount for the Line excluding GST
/// </summary>
public decimal AmountExTax { get; set; }


/// <summary>
/// Total Tax for all items on this invoice Line
/// </summary>
public decimal Tax { get; set; }
}

Payment Functions

[Route("/payments")]

public class Payments

{

public List<Payment> Results { get; set; }

}

Retrieves all Payments that have not yet been sent to the Accounting Package but are linked to Invoices that are already marked as sent.

 

[Route("/MarkPayment", "POST")]

public class MarkPayment

{

public List<Guid> PaymentIds { get; set; }

}

Marks the specified Payments as having been successfully pushed  to the Accounting System.


Note: Payments must be marked as successfully pushed once retrieve or they will be retrieved again in future requests.

Payment Details


public class Payment
{
public Guid PaymentId { get; set; }

public DateTime PaymentDate { get; set; }

public decimal PaymentAmount { get; set; }

public string InvoiceNumber { get; set; }

public DateTime InvoiceDate { get; set; }

public string CompanyName { get; set; }
public string ContactFirstName { get; set; }
public string ContactLastName { get; set; }
}

  • No labels
Write a comment…