Update billing profile
curl --request PUT \
--url https://api.opencard.io/api/v1/application/accounts/{accountId}/billings/{billingId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email_invoice": "finance@acme.se",
"product_transaction": true
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email_invoice: 'finance@acme.se', product_transaction: true})
};
fetch('https://api.opencard.io/api/v1/application/accounts/{accountId}/billings/{billingId}', 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}/billings/{billingId}"
payload = {
"email_invoice": "finance@acme.se",
"product_transaction": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(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}/billings/{billingId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email_invoice' => 'finance@acme.se',
'product_transaction' => true
]),
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;
}{
"id": 1,
"name_display": "Acme AB",
"name_legal": "Acme AB",
"organization_number": "5561234567",
"country": "SE",
"address_street": "Storgatan 1",
"address_city": "Stockholm",
"address_zip": "111 22",
"email_invoice": "finance@acme.se",
"your_reference_invoice": "PO-12345",
"product_transaction": true,
"product_digital_receipt": false,
"product_aland_index": false
}{
"message": "Billing product transaction is required in one or more organizations"
}Billings
Update billing profile
Same fields as create. Turning a product flag off returns 400 when an organization on this billing still has a webhook that needs it: product_transaction for card_transaction_*, product_digital_receipt for receipt_fetched and transaction_true_vat, product_aland_index for aland_index.
PUT
/
accounts
/
{accountId}
/
billings
/
{billingId}
Update billing profile
curl --request PUT \
--url https://api.opencard.io/api/v1/application/accounts/{accountId}/billings/{billingId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email_invoice": "finance@acme.se",
"product_transaction": true
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email_invoice: 'finance@acme.se', product_transaction: true})
};
fetch('https://api.opencard.io/api/v1/application/accounts/{accountId}/billings/{billingId}', 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}/billings/{billingId}"
payload = {
"email_invoice": "finance@acme.se",
"product_transaction": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(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}/billings/{billingId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email_invoice' => 'finance@acme.se',
'product_transaction' => true
]),
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;
}{
"id": 1,
"name_display": "Acme AB",
"name_legal": "Acme AB",
"organization_number": "5561234567",
"country": "SE",
"address_street": "Storgatan 1",
"address_city": "Stockholm",
"address_zip": "111 22",
"email_invoice": "finance@acme.se",
"your_reference_invoice": "PO-12345",
"product_transaction": true,
"product_digital_receipt": false,
"product_aland_index": false
}{
"message": "Billing product transaction is required in one or more organizations"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Fields to change. Omit a field to leave it unchanged.
Available options:
SE, DK, NO, FI Where the OpenCard invoice is sent
Your reference printed on the invoice
Enables card_transaction_* webhook events on organizations linked to this billing
Enables receipt_fetched and transaction_true_vat webhook events
Enables the aland_index webhook event
Response
Updated billing profile

