web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to create return "Credit memo" of an order using API?

(0) ShareShare
ReportReport
Posted on by 40

Hello community

I want to create a return(credit memo) of an order for the following cases using APIs
Please suggest the APIs for it.

Assume I have an order of 2 line items. (SKU : "A", "B")

Case1: I want to return or create a credit memo of only line item "A" of this order. (Partial return)

Case 2: I want to create a full return i.e all items "A", "B" together (Full return)


I started to use this API https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_salescreditmemo_create
a
nd passed the following request body, I used this request body argument which I get from this order.
pastedimage1641887284422v1.png

I am getting following issue
{"error":{"code":"Application_DialogException","message":"You may not enter numbers manually. If you want to enter numbers manually, please activate Manual Nos. in No. Series F-FAKTURA.  CorrelationId:  5120b6a7-a85a-4d0c-8dac-4c89a0f0b00f."}}


Can anyone please check this? :)

Thanks

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    Hi,

    The error message you are getting here is not really related to your use of the API but to the number series that is defined for Credit memos in Business Central. That no. series is not defined to allow for manual numbers. 

    So there is two options you can try. Either you can try to create the credit memo via the API but not giving a value to the number field. Then the number should be assigned from the defined number series.

    If that is not working you will have to go into the number series in Business Central.  Find the number series called "F-FAKTURA" and activate the field called "Manual no.s".

    And the sales credit memo works a bit different from the sales invoice when it comes to quantity. In the sales credit memo you only have one quantity field. So you give that the quantity you want to return / refund on this particular credit memo.

  • Khungersumit Profile Picture
    40 on at

    Hi Inge M. Bruvik
    Thanks for responding


    For this, Can you please tell in which field or property should we set orderNumber or OrderId so that this can be recognized that this credit memo belongs to this specific order? :)
     https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/resources/dynamics_salescreditmemo

      | Either you can try to create the credit memo via the API but not give a value to the number field.

    Or is it the invoiceNumber that we have to use for linking purpose?
    pastedimage1641893697734v1.png

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    In Business Central you normally link the credit memo not to your order but to your posted sales invoice. And for that you use the field:

    invoiceNumber. If you use that field the credit memo will be applied to the originating invoice during posting.

    If you want to link to the original sales order as well i would have used the field externalDocumentNumber.

  • Khungersumit Profile Picture
    40 on at

    Hi Inge 
    Thanks for responding


    I followed the following steps to create a credit memo of a Line item
    1) Fulfilled a line item of order (I got the Invoice Number for it from sales invoices)
    2) I used the same InvoiceNumber in the request using THIS API and I can see a credit memo created but why here line item is missing.

    I want to create a credit memo of an order's line item, do I need to call some other API after this step?

    pastedimage1641982667408v1.pngpastedimage1641982872475v2.png

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    Have you added the lines using the sales creditmemo line API ?

    docs.microsoft.com/.../dynamics_salescreditmemoline

  • Khungersumit Profile Picture
    40 on at

    Hi Inge

    Yes, it works with a separate request for credit memo line API :)

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,226

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,047 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,257 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans