/**
 * Selling Partner API for Direct Fulfillment Payments
 * The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor\'s invoice 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' ; type { string } memberof detail : string ; type { string } memberof languageCode ? : string ; } export enum { string } export enum AdditionalDetailsTypeEnum { Sur = 'SUR' , Ocr = 'OCR' } 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 postalCode : string ; type { string } memberof countryCode : string ; type { string } memberof phone ? : string ; } export interface export interface ChargeDetails { type { string } memberof type : ChargeDetailsTypeEnum | 'GIFTWRAP' | 'FULFILLMENT' | 'MARKETINGINSERT' | 'PACKAGING' | 'LOADING' | 'FREIGHTOUT' | 'TAX_COLLECTED_AT_SOURCE' ; type { Money } memberof chargeAmount : Money ; type { Array < TaxDetail > } memberof taxDetails ? : Array < TaxDetail > ; } export enum { string } export enum ChargeDetailsTypeEnum { Giftwrap = 'GIFTWRAP' , Fulfillment = 'FULFILLMENT' , Marketinginsert = 'MARKETINGINSERT' , Packaging = 'PACKAGING' , Loading = 'LOADING' , Freightout = 'FREIGHTOUT' , TaxCollectedAtSource = 'TAX_COLLECTED_AT_SOURCE' } export interface export interface InvoiceDetail { type { string } memberof invoiceNumber : string ; type { string } memberof invoiceDate : string ; type { string } memberof referenceNumber ? : string ; type { PartyIdentification } memberof remitToParty : PartyIdentification ; type { PartyIdentification } memberof shipFromParty : PartyIdentification ; type { PartyIdentification } memberof billToParty ? : PartyIdentification ; type { string } memberof shipToCountryCode ? : string ; type { string } memberof paymentTermsCode ? : string ; type { Money } memberof invoiceTotal : Money ; type { Array < TaxDetail > } memberof taxTotals ? : Array < TaxDetail > ; type { Array < AdditionalDetails > } memberof additionalDetails ? : Array < AdditionalDetails > ; type { Array < ChargeDetails > } memberof chargeDetails ? : Array < ChargeDetails > ; type { Array < InvoiceItem > } memberof items : Array < InvoiceItem > ; } export interface export interface InvoiceItem { type { string } memberof itemSequenceNumber : string ; type { string } memberof buyerProductIdentifier ? : string ; type { string } memberof vendorProductIdentifier ? : string ; type { ItemQuantity } memberof invoicedQuantity : ItemQuantity ; type { Money } memberof netCost : Money ; type { string } memberof purchaseOrderNumber : string ; type { string } memberof vendorOrderNumber ? : string ; type { string } memberof hsnCode ? : string ; type { Array < TaxDetail > } memberof taxDetails ? : Array < TaxDetail > ; type { Array < ChargeDetails > } memberof chargeDetails ? : Array < ChargeDetails > ; } export interface export interface ItemQuantity { type { number } memberof amount : number ; type { string } memberof unitOfMeasure : string ; } 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 < TaxRegistrationDetail > } memberof taxRegistrationDetails ? : Array < TaxRegistrationDetail > ; } export interface export interface SubmitInvoiceRequest { type { Array < InvoiceDetail > } memberof invoices ? : Array < InvoiceDetail > ; } export interface export interface SubmitInvoiceResponse { type { TransactionReference } memberof payload ? : TransactionReference ; type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface TaxDetail { type { string } memberof taxType : TaxDetailTaxTypeEnum | '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 TaxDetailTaxTypeEnum { 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 TaxRegistrationDetail { type { string } memberof taxRegistrationType ? : TaxRegistrationDetailTaxRegistrationTypeEnum | 'VAT' | 'GST' ; type { string } memberof taxRegistrationNumber : string ; type { Address } memberof taxRegistrationAddress ? : Address ; type { string } memberof taxRegistrationMessage ? : string ; } export enum { string } export enum TaxRegistrationDetailTaxRegistrationTypeEnum { Vat = 'VAT' , Gst = 'GST' } export interface export interface TransactionReference { type { string } memberof transactionId ? : string ; } export export const VendorInvoiceApiAxiosParamCreator = function ( configuration ? ) { return { param { SubmitInvoiceRequest } body param { * } options throws submitInvoice : async ( body , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'submitInvoice' , 'body' , body ) ; const localVarPath = `/vendor/directFulfillment/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 VendorInvoiceApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = VendorInvoiceApiAxiosParamCreator ( configuration ) ; return { param { SubmitInvoiceRequest } body param { * } options throws async submitInvoice ( body , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . submitInvoice ( body , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const VendorInvoiceApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = VendorInvoiceApiFp ( configuration ) ; return { param { SubmitInvoiceRequest } body param { * } options throws submitInvoice ( body , options ? ) { return localVarFp . submitInvoice ( body , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface VendorInvoiceApiSubmitInvoiceRequest { type { SubmitInvoiceRequest } memberof readonly body : SubmitInvoiceRequest ; } export class extends BaseAPI export class VendorInvoiceApi extends BaseAPI { param { VendorInvoiceApiSubmitInvoiceRequest } requestParameters param { * } options throws memberof public submitInvoice ( requestParameters , options ? ) { return VendorInvoiceApiFp ( this . configuration ) . submitInvoice ( requestParameters . body , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }