cancel
Showing results for 
Search instead for 
Did you mean: 

Create credit memo via API for a purchase order - S4HC

jnestares
Participant
0 Kudos
636

Hi,

we are using API_SUPPLIERINVOICE_PROCESS_SRV to create supplier invoices referenced to Purchase Orders, and we were wandering if credit memos could be created via api as well. In such case, how would it be?

We are in an S4Hana Cloud environement.

KR,

Jose

View Entire Topic

Hi Jose

It is possible to create a credit memo with the API.
The key is the header field -> "SupplierInvoiceIsCreditMemo" : "1".

You can test in your system with this format

Kind regards
Brian

/sap/opu/odata/sap/API_SUPPLIERINVOICE_PROCESS_SRV/A_SupplierInvoice

{
"d" : {
"PaymentTerms" : "",
"DueCalculationBaseDate" : "2022-02-10T00:00",
"NetPaymentDays" : "0",
"FiscalYear" : "2022",
"AccountingDocumentType" : "ER",
"CompanyCode" : "1010",
"TaxDeterminationDate":"2022-02-10T00:00",
"TaxIsCalculatedAutomatically" : true,
"DocumentDate" : "2022-02-10T00:00",
"PostingDate" : "2022-02-10T00:00",
"SupplierInvoiceIDByInvcgParty" : "SAPCRTest1",
"InvoicingParty" : "10300006",
"DocumentCurrency" : "EUR",
"InvoiceGrossAmount" : "12.00",
"SupplierInvoiceIsCreditMemo" : "1",
"to_SuplrInvcItemPurOrdRef" : {
"results" : [
{
"TaxCode" : "V0",
"DocumentCurrency" : "EUR",
"SupplierInvoiceItemAmount" : "12.00",
"PurchaseOrderQuantityUnit" : "PC",
"QuantityInPurchaseOrderUnit" : "1",
"FiscalYear" : "2022",
"IsNotCashDiscountLiable" : false,
"SupplierInvoiceItem" : "1",
"PurchaseOrder" : "4500005670",
"PurchaseOrderItem" : "10"
}
]
}
}
}