Skip to main content

Notifications

Business Central forum
Suggested answer

Interaction with Payment Journals and Purchase Journals via REST API

Posted on by 11
Using rest api i need to create new lines in Payment Journal (page 256) and Purchase Journal (page 254). Screenshots of these journals are below. 
I need to create lines related to vendors. I cannot locate endpoints in standard api which let me interact with journals and lines in these journals. 
 
Will appreciate any suggestions which help me achieve my goal. 
 
 
  • Community member Profile Picture
    Community member 11 on at
    Interaction with Payment Journals and Purchase Journals via REST API
    Yes, i know that concept and I'm comfortable with that. I made couple of custom api pages already. Will do that here too. I thought that if native api does not expose these fields that means that these properties should be POSTed into db by some other endpoints (as they, for example, references). I want to integrate with BC in most seamless way as its possible
  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 58,880 Super User 2024 Season 2 on at
    Interaction with Payment Journals and Purchase Journals via REST API
    If you do not have those 3 fields on standard API then you have to copy the standard API and create a custom API with those 3 required fields.
  • Community member Profile Picture
    Community member 11 on at
    Interaction with Payment Journals and Purchase Journals via REST API
    Ok, focusing on payment journal and got some results. So, I have:
    1. used GET companies(:id)/vendorPaymentJournals to location journal i need
    2. then, trough $batch endpoint i can post lines using POST companies(:id)/vendorPaymentJournals(:id)/vendorPayments
     
     
    I can see these lines in payment journal. So far so good.
    BUT problem is that payment journal table seems to have much more columns than vendorPayment resource has properties.  
     
    Payment journal header line:
    Vendor payment resource (response from postman):
     
    I need to set some other values, for example (from the table):
    - payment method code
    - balance account type
    - balance account no
     
    I was checking vendor payment page source (https://github.com/microsoft/ALAppExtensions/blob/e4aa3dafd95b13043c3eee1f01622373a4c12068/Apps/W1/APIV2/app/src/pages/APIV2VendorPayments.Page.al#L12) and i even dont see any related fields. Also vendorPayment resource documentation page does not help here. 
     
    How i can set these 3 values ? 
     
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 71,232 Super User 2024 Season 2 on at
    Interaction with Payment Journals and Purchase Journals via REST API
    In addition, if there are no standard APIs, or the fields you need are missing from the standard API, as of now, you can only customize a new API page.
    More details: Dynamics 365 Business Central: Can we extend standard APIs? – Download Standard Source Code for APIs
     
    Hope this helps as well.
    Thanks.
    ZHU
  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 58,880 Super User 2024 Season 2 on at
    Interaction with Payment Journals and Purchase Journals via REST API
  • Community member Profile Picture
    Community member 11 on at
    Interaction with Payment Journals and Purchase Journals via REST API
    @gdrenteria, im using journalLines endpoint already for different purpose and as far as i know its only for creating rows in general journal (page 39). moreover - journalLines endpoint need to be called trough journals namespace (journals(:journal_id)/journalLines) which is defining in which journal we want to create line. SO i called just GET /journals and in  only batches from general journal are appearing, cannot find any of these 2 journals mentioned in topic
  • Suggested answer
    gdrenteria Profile Picture
    gdrenteria 10,415 Most Valuable Professional on at

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

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans