curl -X POST \
/billing-groups \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"customer": "ad3f4b3c-1b2a-4d5c-8e6f-7a8b9c0d1e2f",
"name": "Billing of payments at the end of the month",
"type": "end_of_month",
"customDay": "31",
"customMonth": "12"
}'import requests
url = "https://coreapi.io/billing-groups"
payload = {
"customer": "ad3f4b3c-1b2a-4d5c-8e6f-7a8b9c0d1e2f",
"name": "Billing of payments at the end of the month",
"type": "end_of_month",
"customDay": 31,
"customMonth": 12
}
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({
customer: 'ad3f4b3c-1b2a-4d5c-8e6f-7a8b9c0d1e2f',
name: 'Billing of payments at the end of the month',
type: 'end_of_month',
customDay: 31,
customMonth: 12
})
};
fetch('https://coreapi.io/billing-groups', 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://coreapi.io/billing-groups",
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([
'customer' => 'ad3f4b3c-1b2a-4d5c-8e6f-7a8b9c0d1e2f',
'name' => 'Billing of payments at the end of the month',
'type' => 'end_of_month',
'customDay' => 31,
'customMonth' => 12
]),
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;
}{
"name": "Billing of payments at the end of the month",
"type": "end_of_month",
"id": "01F9ZQZJZJQZJZJZJZJZJZJZJZ",
"customDay": 31,
"customMonth": 12
}Create a billing group
Create a billing group, to group the billing date of subscriptions. If a subscription is not assigned to a billing group, it will be charged in the billing interval from creation date.
Subscriptions which are assigned to a billing group will be charged on the billing date of the billing group with proration.
curl -X POST \
/billing-groups \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"customer": "ad3f4b3c-1b2a-4d5c-8e6f-7a8b9c0d1e2f",
"name": "Billing of payments at the end of the month",
"type": "end_of_month",
"customDay": "31",
"customMonth": "12"
}'import requests
url = "https://coreapi.io/billing-groups"
payload = {
"customer": "ad3f4b3c-1b2a-4d5c-8e6f-7a8b9c0d1e2f",
"name": "Billing of payments at the end of the month",
"type": "end_of_month",
"customDay": 31,
"customMonth": 12
}
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({
customer: 'ad3f4b3c-1b2a-4d5c-8e6f-7a8b9c0d1e2f',
name: 'Billing of payments at the end of the month',
type: 'end_of_month',
customDay: 31,
customMonth: 12
})
};
fetch('https://coreapi.io/billing-groups', 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://coreapi.io/billing-groups",
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([
'customer' => 'ad3f4b3c-1b2a-4d5c-8e6f-7a8b9c0d1e2f',
'name' => 'Billing of payments at the end of the month',
'type' => 'end_of_month',
'customDay' => 31,
'customMonth' => 12
]),
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;
}{
"name": "Billing of payments at the end of the month",
"type": "end_of_month",
"id": "01F9ZQZJZJQZJZJZJZJZJZJZJZ",
"customDay": 31,
"customMonth": 12
}Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The new BillingGroup resource
The customer of the billing group.
"ad3f4b3c-1b2a-4d5c-8e6f-7a8b9c0d1e2f"
The name of the billing group.
255"Billing of payments at the end of the month"
The type of the billing group.
start_of_month, end_of_month, start_of_year, end_of_year, custom "end_of_month"
The custom day of the billing group, only used when type is "custom".
x <= 3131
The custom month of the billing group, only used when type is "custom".
x <= 1212
Antwort
BillingGroup resource created
The name of the billing group.
255"Billing of payments at the end of the month"
The type of the billing group.
Possible values:
start_of_month: The billing group will be charged on the first day of the month.end_of_month: The billing group will be charged on the last day of the month.start_of_year: The billing group will be charged on the first day of the year.end_of_year: The billing group will be charged on the last day of the year.custom: The billing group will be charged on a custom day of the month.
"end_of_month"
"01F9ZQZJZJQZJZJZJZJZJZJZJZ"
The custom day of the billing group, only used when type is "custom".
x <= 3131
The custom month of the billing group, only used when type is "custom".
x <= 1212
War diese Seite hilfreich?