Module: Peddler::Types::VendorInvoicesV1

Defined in:
lib/peddler/types/vendor_invoices_v1/error.rb,
lib/peddler/types/vendor_invoices_v1/address.rb,
lib/peddler/types/vendor_invoices_v1/invoice.rb,
lib/peddler/types/vendor_invoices_v1/tax_details.rb,
lib/peddler/types/vendor_invoices_v1/invoice_item.rb,
lib/peddler/types/vendor_invoices_v1/total_weight.rb,
lib/peddler/types/vendor_invoices_v1/item_quantity.rb,
lib/peddler/types/vendor_invoices_v1/payment_terms.rb,
lib/peddler/types/vendor_invoices_v1/charge_details.rb,
lib/peddler/types/vendor_invoices_v1/transaction_id.rb,
lib/peddler/types/vendor_invoices_v1/allowance_details.rb,
lib/peddler/types/vendor_invoices_v1/additional_details.rb,
lib/peddler/types/vendor_invoices_v1/credit_note_details.rb,
lib/peddler/types/vendor_invoices_v1/party_identification.rb,
lib/peddler/types/vendor_invoices_v1/submit_invoices_request.rb,
lib/peddler/types/vendor_invoices_v1/submit_invoices_response.rb,
lib/peddler/types/vendor_invoices_v1/tax_registration_details.rb

Constant Summary collapse

Error =

Error response returned when the request is unsuccessful.

Structure.new do
  # @return [String] An error code that identifies the type of error that occurred.
  attribute(:code, String)

  # @return [String] A message that describes the error condition.
  attribute(:message, String)

  # @return [String] Additional details that can help the caller understand or fix the issue.
  attribute(:details, String)
end
Address =

A physical address.

Structure.new do
  # @return [String] The name of the person, business or institution at that address.
  attribute(:name, String)

  # @return [String] First line of street address.
  attribute(:address_line1, String, from: "addressLine1")

  # @return [String] Additional address information, if required.
  attribute(:address_line2, String, from: "addressLine2")

  # @return [String] Additional address information, if required.
  attribute(:address_line3, String, from: "addressLine3")

  # @return [String] The city where the person, business or institution is located.
  attribute(:city, String)

  # @return [String] The county where person, business or institution is located.
  attribute(:county, String)

  # @return [String] The district where person, business or institution is located.
  attribute(:district, String)

  # @return [String] The state or region where person, business or institution is located.
  attribute(:state_or_region, String, from: "stateOrRegion")

  # @return [String] The postal or zip code of that address. It contains a series of letters or digits or both,
  # sometimes including spaces or punctuation.
  attribute(:postal_or_zip_code, String, from: "postalOrZipCode")

  # @return [String] The two digit country code. In ISO 3166-1 alpha-2 format.
  attribute(:country_code, String, from: "countryCode")

  # @return [String] The phone number of the person, business or institution located at that address.
  attribute(:phone, String)
end
Invoice =

Represents an invoice or credit note document with details about the transaction, parties involved, and line items.

Structure.new do
  # @return [String] Identifies the type of invoice.
  attribute(:invoice_type, String, from: "invoiceType")

  # @return [String] 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. Failure to provide
  # this reference will result in a rejection.
  attribute(:id, String)

  # @return [String] An additional unique reference number used for regulatory or other purposes.
  attribute(:reference_number, String, from: "referenceNumber")

  # @return [String] Date when the invoice/credit note information was generated in the origin's accounting
  # system. The invoice date should be on or after the purchase order creation date.
  attribute(:date, String)

  # @return [PartyIdentification] Name, address and tax details of the party receiving the payment of this
  # invoice.
  attribute(:remit_to_party, PartyIdentification, from: "remitToParty")

  # @return [PartyIdentification] Name, address and tax details of the party receiving a shipment of products.
  attribute(:ship_to_party, PartyIdentification, from: "shipToParty")

  # @return [PartyIdentification] Name, address and tax details of the party sending a shipment of products.
  attribute(:ship_from_party, PartyIdentification, from: "shipFromParty")

  # @return [PartyIdentification] Name, address and tax details of the party to whom this invoice is issued.
  attribute(:bill_to_party, PartyIdentification, from: "billToParty")

  # @return [PaymentTerms] The payment terms for the invoice.
  attribute(:payment_terms, PaymentTerms, from: "paymentTerms")

  # @return [Money] Total monetary amount charged in the invoice or full value of credit note to be paid including
  # all relevant taxes. It is the total amount of invoice (including charges, less allowances) before terms
  # discount (if discount is applicable).
  attribute(:invoice_total, Money, from: "invoiceTotal")

  # @return [Array<TaxDetails>] Total tax amount details for all line items.
  attribute(:tax_details, [TaxDetails], from: "taxDetails")

  # @return [Array<AdditionalDetails>] Additional details provided by the selling party, for tax related or other
  # purposes.
  attribute(:additional_details, [AdditionalDetails], from: "additionalDetails")

  # @return [Array<ChargeDetails>] Total charge amount details for all line items.
  attribute(:charge_details, [ChargeDetails], from: "chargeDetails")

  # @return [Array<AllowanceDetails>] Total allowance amount details for all line items.
  attribute(:allowance_details, [AllowanceDetails], from: "allowanceDetails")

  # @return [Array<InvoiceItem>] The list of invoice items.
  attribute(:items, [InvoiceItem])
end
TaxDetails =

Details of tax amount applied.

Structure.new do
  # @return [String] Type of the tax applied.
  attribute(:tax_type, String, from: "taxType")

  # @return [String] Tax percentage applied. Percentage must be expressed in decimal.
  attribute(:tax_rate, String, from: "taxRate")

  # @return [Money] Total tax amount applied on invoice total or an item total.
  attribute(:tax_amount, Money, from: "taxAmount")

  # @return [Money] The invoice amount that is taxable at the rate specified in the tax rate field.
  attribute(:taxable_amount, Money, from: "taxableAmount")
end
InvoiceItem =

Details of the item being invoiced.

Structure.new do
  # @return [Integer] Unique number related to this line item.
  attribute(:item_sequence_number, Integer, from: "itemSequenceNumber")

  # @return [String] Amazon Standard Identification Number (ASIN) of an item.
  attribute(:amazon_product_identifier, String, from: "amazonProductIdentifier")

  # @return [String] The vendor selected product identifier of the item. Should be the same as was provided in the
  # purchase order.
  attribute(:vendor_product_identifier, String, from: "vendorProductIdentifier")

  # @return [ItemQuantity] Invoiced quantity of this item. Quantity must be greater than zero.
  attribute(:invoiced_quantity, ItemQuantity, from: "invoicedQuantity")

  # @return [Money] The item cost to Amazon, which should match the cost on the order. Price information should
  # not be zero or negative. It indicates net unit price. Net cost means VAT is not included in cost. If items are
  # priced by weight, this cost need to be considered in conjunction with netCostUnitOfMeasure. E.g.: $5/LB
  attribute(:net_cost, Money, from: "netCost")

  # @return [String] This field represents weight unit of measure of items that are ordered by cases and
  # supporting priced by weight.
  attribute(:net_cost_unit_of_measure, String, from: "netCostUnitOfMeasure")

  # @return [String] 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, and is not required when
  # invoiceType is CreditNote.
  attribute(:purchase_order_number, String, from: "purchaseOrderNumber")

  # @return [String] HSN Tax code. The HSN number cannot contain alphabets.
  attribute(:hsn_code, String, from: "hsnCode")

  # @return [CreditNoteDetails] Details required in order to process a credit note. This information is required
  # only if invoiceType is CreditNote.
  attribute(:credit_note_details, CreditNoteDetails, from: "creditNoteDetails")

  # @return [Array<TaxDetails>] Individual tax details per line item.
  attribute(:tax_details, [TaxDetails], from: "taxDetails")

  # @return [Array<ChargeDetails>] Individual charge details per line item.
  attribute(:charge_details, [ChargeDetails], from: "chargeDetails")

  # @return [Array<AllowanceDetails>] Individual allowance details per line item.
  attribute(:allowance_details, [AllowanceDetails], from: "allowanceDetails")
end
TotalWeight =

The aggregate weight of this item being invoiced. This information will be available for items sold by weight.

Structure.new do
  # @return [String] The unit of measure for items sold by weight.
  attribute(:unit_of_measure, String, from: "unitOfMeasure")

  # @return [String]
  attribute(:amount, String)
end
ItemQuantity =

Details of quantity.

Structure.new do
  # @return [Integer] Quantity of an item. This value should not be zero.
  attribute(:amount, Integer)

  # @return [String] Unit of measure for the quantity.
  attribute(:unit_of_measure, String, from: "unitOfMeasure")

  # @return [Integer] The case size, if the unit of measure value is Cases.
  attribute(:unit_size, Integer, from: "unitSize")

  # @return [TotalWeight]
  attribute(:total_weight, TotalWeight, from: "totalWeight")
end
PaymentTerms =

Terms of the payment for the invoice. The basis of the payment terms is the invoice date.

