Jump to content

vaxas59775

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by vaxas59775

  1. Hello, I'm trying to create product in the Sage Accounting using the API (https://developer.sage.com/accounting/reference/products-services/#tag/Products/operation/postProducts)
    I'm getting error "The product_sales_price_type_id is invalid." There is no field named "product_sales_price_type_id" in the create product docs.

    Where should I add "product_sales_price_type_id"?
    Is the developer docs up to date?


    My request is:

    {
       "product": {
          "active": true,
          "cost_price": 84,
          "description": "Test Product Description",
          "purchase_ledger_account_id": null,
          "sales_ledger_account_id": null,
          "purchase_tax_rate_id": "GB_STANDARD",
          "sales_tax_rate_id": "GB_STANDARD",
          "sales_prices": [
             {
                "price": 100,
                "price_includes_tax": false,
             }
          ],
       }
    }

     

  2. Hello, I'm trying to refresh my expired token by following Renew an Access Token section in the https://developer.sage.com/accounting/guides/authenticating/authentication/ . But I'm getting  DataParsingError error.
    My request response log is:

    ~~~ REQUEST ~~~
    POST  /token  HTTP/1.1
    HOST   : oauth.accounting.sage.com
    HEADERS:
    	Content-Type: application/json
    BODY   :
    {
       "client_id": "****",
       "client_secret": "****",
       "grant_type": "refresh_token",
       "refresh_token": "****"
    }
    ------------------------------------------------------------------------------
    ~~~ RESPONSE ~~~
    STATUS       : 400 Bad Request
    HEADERS      :
    	Connection: keep-alive
    	Content-Length: 125
    	Content-Type: application/json;charset=UTF-8
    	... (trimmed cloudfront headers)
    	X-Cache: Error from cloudfront
    BODY         :
    {
       "$severity": "error",
       "$dataCode": "DataParsingError",
       "$message": "The data you sent could not be processed.",
       "$source": "Proxy"
    }
    ==============================================================================


    Where do I'm wrong?

  3. Hello, I want to pass user id parameter to my server after they authenticate sage account with my app. Because my users are using same sage app so I need to know which user authenticated.

    I tried to add parameter in authorization request url:
    https://www.sageone.com/oauth2/auth/central?client_id={{client_id}}&country=GB&filter=apiv3.1&redirect_uri={{redirect_url}}&response_type=code&scope=full_access&user_id=123

    It is not working. The sage backend deletes extra parameters in the url, the user_id parameter is not transferring to the callback.

    I tried to add parameter to callback url
    redirect_url = url_encoded(http://........com/callback?user_id=123)
     https://www.sageone.com/oauth2/auth/central?client_id={{client_id}}&country=GB&filter=apiv3.1&redirect_uri={{redirect_url}}&response_type=code&scope=full_access

    I tried to change callback url;
    redirect_url = url_encoded(http://........com/callback/123)
     https://www.sageone.com/oauth2/auth/central?client_id={{client_id}}&country=GB&filter=apiv3.1&redirect_uri={{redirect_url}}&response_type=code&scope=full_access

    but when I change callback url sage auth page giving error "Authorize Application Error" It's not working.

    Is there any way to this? I want to add parameter to authorization request url and read the parameter in the callback.

×
×
  • Create New...