Links
Comment on page

API 💻

Postman Collection

Testing vs Production

After creating an account you can access the test API endpoints on our sandbox server:
This endpoint is identical to our production endpoint but does not allow PHI and only returns dummy card results.
Once you have signed our Business Associate Agreement (BAA) you will be able to access our production server:

Admin Endpoints

get
https://sandbox.cardscan.ai
/v1/access-token
Get Access Token
This endpoint generates a short-lived session token that the web/mobile user will use to directly authenticate with CardScan's servers. See the Authentication page for more details.
This function takes an optional user_id which must be unique between your users.
See Authentication for code examples.

End User Endpoints

get
https://sandbox.cardscan.ai
/v1/generate-upload-url
Generate Upload Url
The S3 URL only supports HTTP POSTs, not PUTs.
The upload_parameters may change at any time, please make sure to not hardcode the list in any POST command.
Curl
Javascript
Swift
curl --request GET 'https://sandbox.cardscan.ai/v1/generate-upload-url' \
--header 'Authorization: Bearer endusertokenXXX'
// The JS client wraps generate-upload-url in with the file upload functionality.
const client = new CardScanApi({
sessionToken:token,
live: false
});
client.uploadCardImage(file)
.then((cardId) => {
//update UI.
})
.catch((error) => {
//retry or update UI
});
// The swift client wraps generate-upload-url with the file upload functionality.
let apiClient = CardScanAPIClient(userToken: userToken, live: false)
apiClient.uploadCardImage(image: image) { result in
switch result {
case .failure(let error):
//check error, retry, update UI.
print("uploadCardImage error \(error)")
case .success(let cardId):
//update UI for success!
}
}
get
https://sandbox.cardscan.ai
/v1/cards
List Scanned Cards
The next_cursor field is only present in the response_metadata when there are additional results to request.
The completed card in this example is truncated, for a full card and supported states, please see Get Card Details below.
Curl
Javascript
Swift
curl --location --request GET 'https://sandbox.cardscan.ai/v1/cards' \
--header 'Authorization: Bearer endusertokenXXX'
const client = new CardScanApi({
sessionToken:token,
live: false
});
client.listCards()
.then((cards) => {
//update UI.
})
.catch((error) => {
//retry or update UI
});
let apiClient = CardScanAPIClient(userToken: userToken, live: false)
apiClient.listCards(limit: 10) { result in
switch result {
case .failure(let error):
print("listCards error \(error)")
case .success(let cards):
//update UI
}
}
get
https://sandbox.cardscan.ai
/v1/cards/:cardId
Get Card Details
Cards returned by this endpoint and the /v1/cards endpoint have a state field:
Value
Description
pending
This card ID has been reserved but a corresponding file has not yet been uploaded
processing
The card is being processed by our ML pipeline.
completed
Card processing is completed and the card details are available.
error
An error has occurred, see error_message for more details.
unknown
An unknown issue has occurred, please contact support for help.
After being processed by the ML pipeline, each element is labeled and when the probability is above our minimum threshold the results are returned.
Name
Description
Example
group_number
The group number identifies the specific benefits associated with the plan. This is missing with some payers and exchange plans.
98755
member_number
A unique identifier for each member and dependent. This is used to verify coverage and arrange payment for services.
128845682
payer_name
The name of the health insurance payer or 3rd party administrator.
unitedhealthcare
payer_id
The payer ID or EDI for the insurance company. This is as written on the card and not matched to a clearing house.
87726
rx_bin
rx_pcn
rx_group rx_id
These are used to identify how a prescription drug will be reimbursed and where a pharmacy can send a reimbursement claim to
610279
9987
UHC 12458765
member_name
Most often the policyholder, but on some cards this is the dependent the card was issues to.
Emily Dickinson
dependent_names
This is a list of all dependents found on the card.
Richard Dickinson
plan_name
Our best attempt to determine the name of the plan for this card. This is missing on many cards.
unitedhealthcare choice plus
plan_id
An identifier representing the plan associated with this card.
(80840) 911-80708-01
client_name
The name of the employer who is contracted with the 3rd party administrator.
Apple, Inc.
plan_details
When available a list of: deductibles, co-pays, co-insurance, PCP name.
Office: $25
ER: $300
start_date
The date when coverage starts.
04/01/2021
card_specific_id
A non-specific but prominent identifier found on the card.
54243
phone_numbers
A list of all phone numbers found of the front and back of the card.
800-400-5251
addresses
A list of all addresses found on the card.
UnitedHealthcare
P.O. Box 740800
Atlanta, GA 30374-0800
Note: If an element is missing it means it is either not available on this type of card, or we did not have a high enough confidence to return it.
Curl
Javascript
Swift
curl --request GET 'https://sandbox.cardscan.ai/v1/cards/a1d743ee-3bb9-468d-a2c5-4e33fa0e1c6e' \
--header 'Authorization: Bearer endusertokenXXX'
const client = new CardScanApi({
sessionToken:token,
live: false
});
client.getCard(cardId)
.then((card) => {
//update UI.
})
.catch((error) => {
//retry or update UI
});
let apiClient = CardScanAPIClient(userToken: userToken, live: false)
apiClient.getCard(cardUUID: cardId) { result in
switch result {
case .failure(let error):
print("getCard error \(error)")
case .success(let card):
//update UI
}
}
delete
https://sandbox.cardscan.ai
/v1/cards/:cardId
Delete Card
Note: All of the images, ML results, eligibility results, and PHI will be removed, but the card record and performance statistics will remain.
Curl
curl --request DELETE 'https://sandbox.cardscan.ai/v1/cards/a1d743ee-3bb9-468d-a2c5-4e33fa0e1c6e' \
--header 'Authorization: Bearer endusertokenXXX'