OCR scan receipt
curl --request POST \
--url https://api.opencard.io/api/v1/application/accounts/{accountId}/receipts/scan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"receipt": "base64-image...",
"include": [
"line_items"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({receipt: 'base64-image...', include: ['line_items']})
};
fetch('https://api.opencard.io/api/v1/application/accounts/{accountId}/receipts/scan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.opencard.io/api/v1/application/accounts/{accountId}/receipts/scan"
payload = {
"receipt": "base64-image...",
"include": ["line_items"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opencard.io/api/v1/application/accounts/{accountId}/receipts/scan",
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([
'receipt' => 'base64-image...',
'include' => [
'line_items'
]
]),
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;
}{
"merchant": "ICA",
"total_amount": 109.38,
"currency": "SEK",
"line_items": [
{
"description": "Coffee",
"amount": 45
}
]
}Receipt Scanner
OCR scan receipt
POST
/
accounts
/
{accountId}
/
receipts
/
scan
OCR scan receipt
curl --request POST \
--url https://api.opencard.io/api/v1/application/accounts/{accountId}/receipts/scan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"receipt": "base64-image...",
"include": [
"line_items"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({receipt: 'base64-image...', include: ['line_items']})
};
fetch('https://api.opencard.io/api/v1/application/accounts/{accountId}/receipts/scan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.opencard.io/api/v1/application/accounts/{accountId}/receipts/scan"
payload = {
"receipt": "base64-image...",
"include": ["line_items"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.opencard.io/api/v1/application/accounts/{accountId}/receipts/scan",
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([
'receipt' => 'base64-image...',
'include' => [
'line_items'
]
]),
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;
}{
"merchant": "ICA",
"total_amount": 109.38,
"currency": "SEK",
"line_items": [
{
"description": "Coffee",
"amount": 45
}
]
}⌘I