Structure.new do
  # @return [String] The payment term type for the invoice.
  attribute(:type, String)

  # @return [String] The discount percent value, which is good until the discount due date.
  attribute(:discount_percent, String, from: "discountPercent")

  # @return [Float] The number of calendar days from the Base date (Invoice date) until the discount is no longer
  # valid.
  attribute(:discount_due_days, Float, from: "discountDueDays")

  # @return [Float] The number of calendar days from the base date (invoice date) until the total amount on the
  # invoice is due.
  attribute(:net_due_days, Float, from: "netDueDays")
end
ChargeDetails =

Monetary and tax details of the charge.

Structure.new do
  # @return [String] Type of the charge applied.
  attribute(:type, String)

  # @return [String] Description of the charge.
  attribute(:description, String)

  # @return [Money] Total monetary amount related to this charge.
  attribute(:charge_amount, Money, from: "chargeAmount")

  # @return [Array<TaxDetails>] Tax amount details applied on this charge.
  attribute(:tax_details, [TaxDetails], from: "taxDetails")
end
TransactionId =

Response containing the transaction ID.

Structure.new do
  # @return [String] GUID to identify this transaction. This value can be used with the Transaction Status API to
  # return the status of this transaction.
  attribute(:transaction_id, String, from: "transactionId")
end
AllowanceDetails =

Monetary and tax details of the allowance.

Structure.new do
  # @return [String] Type of the allowance applied.
  attribute(:type, String)

  # @return [String] Description of the allowance.
  attribute(:description, String)

  # @return [Money] Total monetary amount related to this allowance.
  attribute(:allowance_amount, Money, from: "allowanceAmount")

  # @return [Array<TaxDetails>] Tax amount details applied on this allowance.
  attribute(:tax_details, [TaxDetails], from: "taxDetails")
end
AdditionalDetails =

Additional information provided by the selling party for tax-related or any other purpose.

Structure.new do
  # @return [String] The type of the additional information provided by the selling party.
  attribute(:type, String)

  # @return [String] The detail of the additional information provided by the selling party.
  attribute(:detail, String)

  # @return [String] The language code of the additional information detail.
  attribute(:language_code, String, from: "languageCode")
end
CreditNoteDetails =

References required in order to process a credit note. This information is required only if InvoiceType is CreditNote.

Structure.new do
  # @return [String] 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.
  attribute(:reference_invoice_number, String, from: "referenceInvoiceNumber")

  # @return [String] Debit Note Number as generated by Amazon. Recommended for Returns and COOP Credit Notes.
  attribute(:debit_note_number, String, from: "debitNoteNumber")

  # @return [String] Identifies the Returns Notice Number. Mandatory for all Returns Credit Notes.
  attribute(:returns_reference_number, String, from: "returnsReferenceNumber")

  # @return [String] Date that a return is received by the vendor. It is mandatory for Returns Credit Note.
  attribute(:goods_return_date, String, from: "goodsReturnDate")

  # @return [String] Identifies the Returned Merchandise Authorization ID, if generated.
  attribute(:rma_id, String, from: "rmaId")

  # @return [String] 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.
  attribute(:coop_reference_number, String, from: "coopReferenceNumber")

  # @return [String] Identifies the consignor reference number (VRET number), if generated by Amazon.
  attribute(:consignors_reference_number, String, from: "consignorsReferenceNumber")
end
PartyIdentification =

Name, address and tax details of a party.

Structure.new do
  # @return [String] Assigned identification for the party.
  attribute(:party_id, String, from: "partyId")

  # @return [Address] Identification of the party by address.
  attribute(:address, Address)

  # @return [Array<TaxRegistrationDetails>] Tax registration details of the party.
  attribute(:tax_registration_details, [TaxRegistrationDetails], from: "taxRegistrationDetails")
end
SubmitInvoicesRequest =

The request schema for the submitInvoices operation.

Structure.new do
  # @return [Array<Invoice>] An array of Invoice objects representing the invoices or credit notes to be
  # submitted.
  attribute(:invoices, [Invoice])
end
SubmitInvoicesResponse =

The response schema for the submitInvoices operation.

Structure.new do
  # @return [TransactionId] The response payload for the submitInvoices operation.
  attribute(:payload, TransactionId)

  # @return [Array<Error>]
  attribute(:errors, [Error])
end
TaxRegistrationDetails =

Tax registration details of the entity.

Structure.new do
  # @return [String] The tax registration type for the entity.
  attribute(:tax_registration_type, String, from: "taxRegistrationType")

  # @return [String] The tax registration number for the entity. For example, VAT ID, Consumption Tax ID.
  attribute(:tax_registration_number, String, from: "taxRegistrationNumber")
end