Requests automatic booking
curl --request POST \
--url https://api.staging.scan.com/api/v2/referrals/{referral_id}/book \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"book": {
"strategy": "closest",
"radius": 25,
"address": "200 Peachtree St, Atlanta, GA 30303",
"webhook_url": "https://partner.example/hooks/scan-booking"
}
}
'require 'uri'
require 'net/http'
url = URI("https://api.staging.scan.com/api/v2/referrals/{referral_id}/book")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"book\": {\n \"strategy\": \"closest\",\n \"radius\": 25,\n \"address\": \"200 Peachtree St, Atlanta, GA 30303\",\n \"webhook_url\": \"https://partner.example/hooks/scan-booking\"\n }\n}"
response = http.request(request)
puts response.read_bodyimport requests
url = "https://api.staging.scan.com/api/v2/referrals/{referral_id}/book"
payload = { "book": {
"strategy": "closest",
"radius": 25,
"address": "200 Peachtree St, Atlanta, GA 30303",
"webhook_url": "https://partner.example/hooks/scan-booking"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
book: {
strategy: 'closest',
radius: 25,
address: '200 Peachtree St, Atlanta, GA 30303',
webhook_url: 'https://partner.example/hooks/scan-booking'
}
})
};
fetch('https://api.staging.scan.com/api/v2/referrals/{referral_id}/book', 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://api.staging.scan.com/api/v2/referrals/{referral_id}/book",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'book' => [
'strategy' => 'closest',
'radius' => 25,
'address' => '200 Peachtree St, Atlanta, GA 30303',
'webhook_url' => 'https://partner.example/hooks/scan-booking'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.scan.com/api/v2/referrals/{referral_id}/book"
payload := strings.NewReader("{\n \"book\": {\n \"strategy\": \"closest\",\n \"radius\": 25,\n \"address\": \"200 Peachtree St, Atlanta, GA 30303\",\n \"webhook_url\": \"https://partner.example/hooks/scan-booking\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"auto_book_request": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"strategy": "closest",
"radius": 125,
"address": "<string>",
"outcome": "booked",
"error": "<string>",
"completed_at": "2023-11-07T05:31:56Z"
},
"referral": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "1234567890",
"status": "pending",
"line_of_business": "personal_injury",
"payment_type": "lien",
"incident_state": "GA",
"visits": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"modality": "MRI",
"procedures": [
{
"body_part": "Brain",
"procedure": "MRI Brain w/o contrast",
"contrast": "without_contrast",
"laterality": "not_present",
"cpt_code": "70551",
"cpt_code_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cpt_system": "http://www.ama-assn.org/go/cpt",
"accession_id": "<string>",
"study_uid": "<string>",
"series_uid": "<string>",
"image_link": "<string>",
"report_link": "<string>"
}
],
"status": "booked",
"start_time": "2023-11-07T05:31:56Z",
"radiologist_group_name": "<string>",
"location": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"address_line_1": "<string>",
"address_line_2": "<string>",
"city": "<string>",
"state": "<string>",
"zip_code": "<string>",
"name": "<string>",
"npi": "<string>"
}
}
],
"referring_provider": "<string>",
"provider": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"npi": "<string>"
},
"law_firm": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"practice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"payor": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"insurance_number": "<string>",
"wc_number": "<string>",
"icd10_codes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "M54.5",
"system": "http://hl7.org/fhir/sid/icd-10-cm",
"short_description": "Low back pain"
}
],
"patient": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"identifier": {
"system": "https://scan.com/fhir/sid/patient-id",
"value": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "John Doe",
"first_name": "<string>",
"last_name": "<string>",
"middle_initial": "<string>",
"date_of_birth": "05/21/1988",
"date_of_birth_iso": "1988-05-21",
"email": "[email protected]",
"phone_number": "<string>",
"gender": "male",
"address_line_1": "<string>",
"address_line_2": "<string>",
"city": "<string>",
"state": "<string>",
"zip_code": "<string>"
},
"call_notes": [
{
"created_at": "2023-11-07T05:31:56Z",
"notes": "<string>"
}
],
"documents": [
{}
],
"answered_medical_questionnaire": true,
"preferred_location": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"scheduling_mode": "anytime_anywhere",
"auto_book_request": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"strategy": "closest",
"radius": 125,
"address": "<string>",
"outcome": "booked",
"error": "<string>",
"completed_at": "2023-11-07T05:31:56Z"
}
}
}Referrals
Requests automatic booking
Asynchronously ranks eligible centers and books the best live opening. Partners do not select a timeslot. The response confirms that the request was accepted; it does not mean the visit is booked.
This capability is off until Scan enables it for your account.
This is the only endpoint that requires your API credential to have an
acting user assigned, because the resulting booking is attributed to a
person. Requests from a credential without one return 422.
POST
/
api
/
v2
/
referrals
/
{referral_id}
/
book
Requests automatic booking
curl --request POST \
--url https://api.staging.scan.com/api/v2/referrals/{referral_id}/book \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"book": {
"strategy": "closest",
"radius": 25,
"address": "200 Peachtree St, Atlanta, GA 30303",
"webhook_url": "https://partner.example/hooks/scan-booking"
}
}
'require 'uri'
require 'net/http'
url = URI("https://api.staging.scan.com/api/v2/referrals/{referral_id}/book")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"book\": {\n \"strategy\": \"closest\",\n \"radius\": 25,\n \"address\": \"200 Peachtree St, Atlanta, GA 30303\",\n \"webhook_url\": \"https://partner.example/hooks/scan-booking\"\n }\n}"
response = http.request(request)
puts response.read_bodyimport requests
url = "https://api.staging.scan.com/api/v2/referrals/{referral_id}/book"
payload = { "book": {
"strategy": "closest",
"radius": 25,
"address": "200 Peachtree St, Atlanta, GA 30303",
"webhook_url": "https://partner.example/hooks/scan-booking"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
book: {
strategy: 'closest',
radius: 25,
address: '200 Peachtree St, Atlanta, GA 30303',
webhook_url: 'https://partner.example/hooks/scan-booking'
}
})
};
fetch('https://api.staging.scan.com/api/v2/referrals/{referral_id}/book', 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://api.staging.scan.com/api/v2/referrals/{referral_id}/book",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'book' => [
'strategy' => 'closest',
'radius' => 25,
'address' => '200 Peachtree St, Atlanta, GA 30303',
'webhook_url' => 'https://partner.example/hooks/scan-booking'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.scan.com/api/v2/referrals/{referral_id}/book"
payload := strings.NewReader("{\n \"book\": {\n \"strategy\": \"closest\",\n \"radius\": 25,\n \"address\": \"200 Peachtree St, Atlanta, GA 30303\",\n \"webhook_url\": \"https://partner.example/hooks/scan-booking\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"auto_book_request": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"strategy": "closest",
"radius": 125,
"address": "<string>",
"outcome": "booked",
"error": "<string>",
"completed_at": "2023-11-07T05:31:56Z"
},
"referral": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference": "1234567890",
"status": "pending",
"line_of_business": "personal_injury",
"payment_type": "lien",
"incident_state": "GA",
"visits": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"modality": "MRI",
"procedures": [
{
"body_part": "Brain",
"procedure": "MRI Brain w/o contrast",
"contrast": "without_contrast",
"laterality": "not_present",
"cpt_code": "70551",
"cpt_code_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cpt_system": "http://www.ama-assn.org/go/cpt",
"accession_id": "<string>",
"study_uid": "<string>",
"series_uid": "<string>",
"image_link": "<string>",
"report_link": "<string>"
}
],
"status": "booked",
"start_time": "2023-11-07T05:31:56Z",
"radiologist_group_name": "<string>",
"location": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"address_line_1": "<string>",
"address_line_2": "<string>",
"city": "<string>",
"state": "<string>",
"zip_code": "<string>",
"name": "<string>",
"npi": "<string>"
}
}
],
"referring_provider": "<string>",
"provider": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"npi": "<string>"
},
"law_firm": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"practice": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"payor": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"insurance_number": "<string>",
"wc_number": "<string>",
"icd10_codes": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": "M54.5",
"system": "http://hl7.org/fhir/sid/icd-10-cm",
"short_description": "Low back pain"
}
],
"patient": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"identifier": {
"system": "https://scan.com/fhir/sid/patient-id",
"value": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "John Doe",
"first_name": "<string>",
"last_name": "<string>",
"middle_initial": "<string>",
"date_of_birth": "05/21/1988",
"date_of_birth_iso": "1988-05-21",
"email": "[email protected]",
"phone_number": "<string>",
"gender": "male",
"address_line_1": "<string>",
"address_line_2": "<string>",
"city": "<string>",
"state": "<string>",
"zip_code": "<string>"
},
"call_notes": [
{
"created_at": "2023-11-07T05:31:56Z",
"notes": "<string>"
}
],
"documents": [
{}
],
"answered_medical_questionnaire": true,
"preferred_location": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"scheduling_mode": "anytime_anywhere",
"auto_book_request": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"strategy": "closest",
"radius": 125,
"address": "<string>",
"outcome": "booked",
"error": "<string>",
"completed_at": "2023-11-07T05:31:56Z"
}
}
}Authorizations
Authorization: Bearer <api_token>. Sandbox tokens come from Get API keys
and allow 2,000 successful requests or 7 days. Failed 4xx/5xx responses do
not consume the allowance. Production tokens are issued from the group's
API access tab.
Path Parameters
Existing referral ID
Body
application/json
Show child attributes
Show child attributes

