/**
 * Selling Partner API for Retail Procurement Payments
 * The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data.
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */ import { Configuration } from './configuration' ; import globalAxios , { AxiosPromise , AxiosInstance } from 'axios' ; import { DUMMY_BASE_URL , assertParamExists , setApiKeyToObject , setBasicAuthToObject , setBearerAuthToObject , setOAuthToObject , setSearchParams , serializeDataIfNeeded , toPathString , createRequestFunction } from './common' ; import { BASE_PATH , COLLECTION_FORMATS , RequestArgs , BaseAPI , RequiredError } from './base' ; export interface export interface AdditionalDetails { type { string } memberof type : AdditionalDetailsTypeEnum | 'SUR' | 'OCR' | 'CartonCount' ; type { string } memberof detail : string ; type { string } memberof languageCode ? : string ; } export enum { string } export enum AdditionalDetailsTypeEnum { Sur = 'SUR' , Ocr = 'OCR' , CartonCount = 'CartonCount' } export interface export interface Address { type { string } memberof name : string ; type { string } memberof addressLine1 : string ; type { string } memberof addressLine2 ? : string ; type { string } memberof addressLine3 ? : string ; type { string } memberof city ? : string ; type { string } memberof county ? : string ; type { string } memberof district ? : string ; type { string } memberof stateOrRegion ? : string ; type { string } memberof postalOrZipCode ? : string ; type { string } memberof countryCode : string ; type { string } memberof phone ? : string ; } export interface export interface AllowanceDetails { type { string } memberof type : AllowanceDetailsTypeEnum | 'Discount' | 'DiscountIncentive' | 'Defective' | 'Promotional' | 'UnsaleableMerchandise' | 'Special' ; type { string } memberof description ? : string ; type { Money } memberof allowanceAmount : Money ; type { Array < TaxDetails > } memberof taxDetails ? : Array < TaxDetails > ; } export enum { string } export enum AllowanceDetailsTypeEnum { Discount = 'Discount' , DiscountIncentive = 'DiscountIncentive' , Defective = 'Defective' , Promotional = 'Promotional' , UnsaleableMerchandise = 'UnsaleableMerchandise' , Special = 'Special' } export interface export interface ChargeDetails { type { string } memberof type : ChargeDetailsTypeEnum | 'Freight' | 'Packing' | 'Duty' | 'Service' | 'SmallOrder' | 'InsurancePlacementCost' | 'InsuranceFee' | 'SpecialHandlingService' | 'CollectionAndRecyclingService' | 'EnvironmentalProtectionService' | 'TaxCollectedAtSource' ; type { string } memberof description ? : string ; type { Money } memberof chargeAmount : Money ; type { Array < TaxDetails > } memberof taxDetails ? : Array < TaxDetails > ; } export enum { string } export enum ChargeDetailsTypeEnum { Freight = 'Freight' , Packing = 'Packing' , Duty = 'Duty' , Service = 'Service' , SmallOrder = 'SmallOrder' , InsurancePlacementCost = 'InsurancePlacementCost' , InsuranceFee = 'InsuranceFee' , SpecialHandlingService = 'SpecialHandlingService' , CollectionAndRecyclingService = 'CollectionAndRecyclingService' , EnvironmentalProtectionService = 'EnvironmentalProtectionService' , TaxCollectedAtSource = 'TaxCollectedAtSource' } export interface export interface CreditNoteDetails { type { string } memberof referenceInvoiceNumber ? : string ; type { string } memberof debitNoteNumber ? : string ; type { string } memberof returnsReferenceNumber ? : string ; type { string } memberof goodsReturnDate ? : string ; type { string } memberof rmaId ? : string ; type { string } memberof coopReferenceNumber ? : string ; type { string } memberof consignorsReferenceNumber ? : string ; } export interface export interface Invoice { type { string } memberof invoiceType : InvoiceInvoiceTypeEnum | 'Invoice' | 'CreditNote' ; type { string } memberof id : string ; type { string } memberof referenceNumber ? : string ; type { string } memberof date : string ; type { PartyIdentification } memberof remitToParty : PartyIdentification ; type { PartyIdentification } memberof shipToParty ? : PartyIdentification ; type { PartyIdentification } memberof shipFromParty ? : PartyIdentification ; type { PartyIdentification } memberof billToParty ? : PartyIdentification ; type { PaymentTerms } memberof paymentTerms ? : PaymentTerms ; type { Money } memberof invoiceTotal : Money ; type { Array < TaxDetails > } memberof taxDetails ? : Array < TaxDetails > ; type { Array < AdditionalDetails > } memberof additionalDetails ? : Array < AdditionalDetails > ; type { Array < ChargeDetails > } memberof chargeDetails ? : Array < ChargeDetails > ; type { Array < AllowanceDetails > } memberof allowanceDetails ? : Array < AllowanceDetails > ; type { Array < InvoiceItem > } memberof items ? : Array < InvoiceItem > ; } export enum { string } export enum InvoiceInvoiceTypeEnum { Invoice = 'Invoice' , CreditNote = 'CreditNote' } export interface export interface InvoiceItem { type { number } memberof itemSequenceNumber : number ; type { string } memberof amazonProductIdentifier ? : string ; type { string } memberof vendorProductIdentifier ? : string ; type { ItemQuantity } memberof invoicedQuantity : ItemQuantity ; type { Money } memberof netCost : Money ; type { string } memberof purchaseOrderNumber ? : string ; type { string } memberof hsnCode ? : string ; type { CreditNoteDetails } memberof creditNoteDetails ? : CreditNoteDetails ; type { Array < TaxDetails > } memberof taxDetails ? : Array < TaxDetails > ; type { Array < ChargeDetails > } memberof chargeDetails ? : Array < ChargeDetails > ; type { Array < AllowanceDetails > } memberof allowanceDetails ? : Array < AllowanceDetails > ; } export interface export interface ItemQuantity { type { number } memberof amount : number ; type { string } memberof unitOfMeasure : ItemQuantityUnitOfMeasureEnum | 'Cases' | 'Eaches' ; type { number } memberof unitSize ? : number ; } export enum { string } export enum ItemQuantityUnitOfMeasureEnum { Cases = 'Cases' , Eaches = 'Eaches' } export interface export interface ModelError { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof details ? : string ; } export interface export interface Money { type { string } memberof currencyCode ? : string ; type { string } memberof amount ? : string ; } export interface export interface PartyIdentification { type { string } memberof partyId : string ; type { Address } memberof address ? : Address ; type { Array < TaxRegistrationDetails > } memberof taxRegistrationDetails ? : Array < TaxRegistrationDetails > ; } export interface export interface PaymentTerms { type { string } memberof type ? : PaymentTermsTypeEnum | 'Basic' | 'EndOfMonth' | 'FixedDate' | 'Proximo' | 'PaymentDueUponReceiptOfInvoice' | 'LetterofCredit' ; type { string } memberof discountPercent ? : string ; type { number } memberof discountDueDays ? : number ; type { number } memberof netDueDays ? : number ; } export enum { string } export enum PaymentTermsTypeEnum { Basic = 'Basic' , EndOfMonth = 'EndOfMonth' , FixedDate = 'FixedDate' , Proximo = 'Proximo' , PaymentDueUponReceiptOfInvoice = 'PaymentDueUponReceiptOfInvoice' , LetterofCredit = 'LetterofCredit' } export interface export interface SubmitInvoicesRequest { type { Array < Invoice > } memberof invoices ? : Array < Invoice > ; } export interface export interface SubmitInvoicesResponse { type { TransactionId } memberof payload ? : TransactionId ; type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface TaxDetails { type { string } memberof taxType : TaxDetailsTaxTypeEnum | 'CGST' | 'SGST' | 'CESS' | 'UTGST' | 'IGST' | 'MwSt.' | 'PST' | 'TVA' | 'VAT' | 'GST' | 'ST' | 'Consumption' | 'MutuallyDefined' | 'DomesticVAT' ; type { string } memberof taxRate ? : string ; type { Money } memberof taxAmount : Money ; type { Money } memberof taxableAmount ? : Money ; } export enum { string } export enum TaxDetailsTaxTypeEnum { Cgst = 'CGST' , Sgst = 'SGST' , Cess = 'CESS' , Utgst = 'UTGST' , Igst = 'IGST' , MwSt = 'MwSt.' , Pst = 'PST' , Tva = 'TVA' , Vat = 'VAT' , Gst = 'GST' , St = 'ST' , Consumption = 'Consumption' , MutuallyDefined = 'MutuallyDefined' , DomesticVat = 'DomesticVAT' } export interface export interface TaxRegistrationDetails { type { string } memberof taxRegistrationType : TaxRegistrationDetailsTaxRegistrationTypeEnum | 'VAT' | 'GST' ; type { string } memberof taxRegistrationNumber : string ; } export enum { string } export enum TaxRegistrationDetailsTaxRegistrationTypeEnum { Vat = 'VAT' , Gst = 'GST' } export interface export interface TransactionId { type { string } memberof transactionId ? : string ; } export export const VendorPaymentsApiAxiosParamCreator = function ( configuration ? ) { return { param { SubmitInvoicesRequest } body param { * } options throws submitInvoices : async ( body , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'submitInvoices' , 'body' , body ) ; const localVarPath = `/vendor/payments/v1/invoices` ; const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ; let baseOptions ; if ( configuration ) { baseOptions = configuration . baseOptions ; } const localVarRequestOptions = { method : 'POST' , ... baseOptions , ... options } ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; localVarHeaderParameter [ 'Content-Type' ] = 'application/json' ; setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ; let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ; localVarRequestOptions . headers = { ... localVarHeaderParameter , ... headersFromBaseOptions , ... options . headers } ; localVarRequestOptions . data = serializeDataIfNeeded ( body , localVarRequestOptions , configuration ) ; return { url : toPathString ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , } ; } ; export export const VendorPaymentsApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = VendorPaymentsApiAxiosParamCreator ( configuration ) ; return { param { SubmitInvoicesRequest } body param { * } options throws async submitInvoices ( body , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . submitInvoices ( body , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const VendorPaymentsApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = VendorPaymentsApiFp ( configuration ) ; return { param { SubmitInvoicesRequest } body param { * } options throws submitInvoices ( body , options ? ) { return localVarFp . submitInvoices ( body , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface VendorPaymentsApiSubmitInvoicesRequest { type { SubmitInvoicesRequest } memberof readonly body : SubmitInvoicesRequest ; } export class extends BaseAPI export class VendorPaymentsApi extends BaseAPI { param { VendorPaymentsApiSubmitInvoicesRequest } requestParameters param { * } options throws memberof public submitInvoices ( requestParameters , options ? ) { return VendorPaymentsApiFp ( this . configuration ) . submitInvoices ( requestParameters . body , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }