Jump to content

Steel, Mark

Moderators
  • Posts

    480
  • Joined

  • Last visited

  • Days Won

    35

Everything posted by Steel, Mark

  1. Hi James Unfortunately you can't use the Sage Business Cloud Accounting API to integrate with Sage 200. There is a Sage 200 API available which is supported by our colleagues at [email protected]. Regards Mark
  2. Thanks for clarifying. Are you sure they are using Sage Business Cloud Accounting? Serial Numbers and Activation Keys are generally associated with Sage 50c which is a desktop product. You'll need to ask them to send you an invite. The invite needs to go to your sage ID email address. The invite is sent via settings > User management. They will need to have system administrator privileges to send the invite. Once you've accepted the invite and associated your Sage ID with the business, you'll then be able to authenticate. Regards Mark
  3. Thanks James How did they provide you access to the business? If you go to https://app.sageone.com are you able to sign into the business via the web UI with the credentials they provided? Regards Mark
  4. Hi James, thank you for your question. Who's business are you trying to authenticate with, is it the business of your client or a trial business you have created? Regards Mark
  5. Thanks for letting me know Craig. I've sent a PM to arrange a suitable time to troubleshoot your issue. We'll need to look at the client ID and secret which is best not shared here. I look forward to hearing from you. Thanks Mark
  6. Hi Zakari, thank you for your question. At present this community is built around the Sage Business Cloud Accounting product. For Sage 100c support, you'll need to contact our support team via the [email protected] email address. Regards Mark
  7. Hi Craig, thank you for your question. When registering your application, what callback url did you use? If you're using POSTMAN you'll need to register the POSTMAN callback URL in addition to any callback url registered for your own app. From your description, it would seem that the Auth code is not being returned to the callback url meaning the POST to exchange the auth code for an access token cannot be made successfully. POSTMAN app = https://www.postman.com/oauth2/callback POSTMAN web UI = https://oauth.pstmn.io/v1/browser-callback Thanks Mark
  8. Hi Norman, thanks for your question. For efficiency, the GET Request you are making returns only the three values you are seeing as default. You can specify additional attributes as a query parameter or you can return all of the product attributes by specifying the product_id in the request url or by setting the attributes query param value to all. Here's an example request snippet that will return the item_code in addition to the defaults. products?attributes=item_code Thanks Mark
  9. @Norman Firkins The API requires & rather than + when you're using multiple query params and no separator(comma) is required. sales_invoices?search=SI-56&status_id=PAID Thanks Mark
  10. @Norman Firkins The transaction_types endpoint returns all available transaction types including the id. { "$total": 41, "$page": 1, "$next": "/transaction_types?page=2&items_per_page=20", "$back": null, "$itemsPerPage": 20, "$items": [ { "id": "BANK_OPENING_BALANCE", "displayed_as": "Bank Opening Balance", "$path": "/transaction_types/BANK_OPENING_BALANCE" }, { "id": "BANK_PAYMENT", "displayed_as": "Bank Payment", "$path": "/transaction_types/BANK_PAYMENT" }, { "id": "BANK_RECEIPT", "displayed_as": "Bank Receipt", "$path": "/transaction_types/BANK_RECEIPT" }, { "id": "BANK_TRANSFER", "displayed_as": "Bank Transfer", "$path": "/transaction_types/BANK_TRANSFER" }, { "id": "CORRECTION", "displayed_as": "Correction", "$path": "/transaction_types/CORRECTION" }, { "id": "CUSTOMER_ALLOCATION", "displayed_as": "Customer Allocation", "$path": "/transaction_types/CUSTOMER_ALLOCATION" }, { "id": "CUSTOMER_RECEIPT", "displayed_as": "Customer Receipt", "$path": "/transaction_types/CUSTOMER_RECEIPT" }, { "id": "CUSTOMER_REFUND", "displayed_as": "Customer Refund", "$path": "/transaction_types/CUSTOMER_REFUND" }, { "id": "DEPOSIT", "displayed_as": "Deposit", "$path": "/transaction_types/DEPOSIT" }, { "id": "JOURNAL", "displayed_as": "Journal", "$path": "/transaction_types/JOURNAL" }, { "id": "GENERAL_LEDGER_OPENING_BALANCE", "displayed_as": "Journal Opening Balance", "$path": "/transaction_types/GENERAL_LEDGER_OPENING_BALANCE" }, { "id": "OTHER_RECEIPT", "displayed_as": "Other Receipt", "$path": "/transaction_types/OTHER_RECEIPT" }, { "id": "OTHER_PAYMENT", "displayed_as": "Other Payment", "$path": "/transaction_types/OTHER_PAYMENT" }, { "id": "PURCHASE_QUICK_ENTRY_CREDIT_NOTE", "displayed_as": "Purchase QE Credit", "$path": "/transaction_types/PURCHASE_QUICK_ENTRY_CREDIT_NOTE" }, { "id": "PURCHASE_QUICK_ENTRY_INVOICE", "displayed_as": "Purchase QE Invoice", "$path": "/transaction_types/PURCHASE_QUICK_ENTRY_INVOICE" }, { "id": "PURCHASE_INVOICE", "displayed_as": "Purchase Invoice", "$path": "/transaction_types/PURCHASE_INVOICE" }, { "id": "PURCHASE_CREDIT_NOTE", "displayed_as": "Purchase Credit Note", "$path": "/transaction_types/PURCHASE_CREDIT_NOTE" }, { "id": "SALES_QUICK_ENTRY_CREDIT_NOTE", "displayed_as": "Sales QE Credit", "$path": "/transaction_types/SALES_QUICK_ENTRY_CREDIT_NOTE" }, { "id": "SALES_QUICK_ENTRY_INVOICE", "displayed_as": "Sales QE Invoice", "$path": "/transaction_types/SALES_QUICK_ENTRY_INVOICE" }, { "id": "SALES_CREDIT_NOTE", "displayed_as": "Sales Credit Note", "$path": "/transaction_types/SALES_CREDIT_NOTE" } ] } Thanks Mark
  11. @Norman Firkins Yes that's correct, you would need to create a payment or credit_note and allocate it to the sales_invoice. On successful allocation the payment status will be displayed as paid or part paid depending on the value of the payment or credit. Thanks Mark
  12. Hi Norman, thank you for your question. The status_id of artefacts is read only and cannot and should not be set directly. They are given their various statuses based on dates, such as date and due_date and payment/credit allocations. If you're creating an invoice with both a date and due_date of today, the invoice will be automatically given the status of overdue as it is expecting payment that same day. There are a couple of guides available that will help you further with this. Artefact Statuses, Payments & Receipts Thanks Mark
  13. Thanks Norman Refresh tokens are valid for 31 days or until a new refresh token is requested. If you had a scenario where many requests were made consecutively you would be requesting a new access_token for each of those requests. How do you ensure you wait for the new access_token and refresh_token to be returned and the holding variable set before making the next request? It sounds as if you're trying to exchange an already super-seeded refresh_token which is being seen as invalid. There's Java Script in the Demo Data Postman collection, that uses a timer to understand when the current access_token is due to expire and then exchanges the refresh_token before it expires and makes the next request. I've included the script below FYI. // Global variables const moment = require ('moment'); var time = moment(); if (pm.environment.get("accessTokenExpires")< time.format()) { pm.sendRequest({ url: 'https://oauth.accounting.sage.com/token', method: 'POST', header: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', }, body: { mode: 'urlencoded', urlencoded: [ {key: "client_id", value: pm.environment.get('clientId'), disabled: false}, {key: "client_secret", value: pm.environment.get('clientSecret'), disabled: false}, {key: "grant_type", value: "refresh_token", disabled: false}, {key: "refresh_token", value: pm.environment.get('refreshToken'), disabled: false} ] } }, function (error, response) { if(error===null){ pm.environment.set("accessToken", response.json().access_token); //set the Access token expiry time as the response time + 5 mins var tokenExpires = new Date; tokenExpires = time.add(5, 'minutes').format(); pm.environment.set("accessTokenExpires", tokenExpires); pm.environment.set("refreshToken", response.json().refresh_token); } })
  14. Hi Norman, thank you for your question. We're not aware of any issue with the exchange of refresh_tokens at present. How are you storing the access and refresh tokens? Do you set a timer for the access_token period or are you exchanging refresh_tokens for every request? Making a comparison of your code to code I use to exchange refresh tokens, I noticed that I am also setting the below in the request header. 'Accept': 'application/json' Thanks Mark
  15. Hi Faycal, thank you for your question. Sage Compta et Facturation is the French version of Sage Cloud Accounting and is compliant with API v3.1. The auth process is the same for this version as that mentioned in this thread previously. Please let us know if you require any further support. Thanks Mark
  16. Hi Jez, thank you for your question. Joiin support is not something we are able to offer you and needs to be directed to the joiin support team. I wasn't aware of joiin offering an integration for Sage 50c businesses. The joiin application available on our marketplace targets Sage Business Cloud Accounting which is why it will not be able to recognise your Sage 50c business. Thanks Mark
  17. Hi Abraham If what you have provided above is the PUT request for the sales_invoice it will fail. It looks as if you're using the response from a GET request to then change the value and pass it in to a PUT request. This will not work, the attribute names need to be passed in snake case (tax_rate_id) and not CamelCase (EuGoodsServicesTypeId) as they are seen above. You are also including a lot of un-required values, for example you are passing the sales invoice Id as Id, this is already set in the header of the request. Ideally you should be setting the minimum number of attribute values to make the PUT possible. You can find an example of a sales_invoice PUT request here. Once you've corrected the request please let us know if you are still seeing the response. Regards Mark
  18. Thanks for the information. The problem is with the setting of the tax_rate_id. You are trying to set an attribute that doesn't exist ("TaxRateId": "GB_ZERO",) should be "tax_rate_id": "GB_ZERO". Thanks Mark
  19. Hi Abraham, thank you for your question. I've attempted to replicate your issue but cannot invoke the response you are seeing. You did not state where the business is located so I have defaulted to a UK VAT registered business as in your last post. I changed the contact on a sales invoice from an EU VAT registered contact to a rest of world contact without issue. The JSON you provided does not set a new contact_id, do you have the full request please? Understanding the locations and VAT treatment of the current and new contact would also be helpful. { "sales_invoice":{ "contact_id": "bb6929c332e144529d76a15611d5f8ea", "exchange_rate":1, "invoice_lines": [ { "description": "Test Item Line", "quantity": "1.0", "unit_price": "100.0", "net_amount": "100.0", "tax_rate_id": "GB_ZERO", "tax_amount": "0.0", "ledger_account_id": "2c8ec978b3bb11ebb35d02665419b6eb", "eu_goods_services_type_id": "SERVICES" } ] } } Thanks Mark
  20. Hi Abe, thanks for the info. From the values in the PUT request it appears that you are not setting the goods/service indicator at all. You need to set it as in the below. { "sales_invoice":{ "invoice_lines": [ { "description": "Test Item Line", "quantity": "1.0", "unit_price": "100.0", "net_amount": "100.0", "tax_rate_id": "GB_ZERO", "tax_amount": "0.0", "ledger_account_id": "2c8ec978b3bb11ebb35d02665419b6eb", "eu_goods_services_type_id": "SERVICES" } ] } } Thanks Mark
  21. Hi Abe, thank you for your question. Could you confirm the following points please: The business sending the sales invoice is based in the UK The business sending the sales invoice is registered for VAT The delivery address of the contact on the sales invoice. If the contact is registered for VAT The invoice date If at all possible, could you send us the full JSON response for a GET request to the sales_invoice/id in question and the PUT request your are making for the update please. Thanks Mark
  22. Hi Adam Apologies, you are correct. If the address exists for the contact it will hydrate the sales_invoice address values. The response you are seeing occurs when an address isn't present for the contact and the business rules stipulate an address must be present for the transaction. Thanks Mark
  23. HI Reg Thanks for bringing this to our attention. The trial balance endpoint has been available for some time and is used widely by 3rd party integrators. The problem lies in not understanding how those integrations work around this issue. If we were to make a change and show the proceeding zeros for the ledger accounts this could cause a breaking change for others. Are you caching the ledger accounts outside of Sage Business Cloud Accounting? If so, the trial balance returns the ledger_account_id which could be used to obtain the ledger_account number from the cached data. Alternatively, you could pad out the number with zeros so 51 would be padded out to 0051. We'll update our documentation to ensure this is highlighted. Thanks Mark
  24. Hi Adam, thank you for your question. We're working on improving the documentation around error handling at present and hope to be able to share this with you in the near future. At present, https://developer.sage.com/internal/accounting/guides/concepts/response_codes/ is the only reference to response errors that we currently have available. When you say "I don't have access to the accounts" are you developing on a trial account rather than live? 1) You're correct the ledger account passed is not valid for the sale. This error could occur for any transaction where a ledger account is specified. For example, you could create a bank receipt and choose an expense ledger account or a bank payment for an income ledger account. 2) There are many rules relating to the use of contacts and addresses which differ from region to region, the type of sale being made(home, EU, Rest of world) or if the business is registered for VAT and the type of scheme they are registered for . For UK businesses, the use of an address is mandatory if you're a UK VAT registered business selling to another VAT registered business. Specifying the contact_id is not sufficient to hydrate the address fields for sales/purchase artefacts, the address needs to be passed in the request when posting Sales artefacts. For UK businesses, sales_invoices and sales_credit_notes are the only requests that can potentially result with the error you are seeing. Thanks Mark
  25. Hi Christian, thank you for your question. For clarity, when you state "all the accounts receivables" do you mean all of the transactions that make up the balance of the debtor control account at a given date? To return the balance of a ledger account you can use the following endpoint and query parameters with your own values: ledger_accounts/id of trade_debtors account?show_balance_details=true&from_date=2021-01-01&to_date=2021-06-21 Alternatively, if you need all unpaid transactions that constitute the debtor balance, you would need to return all unpaid and part_paid sales transactions from their individual endpoints using two requests: sales_invoices?status_id=part_paid sales_invoices?status_id=unpaid sales_credit_notes?status_id=part_paid sales_credit_notes?status_id=unpaid sales_quick_entries?status_id=part_paid (quick_entry_type_id=invoice) sales_quick_entries?status_id=unpaid (quick_entry_type_id=invoice) sales_quick_entries?status_id=part_paid (quick_entry_type_id=credit_note) sales_quick_entries?status_id=unpaid (quick_entry_type_id=credit_note) Thanks Mark
×
×
  • Create New...