Services for working with invoices ver. 1.1.7

 

Detailed information on invoice number getInvoice

Call method

GET

Input parameters

ParameterNameType(max-size)RequiredNote
VKORGSales organizationstring ( 4 )YesThe parameter setting is located in the "Service for receiving sales organizations of the client."
Example of filling VKORG=4000
KUNRGBuyerstring ( 10 )YesThe available values are returned to the "Client Structure Retrieval Service". Table RG_TAB-KUNNR
Filling example KUNRG=00000000
INVOICEInvoice numberstring ( 10 )Yes, if ZZSF = EmptyThe number of the invoice that was created for the buyer from the KUNRG parameter.
ZZSFUPD/tovchekstring ( 20 )Yes, if INVOICE = EmptyNumber of the printed invoice document. Required if INVOICE is not filled in. If both fields INVOICE and ZZSF are filled in, then the search is carried out using ZZSF
REFLAGFor return0,1,or empty string ( 1 )NoFor return
NOCOLLAPSSplit by batches0,1,or empty string ( 1 )NoSplit by batches

Description of the service response

general description of the answer

service response
ParameterNameType(max-size)RequiredNote
HEADERInvoice informationtable ( - )No
ITEMSItem tabletable ( - )No
CASHDS return type ( )NoDS return type
AUGRU_OUTPUTReturn reasons ( )NoReturn reasons

Table HEADER

ParameterNameType(max-size)RequiredNote
INVOICEInvoice numberstring ( 10 )NoThe number of the invoice that was created for the buyer from the KUNRG parameter.
INVDATEInvoice datestring ( 8 )NoDate format YYYYMMDD
Filling example INVDATE=20171005
KUNWEConsigneestring ( 10 )NoThe available values are returned to the "Client Structure Retrieval Service". Table RG_TAB->WE_TAB-KUNNR
Example of filling KUNWE=00000000
KUNZADelivery address|Pickup pointstring ( 10 )NoThe available values are returned by the "Client Structure Retrieval Service" service.
For delivery - table RG_TAB->ZA_TAB-KUNNR
For pickup - table RG_TAB->EWX_TAB-ID
Filling example KUNNR_ZA=00000000
PARNRZPContact personstring ( 10 )NoThe available values are returned to the "Client Structure Retrieval Service". Table RG_TAB->CONTACT_TAB-PARNR
Example of filling PARNR=00000000
NUMDOGAgreement numberstring ( 100 )No
UPDUPD/Tovchek numberstring ( 10 )NoUPD/Tovchek number
TORG12ТН/ТТН/Act of completed workstring ( 10 )NoТН/ТТН/Act of completed work
PAYMENTPayment typestring ( 20 )NoPayment type (cash, non-cash)
INCOTERMS_TXTDelivery typestring ( 100 )NoAccepts the following values:
Delivery to the Client
Pickup
SUMMASumstring ( 10 )No
CURRENCYCurrencystring ( 4 )No
ERDATDate and time of invoice creationstring ( 14 )NoDate format YYYYMMDDHHIISS
Filling example DLVDT=20171005120000
VSTELTName of Pickup Pointstring ( 100 )No
MAX_RET_SUMMaximum possible amount to be returnedstring ( 10 )NoMaximum possible amount to be returned

Table ITEMS

ParameterNameType(max-size)RequiredNote
POSNRInvoice item numberstring ( 8 )NoItem number in invoice
MATNRMaterialstring ( 18 )No
PINItem numberstring ( <40 )NoPIN (search string)
GTDGTDstring ( 30 )No
BRANDBrandstring ( <18 )NoBrand name
NAMENamestring ( 50 )NoDescription of the refund method
AMOUNTQuantitynumber ( 10 )No
WEIGHTWeightstring ( 10 )NoPosition weight in KG.
VOLUMVolumestring ( 10 )NoPosition volume in DM3
PRICEUnit pricestring ( 20 )NoPrice per unit Item
SUMMASumstring ( 10 )No
RETMGQuantity for which returns were issued for this itemnumber ( 10 )No
NORETAbility to issue a returnstring ( 1 )No
MINBMMinimum quantitystring ( 10 )No
RDPRFMultiplicitystring ( 10 )No
SCALIndicator that this item was purchased at a scale discountstring ( 1 )No
DREThe number of days during which this item can be returned after shipmentstring ( 10 )No
ORDEROrder numberstring ( 10 )NoNumber of the created order created by customer KUNRG.
ORDER_POSOrder itemstring ( 8 )No
ORDER_NOTEOrder commentstring ( 100 )NoComment on the order (same as in the ETP)
COUNTRYCountrystring ( 255 )NoCountry of origin
VatRateVAT ratestring ( )No
VatAmountVAT Amountstring ( )No
EanEAN codestring ( )No
TnvedHS codestring ( )No

Table CASH

ParameterNameType(max-size)RequiredNote
KEYRefund method codestring ( 1 )NoRefund method code
NAMENamestring ( 50 )NoDescription of the refund method

Table AUGRU_OUTPUT

ParameterNameType(max-size)RequiredNote
AUGRUReturn reason codestring ( 3 )NoReturn reason code
BEZEIReturn reason descriptionstring ( 40 )NoDescription of the reason for the return
TEXTReturn to default reasonstring ( 100 )NoReturn to default reason

Example call

http://ws.speautoparts.com/api/ws_invoice/getInvoice?VKORG=PARAMETER_VALUE&KUNRG=PARAMETER_VALUE&INVOICE=PARAMETER_VALUE&ZZSF=PARAMETER_VALUE&format=json

Call emulation

 

Creating a return createReturnInvoice

Description

Recommendations for using the service “Create a return createReturnInvoice”
1. A return is always created according to the “invoice” document, therefore, immediately before creating a return, it is necessary to obtain current data on the invoice for which the return is created. To do this, you need to call the service “Detailed information by invoice number getInvoice” and be sure to use the REFLAG = 1 parameter
2. In the WS response “Detailed information on the invoice number getInvoice”, before creating a return, you must check the possibility of processing it according to the following criteria:
2.1. Parameter MAX_RET_SUM on the response header (Table HEADER) The maximum possible amount for which a return can be created.
2.2. Parameter NORET in position (Table ITEMS). If NORET="X" then a refund within this period is not possible
2.3. Parameter RETMG in position (Table ITEMS). Contains the quantity that has already been returned for this item. Accordingly, the maximum amount that can be returned is calculated as AMOUNT-RETMG.

Call method

POST

Input parameters

ParameterNameType(max-size)RequiredNote
VKORGSales organizationstring ( 4 )YesValue from the service launch parameters Detailed information on the invoice number (getInvoice)
KUNRGCustomerstring ( 10 )YesBuyer number from the service launch parameters Detailed information on the invoice number (getInvoice)
VBELNFInvoice Numberstring ( 10 )YesCorresponding value from the HEADER table of the Detailed information by invoice number (getInvoice) service
AUGRUReturn Reason Codestring ( 3 )YesValue from the AUGRU_OUTPUT table of the Detailed information by invoice number (getInvoice) service
RESOLUTIONReturn reason descriptionstring ( 512 )NoIf not filled, it is filled with the value from the TEXT field from the AUGRU table of the Detailed information by invoice number (getInvoice) service
CASH_BACKRefund method codestring ( )NoThe value of the KEY field from the CASH_BACK table of the Detailed information on the invoice number (getInvoice) service. Filled out only for buyers - individuals
KUNZACustomer delivery addressstring ( 10 )NoCustomers delivery address to pick up this return from. One of the clients delivery addresses from the client structure table ZA_TAB (Service for obtaining client structure getUserInfo)
PARNRContact personstring ( 10 )NoIf there is KUNZA, then be sure to fill in the PARNR value with one of the clients contact persons from the client structure, table CONTACT_TAB (Service for obtaining the client structure getUserInfo)
POSITION_INPUTPosition tabletable ( - )Yes

Table POSITION_INPUT

ParameterNameType(max-size)RequiredNote
POSNRItem number from invoicestring ( 6 )YesItem number from the invoice that is being returned
MATNRMaterial code from invoicestring ( 18 )YesCode of the material from the invoice that is being returned
KWMENGQuantity to be returnedstring ( 20 )YesQuantity of material returned

Description of the service response

general description of the answer

service response
ParameterNameType(max-size)RequiredNote
VBELNRCreated return numberstring ( 10 )NoCreated return number

Example call

http://ws.speautoparts.com/api/ws_invoice/createReturnInvoice?format=json

Call emulation