Jump to content

Steel, Mark

Moderators
  • Posts

    480
  • Joined

  • Last visited

  • Days Won

    35

Posts posted by Steel, Mark

  1. Hi Jaedan,

    I can't see where you are setting the grant_type to refresh_token in the code you've provided. I've included JS used in our POSTMAN collections to exchange the refresh_token for your information.

    Our authentication guide is also a good reference. https://developer.sage.com/accounting/guides/authenticating/authentication/

     

    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}
            ]
          }
        }

    Thanks

    Mark

  2. Hi Alan,

    When you say moved a part allocated sales_invoice what exactly did you move? For example -  P&L ledger_account for the item_line, the contact_id, the. bank_account for the contact_payment. https://developer.sage.com/accounting/reference/payments/#tag/Contact-Payments/operation/postContactPayments

    If you can provide the API, the body of the request and a screenshot of the errors you're seeing we can take a look into this as the request should fail if fully or partially allocated.

    Thanks

    Mark 
     

  3. Hi Todd,

    Welcome to the community and thank you for your question.

    Sage is our brand name to which there are many different products. If you can provide the product name and region your are evaluating that would help us answer your question.

    " In zoho I can make an API call to bill the customer" - Is this invoking a method that allows the bill to be sent to the customer via an email service?

    Thanks

    Mark

  4. Hi Marco,

    I've found 4 errors with a status of 500 in the logs for this business from the 23/10/2023 but non match the time you reference. If you can obtain the x-amzn-RequestId from the response header that helps us efficiently pinpoint the request in the logs.

    Looking at the errors for those I found, it appears it is unable to handle a value in one of the invoice_lines. Unfortunately the logs do not capture the request params passed and we'll need the request body from yourself to troubleshoot. 

    Can you PM them to me please?

    Thanks

    Mark

  5. Ideally you need to keep the two implementations of Stripe separate.

    The internal stripe implementation uses the href attribute of the sales_invoice as a link and reference so that when payment is taken via stripe, the payment is allocated to the sales_invoice.

    The income is then accounted for in the Stripe bank_account. This accounts acts as a type of holding account before the funds are released by stripe. On release of the funds, SBCA will reconcile the payout and transfer the funds from the holding account to the account receiving the funds. The transfer will also include a journal to the P&L for banking fees to account for the Stripe fees deducted.

    At present, if Sage Business Cloud Accounting see's a foreign Stripe Transaction/Reference it will post the income to the suspense account as it cannot reconcile the income or allocate it to the originating sales_invoice meaning the user will need to do this manually.

    I'm happy to discuss this further with you over a call if that helps?

    Thanks

    Mark

  6. Thanks for the clarification Chris.

    If it's a Sage invoked Stripe account the customer is able to send this directly to the customer which will include a payment link. 

    There's a lot of information relating to Stripe integration in the https://my.sage.co.uk/public/help.aspx#/customer/support/accounting-uk?utm_source=findservice product help. If your client searches using Stripe as the key word there's information for setup and usage.

    Thanks

    Mark

  7. Hi Andy,

    Thank you for your question.

    Sage as a brand offers many different software solutions for markets across the world. Some of the products may have been acquisitions made by Sage. This means variants of a product such as Sage 50 c or Sage business cloud accounting may have the same name but require different API's or SDK's to  implement an integration.

    As an integrator this means that if you develop a product for Sage Business Cloud Accounting for one region it may not be compatible for another. One such example would be the UK and South Africa. The South African version of Sage Business Cloud Accounting uses a different codebase and API's.

     
    The API docs referenced here https://developer.sage.com/accounting/reference/ - Relate to Sage Business Cloud Accounting in CA, ES, FR, IRE, UK and US. The integration would not work for a product with the same name outside of these countries/regions.
     
    Due to the number of products and variations, API and product support tend to be country specific with different teams handling product specific questions. 

    Which Sage products are you intending to integrate with?
     
    Thanks

    Mark
  8. Hi Sorrell,

    Thank you for your request. 

    This does not appear to be related to the public APi's this forum is intended for and we believe your request would be better answered in the product community https://sagecity.com/ .

    Sage Business Cloud Accounting has support for multi currency in various regions. If you ask your question in sagecity.com and provide a little more detail including screenshots of your current workflow they may be able to offer an immediate solution.

    Thanks

    Mark

  9. Hi Chris,

    Thanks for your question. Unfortunately, there does not appear to be any images of the customer's dashboard in your post.

    For clarification, do you know if the customer created the stripe account from within Sage Business Cloud Accounting or external? The easiest way to determine this is to look for a read only Bank Account called Stripe. This is created internally in SBCA when the business on-boards with the Stripe payment service from within Sage.

    "So my client wants a SageOne invoice raised for the remainder." - How is your client accounting for the first 50% of the income in SBCA?

    "My question is, how do I connect to the SageOne instance from the client site, without any oAuth interaction" - It isn't possible for an external application to integrate with SBCA without a user of the business authenticating the connecting application. There's further information relative to authenticating in our guide which you can find here.

    Thanks 

    Mark

  10. Hi,

    Thanks for your question. The first thing to clarify is if the Spanish business you are using to test is active. The response you are seeing is related to the status of the business you are using to authenticate your application. 

    Are you able to sign into the business using the below url? 

    https://central.eu.sageone.com/login?locale=es-ES

    If you find the trial period of the business has expired you'll need to provide the information requested at https://developer.sage.com/accounting/quick-start/upgrade-your-account/ and request for the trial period to be extended.

    If you're able to access the business and the problem lies with your POSTMAN request try using the attached environment and collection. You'll need to select and edit the environment once imported and then add your client_id and secret against the relevant variable. The callback url is also set to be the default POSTMAN app callback https://www.postman.com/oauth2/callback, if this is not a registered callback url in https://developerselfservice.sageone.com/session/new you'll need to add it to the list of your registered application.

    Once you have selected the imported environment and made the above changes use the Initial Auth Request in the imported collection to obtain the access and refresh tokens. Highlight the access token when returned, right click to save the access token to the relevant environment variable. Repeat the previous step to save the refresh token. 

    With the tokens saved in the environment variables, make a request to the businesses API and then save the business_id you are using to the variable in the environment.

    Once the business_id is set, use the bank_accounts request in the collection to return the data. Both the businesses and bank_acounts GET requests have a pre-request script running which exchanges the access tokens based on the accessTokenExpires variable value that was set when you saved the access and refresh tokens.

    Thanks

    Mark

     

     

    POSTMAN env and collection for SBCA.zip

  11. Thanks Ananth,

    There are a few different issues with your body, some which would be ignored and others that would cause an http 422 response.

    The invoice_number_prefix is set using the invoice_settings API sales_invoice_number_prefix and cannot be defined when creating the sales_invoice.
    The same is also true for the invoice_number. This is assigned incrementally on creation based on the next_invoice_number in invoice_settings. 

    The major issue with the params is that you have not included any invoice_lines with the value of the transaction. 

    I provided the below body as an example to POST a sales_invoice and have also included a screenshot of the UI displaying the resulting sales_invoice. You'll need to change the id's for those belonging to the business you are using.

    This guide may also provide some additional information in relation to what you are attempting.

     

    {
    	"sales_invoice": {
    		"contact_id": "8f9cbf3eb26f4a5fb2e38d29c914f317",
    		"date": "2023-09-22",
    		"reference": "Test Invoice",
    		"invoice_lines": [{
    				"description": "Test Item Line description",
    				"ledger_account_id": "08c7664018ed11edbcc60e97dc3b579b",
    				"unit_price": "1.23",
    				"quantity": "10 ",
                    "tax_rate_id": "79a5623d3469494c95e6ea906172f390",   
                    "tax_amount":"0.74"
                    }],
                "main_address":{
                     "address_line_1":"2-188\/2,Loyal society",
                     "address_line_2":"3-188\/3,Loyal society",
                     "City":"Atlantic city",
                     "postal_code":"0",
                     "country_id": "US"
                 },
                 "delivery_address":{
                     "address_line_1":"2-188\/2,Loyal society",
                     "address_line_2":"3-188\/3,Loyal society",
                     "City":"Atlantic city",
                     "postal_code":"0",
                     "region": "",
                     "country_id": "US"
                 }
    
    }}

     

    Screenshot 2023-09-22 at 12.14.23.png

×
×
  • Create New...