Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

Which fields are required when creating new records from API?

Posted on by 5

Right now, I am accessing Dynamics BC through API.

Can someone help me to point out which fields are mandatory when creating particular resource object.

1. journalLines

2. vendorPayments

3. purchaseInvoices

4. purchaseInvoiceLines

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 70,124 Super User 2024 Season 2 on at
    RE: Which fields are required when creating new records from API?

    Hi, Except for the primary key, others are generally not required at the time of creation.
    I think you can try to enter it on the screen, and then get the data from the API, which should be the answer you need.

    For example, purchaseInvoices

    pastedimage1657239618622v1.png

    pastedimage1657239633559v2.png

    {
        "@odata.context": "https://api.businesscentral.dynamics.com/v2.0/d8f36038-1f93-4543-affc-5dc92b6ee871/Sandbox202/api/v2.0/$metadata#companies(5b2a06ae-16e2-ec11-bb44-000d3a3882ad)/purchaseInvoices",
        "value": [
            {
                "@odata.etag": "W/\"JzIwOzE3MjMwOTI3MDY4OTE1OTM4OTMzMTswMDsn\"",
                "id": "ad27a6f9-08ea-ec11-82f8-002248e884d1",
                "number": "107211",
                "invoiceDate": "2022-05-01",
                "postingDate": "2022-05-01",
                "dueDate": "2022-05-31",
                "vendorInvoiceNumber": "107211",
                "vendorId": "8318b5cf-08ea-ec11-82f8-002248e884d1",
                "vendorNumber": "30000",
                "vendorName": "Graphic Design Institute",
                "payToName": "Graphic Design Institute",
                "payToContact": "Bryce Jasso",
                "payToVendorId": "8318b5cf-08ea-ec11-82f8-002248e884d1",
                "payToVendorNumber": "30000",
                "shipToName": "",
                "shipToContact": "",
                "buyFromAddressLine1": "Arbachtalstrasse 6",
                "buyFromAddressLine2": "Unter Achalm",
                "buyFromCity": "Eningen",
                "buyFromCountry": "DE",
                "buyFromState": "",
                "buyFromPostCode": "DE-72800",
                "shipToAddressLine1": "5 The Ring",
                "shipToAddressLine2": "Westminster",
                "shipToCity": "London",
                "shipToCountry": "GB",
                "shipToState": "",
                "shipToPostCode": "W2 8HG",
                "payToAddressLine1": "Arbachtalstrasse 6",
                "payToAddressLine2": "Unter Achalm",
                "payToCity": "Eningen",
                "payToCountry": "DE",
                "payToState": "",
                "payToPostCode": "DE-72800",
                "shortcutDimension1Code": "",
                "shortcutDimension2Code": "",
                "currencyId": "00000000-0000-0000-0000-000000000000",
                "currencyCode": "GBP",
                "orderId": "00000000-0000-0000-0000-000000000000",
                "orderNumber": "",
                "pricesIncludeTax": false,
                "discountAmount": 0,
                "discountAppliedBeforeTax": true,
                "totalAmountExcludingTax": 2759.8,
                "totalTaxAmount": 0,
                "totalAmountIncludingTax": 2759.8,
                "status": "Draft",
                "lastModifiedDateTime": "2022-07-08T00:19:01.97Z"
            }
        ]
    }

    Hope this can give you some hints.

    Thanks.

    ZHU

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans