Documentation ¶
Overview ¶
Package vendorinvoicesv1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
Index ¶
- func NewSubmitInvoicesRequest(server string, body SubmitInvoicesJSONRequestBody) (*http.Request, error)
- func NewSubmitInvoicesRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- type AdditionalDetails
- type AdditionalDetailsType
- type Address
- type AllowanceDetails
- type AllowanceDetailsType
- type ChargeDetails
- type ChargeDetailsType
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- type ClientWithResponsesInterface
- type CreditNoteDetails
- type DateTime
- type Decimal
- type Error
- type ErrorList
- type HttpRequestDoer
- type Invoice
- type InvoiceInvoiceType
- type InvoiceItem
- type ItemQuantity
- type ItemQuantityUnitOfMeasure
- type Money
- type PartyIdentification
- type PaymentTerms
- type PaymentTermsType
- type RequestEditorFn
- type ResponseEditorFn
- type SubmitInvoicesJSONRequestBody
- type SubmitInvoicesRequest
- type SubmitInvoicesResp
- type SubmitInvoicesResponse
- type TaxDetails
- type TaxDetailsTaxType
- type TaxRegistrationDetails
- type TaxRegistrationDetailsTaxRegistrationType
- type TransactionId
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSubmitInvoicesRequest ¶
func NewSubmitInvoicesRequest(server string, body SubmitInvoicesJSONRequestBody) (*http.Request, error)
NewSubmitInvoicesRequest calls the generic SubmitInvoices builder with application/json body
Types ¶
type AdditionalDetails ¶
type AdditionalDetails struct { // Detail The detail of the additional information provided by the selling party. Detail string `json:"detail"` // LanguageCode The language code of the additional information detail. LanguageCode *string `json:"languageCode,omitempty"` // Type The type of the additional information provided by the selling party. Type AdditionalDetailsType `json:"type"` }
AdditionalDetails Additional information provided by the selling party for tax-related or any other purpose.
type AdditionalDetailsType ¶
type AdditionalDetailsType string
AdditionalDetailsType The type of the additional information provided by the selling party.
const ( CartonCount AdditionalDetailsType = "CartonCount" OCR AdditionalDetailsType = "OCR" SUR AdditionalDetailsType = "SUR" )
Defines values for AdditionalDetailsType.
type Address ¶
type Address struct { // AddressLine1 First line of street address. AddressLine1 string `json:"addressLine1"` // AddressLine2 Additional address information, if required. AddressLine2 *string `json:"addressLine2,omitempty"` // AddressLine3 Additional address information, if required. AddressLine3 *string `json:"addressLine3,omitempty"` // City The city where the person, business, or institution is located. City *string `json:"city,omitempty"` // CountryCode The two digit country code. In ISO 3166-1 alpha-2 format. CountryCode string `json:"countryCode"` // County The county where person, business, or institution is located. County *string `json:"county,omitempty"` // District The district where person, business, or institution is located. District *string `json:"district,omitempty"` // Name The name of the person, business or institution at that address. Name string `json:"name"` // Phone The phone number of the person, business or institution located at that address. Phone *string `json:"phone,omitempty"` // PostalOrZipCode The postal or zip code of that address. It contains a series of letters, digits, or both, sometimes including spaces or punctuation. PostalOrZipCode *string `json:"postalOrZipCode,omitempty"` // StateOrRegion The state or region where person, business, or institution is located. StateOrRegion *string `json:"stateOrRegion,omitempty"` }
Address A physical address.
type AllowanceDetails ¶
type AllowanceDetails struct { // AllowanceAmount An amount of money, including units in the form of currency. AllowanceAmount Money `json:"allowanceAmount"` // Description Description of the allowance. Description *string `json:"description,omitempty"` // TaxDetails Tax amount details applied on this allowance. TaxDetails *[]TaxDetails `json:"taxDetails,omitempty"` // Type Type of the allowance applied. Type AllowanceDetailsType `json:"type"` }
AllowanceDetails Monetary and tax details of the allowance.
type AllowanceDetailsType ¶
type AllowanceDetailsType string
AllowanceDetailsType Type of the allowance applied.
const ( Defective AllowanceDetailsType = "Defective" Discount AllowanceDetailsType = "Discount" DiscountIncentive AllowanceDetailsType = "DiscountIncentive" Promotional AllowanceDetailsType = "Promotional" Special AllowanceDetailsType = "Special" UnsaleableMerchandise AllowanceDetailsType = "UnsaleableMerchandise" )
Defines values for AllowanceDetailsType.
type ChargeDetails ¶
type ChargeDetails struct { // ChargeAmount An amount of money, including units in the form of currency. ChargeAmount Money `json:"chargeAmount"` // Description Description of the charge. Description *string `json:"description,omitempty"` // TaxDetails Tax amount details applied on this charge. TaxDetails *[]TaxDetails `json:"taxDetails,omitempty"` // Type Type of the charge applied. Type ChargeDetailsType `json:"type"` }
ChargeDetails Monetary and tax details of the charge.
type ChargeDetailsType ¶
type ChargeDetailsType string
ChargeDetailsType Type of the charge applied.
const ( CollectionAndRecyclingService ChargeDetailsType = "CollectionAndRecyclingService" Duty ChargeDetailsType = "Duty" EnvironmentalProtectionService ChargeDetailsType = "EnvironmentalProtectionService" Freight ChargeDetailsType = "Freight" InsuranceFee ChargeDetailsType = "InsuranceFee" InsurancePlacementCost ChargeDetailsType = "InsurancePlacementCost" Packing ChargeDetailsType = "Packing" Service ChargeDetailsType = "Service" SmallOrder ChargeDetailsType = "SmallOrder" SpecialHandlingService ChargeDetailsType = "SpecialHandlingService" TaxCollectedAtSource ChargeDetailsType = "TaxCollectedAtSource" )
Defines values for ChargeDetailsType.
type Client ¶
type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A list of callbacks for modifying requests which are generated before sending over // the network. RequestEditors []RequestEditorFn // A callback for modifying response which are generated after receive from the network. ResponseEditors []ResponseEditorFn // The user agent header identifies your application, its version number, and the platform and programming language you are using. // You must include a user agent header in each request submitted to the sales partner API. UserAgent string }
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) SubmitInvoices ¶
type ClientInterface ¶
type ClientInterface interface { // SubmitInvoicesWithBody request with any body SubmitInvoicesWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) SubmitInvoices(ctx context.Context, body SubmitInvoicesJSONRequestBody) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
func WithResponseEditorFn ¶
func WithResponseEditorFn(fn ResponseEditorFn) ClientOption
WithResponseEditorFn allows setting up a callback function, which will be called right after receive the response.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) SubmitInvoicesWithBodyWithResponse ¶
func (c *ClientWithResponses) SubmitInvoicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*SubmitInvoicesResp, error)
SubmitInvoicesWithBodyWithResponse request with arbitrary body returning *SubmitInvoicesResp
func (*ClientWithResponses) SubmitInvoicesWithResponse ¶
func (c *ClientWithResponses) SubmitInvoicesWithResponse(ctx context.Context, body SubmitInvoicesJSONRequestBody) (*SubmitInvoicesResp, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // SubmitInvoicesWithBodyWithResponse request with any body SubmitInvoicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*SubmitInvoicesResp, error) SubmitInvoicesWithResponse(ctx context.Context, body SubmitInvoicesJSONRequestBody) (*SubmitInvoicesResp, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreditNoteDetails ¶
type CreditNoteDetails struct { // ConsignorsReferenceNumber Identifies the consignor reference number (VRET number), if generated by Amazon. ConsignorsReferenceNumber *string `json:"consignorsReferenceNumber,omitempty"` // CoopReferenceNumber 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. CoopReferenceNumber *string `json:"coopReferenceNumber,omitempty"` // DebitNoteNumber Debit note number as generated by Amazon. Recommended for returns and COOP credit notes. DebitNoteNumber *string `json:"debitNoteNumber,omitempty"` // GoodsReturnDate Defines a date and time according to <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a>. GoodsReturnDate *DateTime `json:"goodsReturnDate,omitempty"` // ReferenceInvoiceNumber 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. ReferenceInvoiceNumber *string `json:"referenceInvoiceNumber,omitempty"` // ReturnsReferenceNumber Identifies the returns notice number. Mandatory for all returns credit notes. ReturnsReferenceNumber *string `json:"returnsReferenceNumber,omitempty"` // RmaId Identifies the Returned Merchandise Authorization ID, if generated. RmaId *string `json:"rmaId,omitempty"` }
CreditNoteDetails References required in order to process a credit note. This information is required only if `InvoiceType` is `CreditNote`.
type DateTime ¶
DateTime Defines a date and time according to <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a>.
type Decimal ¶
type Decimal = string
Decimal A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\d*))(\.\d+)?([eE][+-]?\d+)?$`.
type Error ¶
type Error struct { // Code An error code that identifies the type of error that occurred. Code string `json:"code"` // Details Additional details that can help the caller understand or fix the issue. Details *string `json:"details,omitempty"` // Message A message that describes the error condition. Message string `json:"message"` }
Error Error response returned when the request is unsuccessful.
type ErrorList ¶
type ErrorList = []Error
ErrorList A list of error responses returned when a request is unsuccessful.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Invoice ¶
type Invoice struct { // AdditionalDetails Additional details provided by the selling party, for tax related or other purposes. AdditionalDetails *[]AdditionalDetails `json:"additionalDetails,omitempty"` // AllowanceDetails Total allowance amount details for all line items. AllowanceDetails *[]AllowanceDetails `json:"allowanceDetails,omitempty"` // BillToParty Name, address, and tax details of a party. BillToParty *PartyIdentification `json:"billToParty,omitempty"` // ChargeDetails Total charge amount details for all line items. ChargeDetails *[]ChargeDetails `json:"chargeDetails,omitempty"` // Date Defines a date and time according to <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a>. Date DateTime `json:"date"` // Id 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. Id string `json:"id"` // InvoiceTotal An amount of money, including units in the form of currency. InvoiceTotal Money `json:"invoiceTotal"` // InvoiceType Identifies the type of invoice. InvoiceType InvoiceInvoiceType `json:"invoiceType"` // Items The list of invoice items. Items *[]InvoiceItem `json:"items,omitempty"` // PaymentTerms Terms of the payment for the invoice. The basis of the payment terms is the invoice date. PaymentTerms *PaymentTerms `json:"paymentTerms,omitempty"` // ReferenceNumber An additional unique reference number used for regulatory or other purposes. ReferenceNumber *string `json:"referenceNumber,omitempty"` // RemitToParty Name, address, and tax details of a party. RemitToParty PartyIdentification `json:"remitToParty"` // ShipFromParty Name, address, and tax details of a party. ShipFromParty *PartyIdentification `json:"shipFromParty,omitempty"` // ShipToParty Name, address, and tax details of a party. ShipToParty *PartyIdentification `json:"shipToParty,omitempty"` // TaxDetails Total tax amount details for all line items. TaxDetails *[]TaxDetails `json:"taxDetails,omitempty"` }
Invoice Represents an invoice or credit note document with details about the transaction, parties involved, and line items.
type InvoiceInvoiceType ¶
type InvoiceInvoiceType string
InvoiceInvoiceType Identifies the type of invoice.
const ( InvoiceInvoiceTypeCreditNote InvoiceInvoiceType = "CreditNote" InvoiceInvoiceTypeInvoice InvoiceInvoiceType = "Invoice" )
Defines values for InvoiceInvoiceType.
type InvoiceItem ¶
type InvoiceItem struct { // AllowanceDetails Individual allowance details per line item. AllowanceDetails *[]AllowanceDetails `json:"allowanceDetails,omitempty"` // AmazonProductIdentifier Amazon Standard Identification Number (ASIN) of an item. AmazonProductIdentifier *string `json:"amazonProductIdentifier,omitempty"` // ChargeDetails Individual charge details per line item. ChargeDetails *[]ChargeDetails `json:"chargeDetails,omitempty"` // CreditNoteDetails References required in order to process a credit note. This information is required only if `InvoiceType` is `CreditNote`. CreditNoteDetails *CreditNoteDetails `json:"creditNoteDetails,omitempty"` // HsnCode The HSN Tax code. The HSN number cannot contain alphabets. HsnCode *string `json:"hsnCode,omitempty"` // InvoicedQuantity Details of quantity. InvoicedQuantity ItemQuantity `json:"invoicedQuantity"` // ItemSequenceNumber Unique number related to this line item. ItemSequenceNumber int `json:"itemSequenceNumber"` // NetCost An amount of money, including units in the form of currency. NetCost Money `json:"netCost"` // PurchaseOrderNumber 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`. PurchaseOrderNumber *string `json:"purchaseOrderNumber,omitempty"` // TaxDetails Individual tax details per line item. TaxDetails *[]TaxDetails `json:"taxDetails,omitempty"` // VendorProductIdentifier The vendor selected product identifier of the item. Should be the same as was provided in the purchase order. VendorProductIdentifier *string `json:"vendorProductIdentifier,omitempty"` }
InvoiceItem Details of the item being invoiced.
type ItemQuantity ¶
type ItemQuantity struct { // Amount Quantity of an item. This value should not be zero. Amount int `json:"amount"` // UnitOfMeasure Unit of measure for the quantity. UnitOfMeasure ItemQuantityUnitOfMeasure `json:"unitOfMeasure"` // UnitSize The case size, if the unit of measure value is `Cases`. UnitSize *int `json:"unitSize,omitempty"` }
ItemQuantity Details of quantity.
type ItemQuantityUnitOfMeasure ¶
type ItemQuantityUnitOfMeasure string
ItemQuantityUnitOfMeasure Unit of measure for the quantity.
const ( Cases ItemQuantityUnitOfMeasure = "Cases" Eaches ItemQuantityUnitOfMeasure = "Eaches" )
Defines values for ItemQuantityUnitOfMeasure.
type Money ¶
type Money struct { // Amount A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\d*))(\.\d+)?([eE][+-]?\d+)?$`. Amount *Decimal `json:"amount,omitempty"` // CurrencyCode Three-digit currency code in ISO 4217 format. CurrencyCode *string `json:"currencyCode,omitempty"` }
Money An amount of money, including units in the form of currency.
type PartyIdentification ¶
type PartyIdentification struct { // Address A physical address. Address *Address `json:"address,omitempty"` // PartyId Assigned identification for the party. PartyId string `json:"partyId"` // TaxRegistrationDetails Tax registration details of the party. TaxRegistrationDetails *[]TaxRegistrationDetails `json:"taxRegistrationDetails,omitempty"` }
PartyIdentification Name, address, and tax details of a party.
type PaymentTerms ¶
type PaymentTerms struct { // DiscountDueDays The number of calendar days from the base date (Invoice date) until the discount is no longer valid. DiscountDueDays *float32 `json:"discountDueDays,omitempty"` // DiscountPercent A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\d*))(\.\d+)?([eE][+-]?\d+)?$`. DiscountPercent *Decimal `json:"discountPercent,omitempty"` // NetDueDays The number of calendar days from the base date (invoice date) until the total amount on the invoice is due. NetDueDays *float32 `json:"netDueDays,omitempty"` // Type The payment term type for the invoice. Type *PaymentTermsType `json:"type,omitempty"` }
PaymentTerms Terms of the payment for the invoice. The basis of the payment terms is the invoice date.
type PaymentTermsType ¶
type PaymentTermsType string
PaymentTermsType The payment term type for the invoice.
const ( Basic PaymentTermsType = "Basic" EndOfMonth PaymentTermsType = "EndOfMonth" FixedDate PaymentTermsType = "FixedDate" LetterofCredit PaymentTermsType = "LetterofCredit" PaymentDueUponReceiptOfInvoice PaymentTermsType = "PaymentDueUponReceiptOfInvoice" Proximo PaymentTermsType = "Proximo" )
Defines values for PaymentTermsType.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ResponseEditorFn ¶
ResponseEditorFn is the function signature for the ResponseEditor callback function
type SubmitInvoicesJSONRequestBody ¶
type SubmitInvoicesJSONRequestBody = SubmitInvoicesRequest
SubmitInvoicesJSONRequestBody defines body for SubmitInvoices for application/json ContentType.
type SubmitInvoicesRequest ¶
type SubmitInvoicesRequest struct { // Invoices An array of Invoice objects representing the invoices or credit notes to be submitted. Invoices *[]Invoice `json:"invoices,omitempty"` }
SubmitInvoicesRequest The request schema for the `submitInvoices` operation.
type SubmitInvoicesResp ¶
type SubmitInvoicesResp struct { Body []byte HTTPResponse *http.Response JSON202 *SubmitInvoicesResponse JSON400 *SubmitInvoicesResponse JSON403 *SubmitInvoicesResponse JSON404 *SubmitInvoicesResponse JSON413 *SubmitInvoicesResponse JSON415 *SubmitInvoicesResponse JSON429 *SubmitInvoicesResponse JSON500 *SubmitInvoicesResponse JSON503 *SubmitInvoicesResponse }
func ParseSubmitInvoicesResp ¶
func ParseSubmitInvoicesResp(rsp *http.Response) (*SubmitInvoicesResp, error)
ParseSubmitInvoicesResp parses an HTTP response from a SubmitInvoicesWithResponse call
func (SubmitInvoicesResp) Status ¶
func (r SubmitInvoicesResp) Status() string
Status returns HTTPResponse.Status
func (SubmitInvoicesResp) StatusCode ¶
func (r SubmitInvoicesResp) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SubmitInvoicesResponse ¶
type SubmitInvoicesResponse struct { // Errors A list of error responses returned when a request is unsuccessful. Errors *ErrorList `json:"errors,omitempty"` // Payload Response containing the transaction ID. Payload *TransactionId `json:"payload,omitempty"` }
SubmitInvoicesResponse The response schema for the `submitInvoices` operation.
type TaxDetails ¶
type TaxDetails struct { // TaxAmount An amount of money, including units in the form of currency. TaxAmount Money `json:"taxAmount"` // TaxRate A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\d*))(\.\d+)?([eE][+-]?\d+)?$`. TaxRate *Decimal `json:"taxRate,omitempty"` // TaxType Type of the tax applied. TaxType TaxDetailsTaxType `json:"taxType"` // TaxableAmount An amount of money, including units in the form of currency. TaxableAmount *Money `json:"taxableAmount,omitempty"` }
TaxDetails Details of tax amount applied.
type TaxDetailsTaxType ¶
type TaxDetailsTaxType string
TaxDetailsTaxType Type of the tax applied.
const ( TaxDetailsTaxTypeCESS TaxDetailsTaxType = "CESS" TaxDetailsTaxTypeCGST TaxDetailsTaxType = "CGST" TaxDetailsTaxTypeConsumption TaxDetailsTaxType = "Consumption" TaxDetailsTaxTypeDomesticVAT TaxDetailsTaxType = "DomesticVAT" TaxDetailsTaxTypeGST TaxDetailsTaxType = "GST" TaxDetailsTaxTypeIGST TaxDetailsTaxType = "IGST" TaxDetailsTaxTypeMutuallyDefined TaxDetailsTaxType = "MutuallyDefined" TaxDetailsTaxTypeMwSt TaxDetailsTaxType = "MwSt." TaxDetailsTaxTypePST TaxDetailsTaxType = "PST" TaxDetailsTaxTypeSGST TaxDetailsTaxType = "SGST" TaxDetailsTaxTypeST TaxDetailsTaxType = "ST" TaxDetailsTaxTypeTVA TaxDetailsTaxType = "TVA" TaxDetailsTaxTypeUTGST TaxDetailsTaxType = "UTGST" TaxDetailsTaxTypeVAT TaxDetailsTaxType = "VAT" )
Defines values for TaxDetailsTaxType.
type TaxRegistrationDetails ¶
type TaxRegistrationDetails struct { // TaxRegistrationNumber The tax registration number for the entity. For example, VAT ID, Consumption Tax ID. TaxRegistrationNumber string `json:"taxRegistrationNumber"` // TaxRegistrationType The tax registration type for the entity. TaxRegistrationType TaxRegistrationDetailsTaxRegistrationType `json:"taxRegistrationType"` }
TaxRegistrationDetails Tax registration details of the entity.
type TaxRegistrationDetailsTaxRegistrationType ¶
type TaxRegistrationDetailsTaxRegistrationType string
TaxRegistrationDetailsTaxRegistrationType The tax registration type for the entity.
const ( TaxRegistrationDetailsTaxRegistrationTypeGST TaxRegistrationDetailsTaxRegistrationType = "GST" TaxRegistrationDetailsTaxRegistrationTypeVAT TaxRegistrationDetailsTaxRegistrationType = "VAT" )
Defines values for TaxRegistrationDetailsTaxRegistrationType.
type TransactionId ¶
type TransactionId struct { // TransactionId GUID to identify this transaction. This value can be used with the Transaction Status API to return the status of this transaction. TransactionId *string `json:"transactionId,omitempty"` }
TransactionId Response containing the transaction ID.