POST api/V3/Invoice/SecondaryInvoices

Api to post secondary invoices (Historical and Live). This accepts both FA and External Orders

Request Information

URI Parameters

None.

Body Parameters

Invoice to be updated

Collection of V3.SecondaryInvoices
NameDescriptionTypeAdditional information
InvoiceNumber

Invoice Number

string

Required

String length: inclusive between 1 and 50

FieldUserErpId

Field User ErpId

string

None.

OrderType

Type of Order

OrderType

None.

OrderNumber

Order Number as Per FieldAssist Order

integer

None.

DistributorErpId

Erp Code Of The distributor from where this invoice was generated [Optional]

string

None.

InvoiceDate

Date of Invoice

date

None.

RetailerERPId

SAP or ERP id of the outlet/customer

string

Required

String length: inclusive between 1 and 50

InvoiceSkuDetails

Product Details

Collection of V3.SecondaryInvoiceSkuDetails

None.

ReferenceNumber

Invoice Reference Number[Optional]

string

None.

DeleteOlderInvoiceNumber

Delete Older Invoice Number

boolean

Required

IsSFAOrder

Is SFA Order Or Not, Default: false

boolean

None.

ExternalOrderNumber

External Order Number

string

None.

InvoiceType

InvoiceType Default: General

InvoiceType

None.

AttributeText1

Attribute Text 1

string

None.

AttributeText2

Attribute Text 2

string

None.

Request Formats

application/json, text/json

Sample:
[
  {
    "InvoiceNumber": "sample string 1",
    "FieldUserErpId": "sample string 2",
    "OrderType": "Physical",
    "OrderNumber": 1,
    "DistributorErpId": "sample string 3",
    "InvoiceDate": "2025-04-04T05:10:18.0106973+00:00",
    "RetailerERPId": "sample string 5",
    "InvoiceSkuDetails": [
      {
        "ProductERPId": "sample string 1",
        "BilledPTR": 1.0,
        "Quantity": 1.1,
        "OrderQty": 1.1,
        "GrossRevenueValue": 1.1,
        "NetRevenueValue": 1.1,
        "DiscountValue": 1.1,
        "FreeQuantity": 1,
        "TotalTaxValue": 1.1
      },
      {
        "ProductERPId": "sample string 1",
        "BilledPTR": 1.0,
        "Quantity": 1.1,
        "OrderQty": 1.1,
        "GrossRevenueValue": 1.1,
        "NetRevenueValue": 1.1,
        "DiscountValue": 1.1,
        "FreeQuantity": 1,
        "TotalTaxValue": 1.1
      }
    ],
    "ReferenceNumber": "sample string 6",
    "DeleteOlderInvoiceNumber": true,
    "IsSFAOrder": true,
    "ExternalOrderNumber": "sample string 9",
    "InvoiceType": "General",
    "AttributeText1": "sample string 10",
    "AttributeText2": "sample string 11"
  },
  {
    "InvoiceNumber": "sample string 1",
    "FieldUserErpId": "sample string 2",
    "OrderType": "Physical",
    "OrderNumber": 1,
    "DistributorErpId": "sample string 3",
    "InvoiceDate": "2025-04-04T05:10:18.0106973+00:00",
    "RetailerERPId": "sample string 5",
    "InvoiceSkuDetails": [
      {
        "ProductERPId": "sample string 1",
        "BilledPTR": 1.0,
        "Quantity": 1.1,
        "OrderQty": 1.1,
        "GrossRevenueValue": 1.1,
        "NetRevenueValue": 1.1,
        "DiscountValue": 1.1,
        "FreeQuantity": 1,
        "TotalTaxValue": 1.1
      },
      {
        "ProductERPId": "sample string 1",
        "BilledPTR": 1.0,
        "Quantity": 1.1,
        "OrderQty": 1.1,
        "GrossRevenueValue": 1.1,
        "NetRevenueValue": 1.1,
        "DiscountValue": 1.1,
        "FreeQuantity": 1,
        "TotalTaxValue": 1.1
      }
    ],
    "ReferenceNumber": "sample string 6",
    "DeleteOlderInvoiceNumber": true,
    "IsSFAOrder": true,
    "ExternalOrderNumber": "sample string 9",
    "InvoiceType": "General",
    "AttributeText1": "sample string 10",
    "AttributeText2": "sample string 11"
  }
]

application/xml, text/xml

