Create Invoice API

Create Invoice API

Description

Creates a new invoice for the logged in distributor.  If there is an existing open account for the same dealer with the same VIN/HIN and invoice number the existing account’s document number will be returned.

Security

Available for distributor users

URL

Parameters        

Model

Field
Type
Description
bailmentDealerCodeStringThe bailment dealer code
invoiceNumber
String
The distributor invoice number, stored for reference
invoiceDate
String
The date of the invoice
bailmenLoanModelCode
String
The bailment loan model code
condition
Integer
The asset condition:

New = 0
Used = 1
Demo = 2
Race = 3
divisionCode
String
The division code (first analysis code)
assetDetails
Asset Details
The details of the asset
grossAmount
Number
Amount invoiced for the unit (GST inclusive)

Amount is to2 decimal places only
taxAmount
Number
Tax amount invoiced for the unit (must match the gross amount correctly)

Amount is to2 decimal places only
approvalCode
String
The approval code for this invoice

Added in V2
returnErrorIfExistingAccount
Boolean
If the VIN/HIN, bailment dealer code and invoice number match an existing open account and the value is false then the Trust Receipt number of the existing account is returned

If the field is set to true, then an error is returned

If not specified the default is false

Added in V3
distributorCode
String
The distributor code

Required if logging in as a staff user

Added in V4
secondAnalysisCode
String
The second analysis code

Added in V4
paymentTransactionReference
String
The payment transaction reference, if supported

Added in V5

Example

Notes

{                                                                                                                                         
"returnErrorIfExistingAccount": true,
"approvalCode": "string",
"bailmentDealerCode": "string",
"invoiceNumber": "string",
"invoiceDate": "2017-08-23T00:00:19.991Z",
"bailmentLoanModelCode": "string",
"condition": 0,
"divisionCode": "string",
"secondAnalysisCode": "string",
"paymentTransactionReference": "string,
"distributorCode": "string",
"assetDetails": {
      "description": "string",
      "model": "string",
      "vinhin": "string",
      "colour": "string",
      "engineNumber": "string",
      "registration": "string",
      "yearOfManufacture": 0,
      "securityMake": "string"
      },
"grossAmount": 0,
"taxAmount": 0
}

Response

Model

FieldTypeDescription
successBooleanTrue, if the invoice was successfully created, false otherwise
errorMessageString (optional)Details the error if success is false, null otherwise
documentNumberString (optional)The trust receipt number created for this invoice, null if unsuccessful

Example

Notes

{                                                                                                                                         
 "success": true,
"errorMessage": "string",
"documentNumber": "string"

Error Codes

HTTP Status Code
Type
400
Invalid request (error will be detailed in response)
403
Forbidden (invalid Authorisation)

403 can also be returned for the following business reasons:
  1. Credit suspended – Insufficient credit
    Message: "Dealer credit suspended, invoice has not been processed"
  2. Approval code refers to a Referred order
    Message: "Approval Pending, invoice has not been processed"
  3. Duplicate account when returnErrorIfExistingAccount = true
    Message: "An account with the same VIN/HIN and Invoice number already exists"
404
Dealer not found or Order not found (error will be detailed in response)
503
Service Unavailable (due to maintenance)

Online Documentation

https://api.argos.co.nz/WebApi/swagger/ui/index/


    • Related Articles

    • Create Livestock Invoice API

      Description Creates a new livestock invoice for the logged in distributor. If there is an existing open account for the same dealer with the same invoice number the existing account’s document number will be returned. Security Available for ...
    • Argos API/EDI Import Tool

      This document outlines how to use the Argos API Import tool to import new Bailment Accounts from an external file through the Argos API Server. Also how raise Credit Returns and Price Adjustments. Prerequisites API Server The API Import tool requires ...
    • Installing Argos Internal API

      The Argos Internal API is used to power the Vault and Bailment applications. Note, this is available from Argos v6.0 onwards Installation Types The installer can be used to install a production instance of the Argos Internal API. Instructions to ...
    • Argos Vault Release Notes V5.146

      Release Completion Date: 30 August 2024 Please disregard the release notes for the modules you do not use. Unless otherwise indicated, more detail about any change will be included in the relevant dialog [Help] button. Other documents referred to in ...
    • Create External Audit API

      Description For the requested External audit, uploads the audit results matching the External System Audit Id. Security Logged in user has API > Audit> Create External Audit permissions API Version Argos API V6 URL POST ...