SubmitVendorPayments
Submit new invoices to Amazon Marketplace.
Execute
This stored procedure has a few Aggregate inputs which can be specified as either JSON, XML or #TEMP tables. In the following example we are going to use temp tables as demonstration.
First, we are going to create temp tables shipAddr, tax and invoiceItems according to Address, TaxDetails and InvoiceItem table schemas respectively.
INSERT INTO shipAddr#TEMP ( Name, AddressLine1, City, County, CountryCode)
VALUES ('Name', 'Fayettville NC', 'Fayettville', 'North Carolina', 'NC');
INSERT INTO tax#TEMP (TaxRate, Type, TaxAmount, TaxCurrencyCode)
VALUES ( '1.51', 'CGST', '1.51', 'EUR');
INSERT INTO invoiceItems#TEMP (ItemSequenceNumber, ItemSequenceNumber, AmazonProductIdentifier, PurchaseOrderNumber, InvoicedQuantityAmount, InvoicedQuantityUnit, NetCostAmount, NetCostCurrencyCode)
VALUES ( '111', '222', '333', '444', 10, 'Cases', '97', 'EUR');
After the necessary temporary table have been created, execute the stored procedure by providing the temp table name for aggregate inputs, as shown in the example below:
EXECUTE SubmitVendorPayments
Id = '123',
InvoiceType = 'Invoice',
Date = '2022',
TotalAmount = '100',
TotalCurrencyCode = 'EUR',
RemitToPartyId = '456',
ShipToPartyId = '789',
ShipToPartyAddress = 'shipAddr#TEMP',
TaxDetails = 'tax#TEMP',
Items = 'invoiceItems#TEMP';
*The temporary table must be defined and used within the same connection. Closing the connection will clear out any temporary tables in memory.
InvoiceItem temporary table schema info:
Column Name | Type | Required | Description |
ItemSequenceNumber | Integer | True | Unique number related to this line item. |
AmazonProductIdentifier | String | False | Amazon Standard Identification Number (ASIN) of an item. |
VendorProductIdentifier | String | False | The vendor selected product identifier of the item. Should be the same as was provided in the purchase order. |
PurchaseOrderNumber | String | False | The Amazon purchase order number for this invoiced line item. Formatting Notes: 8-character alpha-numeric code. This value is mandatory only when invoiceType is Invoice. |
HsnCode | String | False | HSN Tax code. The HSN number cannot contain alphabets. |
InvoicedQuantityAmount | Integer | True | Quantity of an item. This value should not be zero. |
InvoicedQuantityUnit | String | True | Unit of measure for the quantity. Allowed values are:
|
InvoicedQuantityUnitSize | Integer | False | The case size, if the unit of measure value is Cases. |
NetCostAmount | String | True | A decimal number with no loss of precision. |
NetCostCurrencyCode | String | True | Three-digit currency code in ISO 4217 format. |
CreditNoteReferenceInvoiceNumber | String | False | Original Invoice Number when sending a credit note relating to an existing invoice. One Invoice only to be processed per Credit Note. This is mandatory for AP Credit Notes. |
CreditNoteDebitNoteNumber | String | False | Debit Note Number as generated by Amazon. Recommended for Returns and COOP Credit Notes. |
CreditNoteReturnsReferenceNumber | String | False | Identifies the Returns Notice Number. Mandatory for all Returns Credit Notes. |
CreditNoteGoodsReturnDate | Datetime | False | Defines a date and time according to ISO8601. |
CreditNoteRmaId | String | False | Identifies the Returned Merchandise Authorization ID, if generated. |
CreditNoteCoopReferenceNumber | String | False | Identifies the COOP reference used for COOP agreement. Failure to provide the COOP reference number or the Debit Note number may lead to a rejection of the Credit Note. |
CreditNoteConsignorsReferenceNumber | String | False | Identifies the consignor reference number (VRET number), if generated by Amazon. |
TaxDetails | Aggregate | False | Individual tax details per line item. |
ChargeDetails | Aggregate | False | Individual charge details per line item. |
AllowanceDetails | Aggregate | False | Individual allowance details per line item. |
TaxDetails temporary table schema info:
Column Name | Type | Required | Description |
Type | String | True | Type of the tax applied. Allowed values are:
|
TaxRate | String | False | A decimal number with no loss of precision. |
TaxAmount | String | True | A decimal number with no loss of precision. |
TaxCurrencyCode | String | True | Three-digit currency code in ISO 4217 format. |
TaxableAmount | String | False | A decimal number with no loss of precision. |
TaxableCurrencyCode | String | False | Three-digit currency code in ISO 4217 format. |
TaxRegistration temporary table schema info:
Column Name | Type | Required | Description |
RegistrationType | String | True | The tax registration type for the entity. Allowed values are:
|
RegistrationNumber | String | True | The tax registration number for the entity. For example, VAT ID. |
ChargeDetails temporary table schema info:
Column Name | Type | Required | Description |
Type | String | True | Type of the charge applied. Allowed values are:
|
Description | String | False | Description of the charge. |
ChargeAmount | String | True | A decimal number with no loss of precision. |
ChargeCurrencyCode | String | True | Three-digit currency code in ISO 4217 format. |
TaxDetails | Aggregate | False | Tax amount details applied on this charge. See: TaxDetails table schema. |
AllowanceDetails temporary table schema info:
Column Name | Type | Required | Description |
Type | String | True | Type of the allowance applied. Allowed values are:
|
Description | String | False | Description of the allowance. |
AllowanceAmount | String | True | A decimal number with no loss of precision. |
AllowanceCurrencyCode | String | True | Three-digit currency code in ISO 4217 format. |
TaxDetails | Aggregate | False | Tax amount details applied on this allowance. See: TaxDetails table schema. |
AdditionalDetails temporary table schema info:
Column Name | Type | Required | Description |
Type | String | True | The type of the additional information provided by the selling party. Allowed values are:
|
Detail | String | True | The detail of the additional information provided by the selling party. |
LanguageCode | String | False | The language code of the additional information detail. |
Address temporary table schema info:
Column Name | Type | Required | Description |
Name | String | True | The name of the person, business or institution at that address. |
AddressLine1 | String | True | First line of street address. |
AddressLine2 | String | False | Additional address information, if required. |
AddressLine3 | String | False | Additional address information, if required. |
City | String | False | The city where the person, business or institution is located. |
County | String | False | The county where person, business or institution is located. |
District | String | False | The district where person, business or institution is located. |
StateOrRegion | String | False | The state or region where person, business or institution is located. |
PostalOrZipCode | String | False | The postal or zip code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation. |
CountryCode | String | True | The two digit country code. In ISO 3166-1 alpha-2 format. |
Phone | String | False | The phone number of the person, business or institution located at that address. |
Input
Name | Type | Required | Description |
InvoiceType | String | True | Identifies the type of invoice.
The allowed values are Invoice, CreditNote. |
Id | String | True | Unique number relating to the charges defined in this document. This will be invoice number if the document type is Invoice or CreditNote number if the document type is Credit Note. |
ReferenceNumber | String | False | An additional unique reference number used for regulatory or other purposes. |
Date | Datetime | True | Defines a date and time according to ISO8601. |
TotalAmount | String | True | A decimal number with no loss of precision. |
TotalCurrencyCode | String | True | Three-digit currency code in ISO 4217 format. |
PaymentType | String | False | The payment term type for the invoice.
The allowed values are Basic, EndOfMonth, FixedDate, Proximo, PaymentDueUponReceiptOfInvoice, LetterofCredit. |
PaymentDueDays | Integer | False | The number of calendar days from the base date (invoice date) until the total amount on the invoice is due. |
DiscountPercent | String | False | A decimal number with no loss of precision. |
DiscountDueDays | Integer | False | The number of calendar days from the Base date (Invoice date) until the discount is no longer valid. |
RemitToPartyId | String | True | Assigned identification for the party. |
RemitToPartyAddress | String | False | A physical address. |
RemitToPartyTaxDetails | String | False | Tax registration details of the party. |
ShipToPartyId | String | False | Assigned identification for the party. |
ShipToPartyAddress | String | False | A physical address. |
ShipToPartyTaxDetails | String | False | Tax registration details of the party. |
ShipFromPartyId | String | False | Assigned identification for the party. |
ShipFromPartyAddress | String | False | A physical address. |
ShipFromPartyTaxDetails | String | False | Tax registration details of the party. |
BillToPartyId | String | False | Assigned identification for the party. |
BillToPartyAddress | String | False | A physical address. |
BillToPartyTaxDetails | String | False | Tax registration details of the party. |
TaxDetails | String | False | Total tax amount details for all line items. |
AdditionalDetails | String | False | Additional details provided by the selling party, for tax related or other purposes. |
ChargeDetails | String | False | Total charge amount details for all line items. |
AllowanceDetails | String | False | Total allowance amount details for all line items. |
Items | String | False | The list of invoice items. |
Result Set Columns
Name | Type | Description |
Success | String | |
TransactionId | String |