Sample:
<ArrayOfSecondaryInvoices xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ExternalApis.V3.Models">
  <SecondaryInvoices>
    <AttributeText1>sample string 10</AttributeText1>
    <AttributeText2>sample string 11</AttributeText2>
    <DeleteOlderInvoiceNumber>true</DeleteOlderInvoiceNumber>
    <DistributorErpId>sample string 3</DistributorErpId>
    <ExternalOrderNumber>sample string 9</ExternalOrderNumber>
    <FieldUserErpId>sample string 2</FieldUserErpId>
    <InvoiceDate>2025-04-04T05:10:18.0106973+00:00</InvoiceDate>
    <InvoiceNumber>sample string 1</InvoiceNumber>
    <InvoiceSkuDetails>
      <SecondaryInvoiceSkuDetails>
        <BilledPTR>1</BilledPTR>
        <DiscountValue>1.1</DiscountValue>
        <FreeQuantity>1</FreeQuantity>
        <GrossRevenueValue>1.1</GrossRevenueValue>
        <NetRevenueValue>1.1</NetRevenueValue>
        <OrderQty>1.1</OrderQty>
        <ProductERPId>sample string 1</ProductERPId>
        <Quantity>1.1</Quantity>
        <TotalTaxValue>1.1</TotalTaxValue>
      </SecondaryInvoiceSkuDetails>
      <SecondaryInvoiceSkuDetails>
        <BilledPTR>1</BilledPTR>
        <DiscountValue>1.1</DiscountValue>
        <FreeQuantity>1</FreeQuantity>
        <GrossRevenueValue>1.1</GrossRevenueValue>
        <NetRevenueValue>1.1</NetRevenueValue>
        <OrderQty>1.1</OrderQty>
        <ProductERPId>sample string 1</ProductERPId>
        <Quantity>1.1</Quantity>
        <TotalTaxValue>1.1</TotalTaxValue>
      </SecondaryInvoiceSkuDetails>
    </InvoiceSkuDetails>
    <InvoiceType>General</InvoiceType>
    <IsSFAOrder>true</IsSFAOrder>
    <OrderNumber>1</OrderNumber>
    <OrderType>Physical</OrderType>
    <ReferenceNumber>sample string 6</ReferenceNumber>
    <RetailerERPId>sample string 5</RetailerERPId>
  </SecondaryInvoices>
  <SecondaryInvoices>
    <AttributeText1>sample string 10</AttributeText1>
    <AttributeText2>sample string 11</AttributeText2>
    <DeleteOlderInvoiceNumber>true</DeleteOlderInvoiceNumber>
    <DistributorErpId>sample string 3</DistributorErpId>
    <ExternalOrderNumber>sample string 9</ExternalOrderNumber>
    <FieldUserErpId>sample string 2</FieldUserErpId>
    <InvoiceDate>2025-04-04T05:10:18.0106973+00:00</InvoiceDate>
    <InvoiceNumber>sample string 1</InvoiceNumber>
    <InvoiceSkuDetails>
      <SecondaryInvoiceSkuDetails>
        <BilledPTR>1</BilledPTR>
        <DiscountValue>1.1</DiscountValue>
        <FreeQuantity>1</FreeQuantity>
        <GrossRevenueValue>1.1</GrossRevenueValue>
        <NetRevenueValue>1.1</NetRevenueValue>
        <OrderQty>1.1</OrderQty>
        <ProductERPId>sample string 1</ProductERPId>
        <Quantity>1.1</Quantity>
        <TotalTaxValue>1.1</TotalTaxValue>
      </SecondaryInvoiceSkuDetails>
      <SecondaryInvoiceSkuDetails>
        <BilledPTR>1</BilledPTR>
        <DiscountValue>1.1</DiscountValue>
        <FreeQuantity>1</FreeQuantity>
        <GrossRevenueValue>1.1</GrossRevenueValue>
        <NetRevenueValue>1.1</NetRevenueValue>
        <OrderQty>1.1</OrderQty>
        <ProductERPId>sample string 1</ProductERPId>
        <Quantity>1.1</Quantity>
        <TotalTaxValue>1.1</TotalTaxValue>
      </SecondaryInvoiceSkuDetails>
    </InvoiceSkuDetails>
    <InvoiceType>General</InvoiceType>
    <IsSFAOrder>true</IsSFAOrder>
    <OrderNumber>1</OrderNumber>
    <OrderType>Physical</OrderType>
    <ReferenceNumber>sample string 6</ReferenceNumber>
    <RetailerERPId>sample string 5</RetailerERPId>
  </SecondaryInvoices>
</ArrayOfSecondaryInvoices>

Response Information

Resource Description

Response object with Guid and message or an Error Message

IHttpActionResult

None.

Response Formats

application/json, text/json, application/xml, text/xml

Sample:

Sample not available.