CreateInvoiceInbound (POST)

Overview

This POST API will help in Inbound Invoice Creation. Some basic details need to be added to the payload, and other details will be flipped from the source document. 

URL Format: https://api-leoaksuat.gep.com/leo-invoice-interface/api/v2/InvoiceDetails/UnProcessedAsync  

Request
{
	"invoiceDocumentType": 1,
	"invoiceOriginator": 2,
	"invoiceSource": 2,
	"invoiceSourceDocumentType": 1,
	"invoiceStatus": {
		"documentStatus": 1
	},
	"subTypeAppId": "00000000-0000-0000-0000-000000000000",
	"fulfillmentDocumentDetails": [
		{
			"fulfillmentDocumentNumber": "PO-2025-22XXX",
			"fulfillmentDocumentType": 6
		}
	],
	"documentName": "INV_Test_XXX",
	"invoiceBasicDetails": {
		"currency": {},
		"taxes": 0.0,
		"shippingCharges": 0.0,
		"otherCharges": 0.0,
		"orderDetails": [
			{
				"orderNumber": "PO-2025-22XXX"
			}
		],
		"supplierInvoiceNumber": "InboundcreationTest",
		"supplier": {
			"id": 00000,
			"leoSupplierId": "00000000-0000-0000-0000-000000000000",
			"name": "SUP_XYZ",
			"clientCode": "PC-XXXX",
			"sourceSystemName": "CPC_XYZ",
			"supplierVATNumber": ""
		},
		"invoiceAmount": 15.0,
		"supplierInvoiceDate": "MM/DD/YYYY",
		"paymentDeliveryDetails": {
			"ShipTo": {
				"shipToAddress": "NY, USA"
			}
		}
	},
	"lineDetails": [
		{
			"buyerItemNumber": "",
			"shortName": "XYZ",
			"supplierItemNumber": "XX-111",
			"uom": {
				"uomType": "EA"
			},
			"unitPrice": 15.0,
			"shipFromLocation": {
				"address": {}
			},
			"shipTo": {
				"address": {}
			},
			"customAttributes": {
				"proposalNumber": "SUPPROP_XYZ",
				"atmId": "ATMID_XYZ",
				"projectIdNumber": "AUTOPROJ_XYZ"
			},
			"orderDetails": {
				"orderNumber": "PO-2025-22XXX",
				"orderLineNumber": 1
			},
			"fulfillmentDocumentLineDetails": [
				{
					"fulfillmentDocumentNumber": "PO-2025-22XXX",
					"fulfillmentDocumentType": 6
				}
			],
			"lineNumber": 1,
			"description": "l",
			"quantity": 1.0,
			"lineKey": "1",
			"taxItems": [
				{
					"taxType": "Standard",
					"subTaxType": "Standard",
					"value": 0.0,
					"taxJurisdiction": "",
					"exempt": false
				}
			]
		}
	]
}
Response
{ 
	"returnValue": { 
		"isSuccess": true, 
		"errorType": null, 
		"errorMessage": null, 
		"headerErrorDetails": [], 
		"lineErrorDetails": [], 
		"key": "", 
		"errorEmailId": null 
	}, 
	"isSuccess": true, 
	"errors": null, 
	"exception": null, 
	"errorMessage": null, 
	"errorCode": null, 
	"correlationId": "0HNA0BCPPL2QN:00000001" 
} 
Data Elements

Payload/Request 

Property 

Required? 

Data type 

Description 

Validations / Exceptions 

invoiceDocumentType

 Yes

integer 

Integer Enum value of the Invoice subtype 

 

invoiceOriginator

 Yes

integer 

Integer Enum value of the Invoice originator 

 

invoiceSource

 Yes

integer 

Integer Enum value of the Invoice source 

 

invoiceSourceDocumentType

 Yes

integer 

Integer Enum value of the Invoice source document type

 

subTypeAppId

Yes

string

String containing the subtypeappid of the intended invoice to be created.

 

invoiceStatus

Yes

Object

Object in which we must pass the Enum value 1 to property documentStatus as newly created invoice will land in draft status

 

fulfillmentDocumentDetails

Yes

Array of Objects

Will pass the objects containing the fulfillmentDocumentNumber and fulfillmentDocumentType, of each of the source document

 

documentName

Yes

String

String value containing the Invoice Name

 

invoiceBasicDetails

Yes

Object

Will contain basic Invoice details like supplier details, source document details, invoiceTotal, etc

 

lineDetails

Yes

Array of Objects

It will include objects with basic details of the lines which needs to be created in the invoice.
If N objects are passed N lines will be created on the invoice

 

invoiceBasicDetails

Property 

Required? 

Data type 

Description 

Validations / Exceptions 

currency

 

object

Object having currency details

 

taxes

 

decimal

Tax amount

 

shippingCharges

 

decimal

 

Shipping charges

 

otherCharges

 

decimal

 

Other charges

 

orderDetails

Yes

Array of objects

Orderdetails object containing the orderNumber

 

supplierInvoiceNumber

Yes

string

Unique supplier number should be passed

 

supplier

Yes

Objects

Supplier Object present in the source document should be passed

 

invoiceAmount

Yes

Decimal

Total invoice amount should be passed equal to aggregate of line totals

 

supplierInvoiceDate

Yes

String

Invoice date should be passed in the MM/DD/YYYY format

 

paymentDeliveryDetails

 

Object

Object containing details of the payment terms, shipTo

 

 

 

 lineDetails

Property 

Required? 

Data type 

Description 

Validations / Exceptions 

buyerItemNumber

 

string

BuyerItemNumber String

 

shortName

Yes 

string

Item Name

 

supplierItemNumber

 

string

 

SupplierItemNumber string value

 

uom

 

object

Uom object containing uom type value

 

unitPrice

Yes

decimal

Per Item price.

 

shipFromLocation

 

Object

Object containing address, city code, location code properties else it will be flipped from source document

 

shipTo

 

Object

Object containing address, city code, location code properties else it will be flipped from source document.

 

customAttributes

 

Object

 

 

orderDetails

Yes

Object

Should contain two properties the orderNumber and Orderlinenumber against which the invoice line needs to be

 

fulfillmentDocumentLineDetails

 

Array of Objects

Will pass the objects containing the fulfillmentDocumentNumber and fulfillmentDocumentType, of each of the source document

 

lineNumber

Yes

Integer

Line number as it should appear on Invoice

 

description

 

String

Item Description

 

quantity

Yes

Decimal

Quantity of items ordered

 

lineKey

 

String

 

 

taxItems

 

Array of Objects

Tax details

 

 

 

Response 

Property 

Required? 

Data type 

Description 

Validations / Exceptions 

 returnValue

 

 Object

 The actual return value of the Api execution is found in this object.

 

isSuccess

 

Boolean

Boolean Flag indication the success of Api Execution

 

errors

 

Object

 

 

exception

 

Object

It provides stack trace if any exception occurred at API level 

 

errorMessage

 

String

Displays error message

 

errorCode

 

String

 

 

 

 

 

 

 

 

Return Value 

Property 

Required? 

Data type 

Description 

Validations / Exceptions 

isSuccess

 

boolean 

Gives Boolean flag indicating the success of posting invoice.

 

 errorType

 

 String

 Returns error type. E.g.- Validation Filure

 

errorMessage

 

String

Error details message

 

headerErrorDetails

 

Object

Returns Object with the details of any errors in header level fields

 

lineErrorDetails

 

Object

Returns Object with the details of error in line level fields

 

key

 

String

 

 

errorEmailId

 

String

Returns Email id to mail in case of Api execution failure