Jump to content

Ben Smith

Administrators
  • Posts

    189
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by Ben Smith

  1. 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
  2. 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
  3. 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.
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. Mubasher's suggestion is a good one, if no X-Business header is provided, it will default to the lead business. So depending what is available it may have still worked, but could be that you are accessing a business you weren't expecting to. Ben
  14. Hi Adam, It's still something I'm looking into, we've had quite a number of legislative changes we've needed to work on recently so unfortunately this has been pushed back. I'll update this thread as soon as I have an update, or at least a definitive yes or no this is something we have and can provide. Sorry this isn't ideal. Ben
  15. Hi Tadej, Thats the correct app registry, but at this point how many applications have you registered there? If only one, could you create a completely new one, and use the new credentials in your application please? If you can let me know if that works or not? Thanks Ben
  16. Hi Mahesh, Continuing our DM, are you doing all of this via Postman? If so how have you obtained the authorization_code? Ben
  17. Morning Mark, Sorry for the delay getting back to you. There isn't anything wrong with your request, I've double checked and you aren't missing any params etc. Have you attempted, as that user in the web app to run a trial balance between those dates? I'm curious to know if you can or if it flags any issues. Ben
  18. Hi, Thanks for updating what worked for you - let us know please if you have further issues. I'm not sure about swagger_codegen for swagger 2 - but we can investigate further if it remains a problem! Ben
  19. Hi Tadej, Can you try and create a new application via our App registry, and try it again? There may be an issue with the credentials being created that I'm investigating currently. In once instance 2 out of 3 app's failed. If you could check this I'd really appreciate it. Ben
  20. Hi, Welcome to the forum! Apologies, but unfortunately at this time the product categories are not exposed via the API. Its something we are hoping to allow in the future, and I'll be sure to update the docs and announce that here when we get to it. Thanks Ben
  21. Hi Rob, When using Sage 50 Accounts I'd contact our UK developer services team directly at [email protected] and they can discuss it with you. Ben
  22. Hi Chris, We are definitely aware its a pain point - and part of the reason we decided to offer this collection. I appreciate its not as easy to get started as using a sandbox but hope it will help to make things a quicker for developers in the interim. We certainly hope to be able to offer sandboxes in the future. Ben
  23. Hi Andrea, Can you advise which of Sage's products it is that you are considering integrating with? Ben
  24. Ah Sorry Chris, It needs to be a Sage Business Cloud Accounting or Accounting Plus account, not SBC Accounting Start. I'll update the docs to make this clearer - apologies for the inconvenience - we want this to make your life easier, not harder! If you are ok to, create a new trial using this link: https://www.sage.com/en-gb/cart/try?sku=S1GBACCT, and hopefully it will work as intended. Please let me know how you get on, success or not! Ben
  25. Hi Chris, So I've re-tested the process, and its working as expected - did you make the PUT request to financial settings? As it looks as though the 405 is being caused by an incorrect financial year start date. Is the account you are using a new one, or had you already configured anything? If for some reason you opted to skip the PUT on financial settings, you should be able to run just that request, then import the rest without issue. Ben
×
×
  • Create New...