Accounting
Initiate Accounting OAuth
Start an OAuth flow to connect an accounting provider.
POST
/
v1
/
accounting
/
connect
/
{provider}
Start an accounting OAuth flow
curl --request POST \
--url https://billing.example.com/v1/accounting/connect/{provider} \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/accounting/connect/{provider}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/accounting/connect/{provider}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/accounting/connect/{provider}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://billing.example.com/v1/accounting/connect/{provider}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://billing.example.com/v1/accounting/connect/{provider}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/accounting/connect/{provider}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"auth_url": "<string>"
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
provider | string | Yes | The accounting provider to connect. One of quickbooks or xero. |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
redirect_uri | string | No | The URL to redirect to after authorization. Defaults to your dashboard. |
state | string | No | An opaque value to maintain state between the request and callback. |
Example Request
curl -X POST "https://api.recurso.io/v1/accounting/connect/quickbooks" \
-H "Authorization: Bearer rsk_live_9f8a7b6c5d4e3f2a1b0c" \
-H "Content-Type: application/json" \
-d '{
"redirect_uri": "https://app.example.com/settings/integrations/callback",
"state": "usr_session_abc123"
}'
Response
Redirect the user’s browser to the returnedauth_url to complete the OAuth authorization.
{
"auth_url": "https://appcenter.intuit.com/connect/oauth2?client_id=ABcDeFgHiJkLmNoPqRsTuVwXyZ&redirect_uri=https%3A%2F%2Fapi.recurso.io%2Fv1%2Faccounting%2Fcallback%2Fquickbooks&response_type=code&scope=com.intuit.quickbooks.accounting&state=usr_session_abc123",
"provider": "quickbooks",
"expires_in": 600
}
redirect_uri with an
authorization code. Recurso handles the token exchange automatically. You can verify the connection
was established by calling the List Accounting Connections
endpoint.⌘I
Start an accounting OAuth flow
curl --request POST \
--url https://billing.example.com/v1/accounting/connect/{provider} \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/accounting/connect/{provider}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/accounting/connect/{provider}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/accounting/connect/{provider}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://billing.example.com/v1/accounting/connect/{provider}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://billing.example.com/v1/accounting/connect/{provider}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/accounting/connect/{provider}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"auth_url": "<string>"
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}