Jump to content

Ben Smith

  • Posts

  • Joined

  • Last visited

  • Days Won


Ben Smith last won the day on August 6

Ben Smith had the most liked content!


20 Excellent


Personal Information

  • Job Title
    Sage Technical Enablement Manager

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi Fabio, Can you confirm which Sage product you are referring to please? Thanks Ben
  2. Hi, That makes sense then, and is something we will have to consider going forward for sure, and thanks for clarifying. We have a guide on pagination here which details the parameters provided. I would agree that using $next to reach the last page is the best option, and one I've suggested in the past. I'd be keen to see the tweak you have made, and will contact you separately about that. Ben
  3. Hi Tadej, I'll contact you via DM to get some further details. Ben
  4. Hi, Just to clarify in the client thats created by this tool - are you generating the code that handles the responses too? As in my experience its fairly common to use a tool to quickly create the classes/objects, and define the properties etc. via the swagger definition, but haven't specifically come across anyone else thats had an issue with the swagger definition not including the items and pagination metadata before. Ben
  5. Hi Mubasher, I discussed this with a colleague on a call yesterday about the use of the legacy_id (?show_legacy_id=true) which doesn't change in the reissued journal. I appreciate this will result in extra calls being made which isn't ideal. I'm investigating alternatives which I'll pass over should I find any. Ben
  6. Hi @Tadej Bukovec, this is still being investigated unfortunately, in the interim I'd suggest creating another application in the app registry to create a new set of credentials (client id, secret etc) and try that please? In testing I had to create another two before I got a working set. I'm pushing for this to be fixed and will update this thread as soon as I have more.
  7. Hi Norman, So in the payload here: payload = {'client_id': client_id, 'client_secret': client_secret, 'grant_type': 'authorization_code', 'code': accesstoken, 'redirect_uri': redirect_uri, 'code_verifier': code_verifier } You're passing the authorization code as the value of your 'accesstoken' variable? If so, what type is the accesstoken variable? Ben
  8. Hi, Thanks for your post, currently we do require the business to be a UK VAT registered in order to work correctly (as referred to in the pre-requisites), I'll make some changes to that based on your issue, to call out where to do it if you already have an existing business you want to work with. I appreciate the feedback thank you! Ben
  9. Hi Mike, Welcome to the community. Yes you are correct that in the case of Accounting the ledger_entries endpoint shows all 'nominal activity', and can be filtered by ledger_account_id. What I'd recommend is that post initial authentication, you make a call to the ledger_accounts endpoint, using the 'items_per_page=200' query param (you may also have to use pagination if there are more than 200!) to obtain a response for all ledger_accounts and their associated ids. You should cache that data at that point, and periodically ensure its updated (given that ledger accounts don't tend to be updated very often). Now that you have the cached ledger_account_id's you can pass the id for the ledger account you wish to look at the ledger_entries for example using: https://api.accounting.sage.com/v3.1/ledger_entries?ledger_account_id=be8e01824a9111e797950a12319b2edb Hope that helps! Ben
  10. Hi Norman, Welcome to the community 🙂 The Accounting API uses OAUTH 2.0 with an authorization code grant type, which requires 2 stages to obtain a valid access token. The initial step is to make an authorization request to https://www.sageone.com/oauth2/auth/central?filter=apiv3.1 You must include with this request the 'client_id', the 'response_type' of 'code' and your 'redirect_url'. It is this initial stage that prompts the user to authenticate with their Accounting credentials and authorize your app to access their business data. Once complete, they are redirected back to the specified callback URL along with an authorization code you require for the step you specified above. Obtain the authorization code from the URL, and then you can specify it as the value of 'code' in the payload you included above (where you now have an 'accesstoken' variable). This will provide you with a response, returning the access_token, refresh_token etc. We have a full guide on the steps required which can be found here: Authentication | Sage Developer I hope this helps, Ben
  11. Hi Christian, Yeah, I didn't specify the id for the invoice line as when making a PUT as I view it that you are essentially re-posting a revised version of the invoice, as if it were new, so you wouldn't know the id of the line anyway. Ideally we could use a PATCH request (which we don't have available unfortunately), where as I'm sure you are already aware, you could only include the details you want to update. I get the same issue as you when including the invoice line id, the product is not removed. So, with that in mind I'd essentially write the request body for your PUT as if it were a POST, but with the altered values. That being said, the EU customer issue looks to be a bug and after some investigation my colleague Mark has logged two tickets for investigation by the engineering API team which for your records the ticket numbers are AC-6232 and AC-6234. I don't have an ETA on when these will be looked at but will update you as soon as I can. Hope thats ok, Ben
  12. Hi Christian, Thanks for all of the detail. I've tested this myself using a UK VAT registered business using your initial sales_invoice example, and updating my contact, ledger account and product ids. { "sales_invoice": { "date": "2021-07-15", "due_date": "2021-07-20", "currency_id": "GBP", "contact_id": "85b732ca9cda4c28ac580bb2c21c01e2", "exchange_rate": 1, "invoice_lines": [ { "description": "creating invoice", "ledger_account_id": "bf15fce94a9112f797950a57719b2edb", "quantity": 1, "unit_price": 10, "tax_amount": 0, "tax_rate_id": "GB_ZERO", "product_id": "92b7697e4a9211e7979i9a57719b2edb" } ] } } The above posted as you'd expect, so I removed the product_id as you have and made a PUT request using the generated id of the sales_invoice : https://api.accounting.sage.com/v3.1/sales_invoices/1b57cc6c911045ca8c35f0d4ca5d19d2 which resulted in: "invoice_lines": [ { "id": "37e25ac4623647b2af7bc3e9d1075738", "displayed_as": "creating invoice", "description": "creating invoice", "product": null, "service": null, "ledger_account": { "id": "bf15fce94a9112f797950a57719b2edb", "displayed_as": "Sales - Products (4000)", "$path": "/ledger_accounts/bf15fce94a9112f797950a57719b2edb" }, "trade_of_asset": false, ... I've verified this in the UI, and where there was a product listed, now isn't successfully - however this is a UK Business and a UK Contact. I've discussed this with my colleague and we believe that this may be a bug thats been introduced during the EU VAT Reform changes made for 1st July 2021. We will investigate this further and let you know what we can find out. Ben
  13. Hi Barry, Thanks for providing this - as this forum is for Sage Business Cloud Accounting, and not Sage 50cloud Accounts please contact [email protected], as they handle 50cloud Accounts developer support and should be able to assist further. I will also make them aware, but it will be best for you to email them in order to get a response/support. Ben
  14. Hi Patricia, Welcome to the community! This is something we are looking into at the moment, but I can confirm there isn't an integration in place currently. If anything on that front changes I'll let you know! Ben
  15. Hi Daniel, Welcome to the community! As Sage have a large set of products, some cloud native and others cloud connected the API differs by product currently. The best place to look for the APIs we have on offer, and which products that relates to is via the developer portal, which you can access at the top of this site, from the Developer Community menu, and choose Developer Portal, or go directly to https://developer.sage.com. There you will find links to the documentation and app registries for our cloud native products. If you already know which Sage products you are interested in working with, let me know and I can point you in the right direction 😀 Ben
  • Create New...