Error: {"Type":null,"Title":"Unauthorized","Status":401,"Detail":"AuthenticationUnsuccessful","Instance":"d04e9f32-44cf-46fc-a4b7-a9b90f64f77d","Extensions":{}}
XeroOAuth Object
(
    [_xero_defaults] => Array
        (
            [xero_url] => https://api.xero.com/
            [site] => https://api.xero.com
            [authorize_url] => https://api.xero.com/oauth/Authorize
            [signature_method] => HMAC-SHA1
        )

    [_xero_consumer_options] => Array
        (
            [request_token_path] => oauth/RequestToken
            [access_token_path] => oauth/AccessToken
            [authorize_path] => oauth/Authorize
        )

    [_action] => 
    [_nonce_chars] => 
    [params] => Array
        (
        )

    [headers] => Array
        (
            [Accept] => application/xml
            [Content-Length] => 0
            [Expect] => 
        )

    [auto_fixed_time] => 
    [buffer] => 
    [request_params] => Array
        (
        )

    [_xero_curl_options] => Array
        (
            [curl_connecttimeout] => 30
            [curl_timeout] => 20
            [curl_ssl_verifypeer] => 2
            [curl_cainfo] => /var/www/sites/figero-dev/vendor/xero/xerooauth-php/certs/ca-bundle.crt
            [curl_followlocation] => 
            [curl_ssl_verifyhost] => 2
            [curl_proxy] => 
            [curl_proxyuserpwd] => 
            [curl_encoding] => 
            [curl_verbose] => 1
        )

    [config] => Array
        (
            [xero_url] => https://api.xero.com/
            [site] => https://api.xero.com
            [authorize_url] => https://api.xero.com/oauth/Authorize
            [signature_method] => HMAC-SHA1
            [request_token_path] => oauth/RequestToken
            [access_token_path] => oauth/AccessToken
            [authorize_path] => oauth/Authorize
            [curl_connecttimeout] => 30
            [curl_timeout] => 20
            [curl_ssl_verifypeer] => 2
            [curl_cainfo] => /var/www/sites/figero-dev/vendor/xero/xerooauth-php/certs/ca-bundle.crt
            [curl_followlocation] => 
            [curl_ssl_verifyhost] => 2
            [curl_proxy] => 
            [curl_proxyuserpwd] => 
            [curl_encoding] => 
            [curl_verbose] => 1
            [application_type] => Public
            [oauth_callback] => http://localhost/XeroOAuth-PHP/public.php
            [user_agent] => Xero-OAuth-PHP Public
            [consumer_key] => YOURCONSUMERKEY
            [shared_secret] => YOURSECRET
            [core_version] => 2.0
            [payroll_version] => 1.0
            [file_version] => 1.0
            [host] => https://api.xero.com/oauth/
            [multipart] => 
        )

    [method] => GET
    [url] => https://api.xero.com/oauth/RequestToken
    [sign] => Array
        (
            [parameters] => Array
                (
                    [oauth_callback] => http://localhost/XeroOAuth-PHP/public.php
                    [oauth_consumer_key] => YOURCONSUMERKEY
                    [oauth_nonce] => uABY0
                    [oauth_signature_method] => HMAC-SHA1
                    [oauth_timestamp] => 1776764210
                    [oauth_version] => 1.0
                    [oauth_signature] => nDFH1OhTc3WSRUnl2ohPtBs70xs=
                )

            [signature] => nDFH1OhTc3WSRUnl2ohPtBs70xs%3D
            [signed_url] => https://api.xero.com/oauth/RequestToken?oauth_callback=http%3A%2F%2Flocalhost%2FXeroOAuth-PHP%2Fpublic.php&oauth_consumer_key=YOURCONSUMERKEY&oauth_nonce=uABY0&oauth_signature=nDFH1OhTc3WSRUnl2ohPtBs70xs%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1776764210&oauth_version=1.0
            [header] => OAuth oauth_callback="http%3A%2F%2Flocalhost%2FXeroOAuth-PHP%2Fpublic.php", oauth_consumer_key="YOURCONSUMERKEY", oauth_nonce="uABY0", oauth_signature="nDFH1OhTc3WSRUnl2ohPtBs70xs%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1776764210", oauth_version="1.0"
            [sbs] => GET&https%3A%2F%2Fapi.xero.com%2Foauth%2FRequestToken&oauth_callback%3Dhttp%253A%252F%252Flocalhost%252FXeroOAuth-PHP%252Fpublic.php%26oauth_consumer_key%3DYOURCONSUMERKEY%26oauth_nonce%3DuABY0%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1776764210%26oauth_version%3D1.0
        )

    [format] => xml
    [response] => Array
        (
            [headers] => Array
                (
                    [content_type] => application/json
                    [content_length] => 153
                    [www_authenticate] => Bearer
                    [xero_correlation_id] => d04e9f32-44cf-46fc-a4b7-a9b90f64f77d
                    [server] => tpzgw-c
                    [expires] => Tue, 21 Apr 2026 09:36:50 GMT
                    [cache_control] => max-age=0, no-cache, no-store
                    [pragma] => no-cache
                    [date] => Tue, 21 Apr 2026 09:36:50 GMT
                    [x_client_tls_ver] => tls1.3
                )

            [code] => 401
            [response] => {"Type":null,"Title":"Unauthorized","Status":401,"Detail":"AuthenticationUnsuccessful","Instance":"d04e9f32-44cf-46fc-a4b7-a9b90f64f77d","Extensions":{}}
            [info] => Array
                (
                    [url] => https://api.xero.com/oauth/RequestToken?oauth_callback=http%3A%2F%2Flocalhost%2FXeroOAuth-PHP%2Fpublic.php&oauth_consumer_key=YOURCONSUMERKEY&oauth_nonce=uABY0&oauth_signature=nDFH1OhTc3WSRUnl2ohPtBs70xs%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1776764210&oauth_version=1.0
                    [content_type] => application/json
                    [http_code] => 401
                    [header_size] => 337
                    [request_size] => 833
                    [filetime] => -1
                    [ssl_verify_result] => 0
                    [redirect_count] => 0
                    [total_time] => 0.149158
                    [namelookup_time] => 0.039379
                    [connect_time] => 0.040692
                    [pretransfer_time] => 0.053319
                    [size_upload] => 0
                    [size_download] => 153
                    [speed_download] => 1026
                    [speed_upload] => 0
                    [download_content_length] => 153
                    [upload_content_length] => -1
                    [starttransfer_time] => 0.148994
                    [redirect_time] => 0
                    [redirect_url] => 
                    [primary_ip] => 2.19.176.187
                    [certinfo] => Array
                        (
                        )

                    [primary_port] => 443
                    [local_ip] => 172.31.8.210
                    [local_port] => 48202
                    [http_version] => 3
                    [protocol] => 2
                    [ssl_verifyresult] => 0
                    [scheme] => HTTPS
                    [appconnect_time_us] => 53183
                    [connect_time_us] => 40692
                    [namelookup_time_us] => 39379
                    [pretransfer_time_us] => 53319
                    [redirect_time_us] => 0
                    [starttransfer_time_us] => 148994
                    [total_time_us] => 149158
                    [request_header] => GET /oauth/RequestToken?oauth_callback=http%3A%2F%2Flocalhost%2FXeroOAuth-PHP%2Fpublic.php&oauth_consumer_key=YOURCONSUMERKEY&oauth_nonce=uABY0&oauth_signature=nDFH1OhTc3WSRUnl2ohPtBs70xs%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1776764210&oauth_version=1.0 HTTP/2
Host: api.xero.com
user-agent: Xero-OAuth-PHP Public
accept-encoding: deflate, gzip, br
accept: application/xml
content-length: 0
tracestate: 6724123@nr=0-0-6724123-458196360-34380b0d7ec3b83d-6111b28de613bde3-1-1.021887-1776764210799
newrelic: eyJ2IjpbMCwxXSwiZCI6eyJ0eSI6IkFwcCIsImFjIjoiNjcyNDEyMyIsImFwIjoiNDU4MTk2MzYwIiwiaWQiOiIzNDM4MGIwZDdlYzNiODNkIiwidHIiOiI2MTExYjI4ZGU2MTNiZGUzIiwidHgiOiI2MTExYjI4ZGU2MTNiZGUzIiwicHIiOjEuMDIxODksInNhIjp0cnVlLCJ0aSI6MTc3Njc2NDIxMDc5OX19
traceparent: 00-00000000000000006111b28de613bde3-34380b0d7ec3b83d-01


                )

            [format] => xml
        )

)
  • Authenticate
  • Authenticate with Payroll API support (Australia & US organisations only)