curl --request POST \
--url https://app.base44.com/api/billing/end-free-trial \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/billing/end-free-trial"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/billing/end-free-trial', 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://app.base44.com/api/billing/end-free-trial",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/billing/end-free-trial"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/billing/end-free-trial")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/billing/end-free-trial")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "ended_successfully",
"invoice_id": "9a8b7c6d-1234-4f5e-8a9b-0c1d2e3f4a5b"
}End free trial
Ends your workspace’s free trial now and starts the paid plan. Only the workspace owner can end it. This works only for a workspace billed through Wix that’s in a free trial. Otherwise it returns 400 with not_wix_billed or not_in_free_trial.
status set to payment_declined or payment_declined_not_retriable, and the workspace stays in its free trial. Check status before you treat the trial as ended.To fix a declined card, update it with Create payment method update session, then call this again.
The base rate limit is 10 requests per hour per user. See Rate limits for the multiplier your plan gets.
curl --request POST \
--url https://app.base44.com/api/billing/end-free-trial \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.base44.com/api/billing/end-free-trial"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.base44.com/api/billing/end-free-trial', 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://app.base44.com/api/billing/end-free-trial",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/billing/end-free-trial"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/billing/end-free-trial")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/billing/end-free-trial")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "ended_successfully",
"invoice_id": "9a8b7c6d-1234-4f5e-8a9b-0c1d2e3f4a5b"
}Authorizations
Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.
Response
The outcome of the charge. Check status.
The outcome of ending a free trial.
ended_successfully: the trial is over and the first cycle is paid. payment_pending: the charge is still processing. payment_declined: the card was declined and the trial continues, so you can retry. payment_declined_not_retriable: declined, and retrying won't help until the payment method changes. unknown_status: Wix didn't report an outcome.
ended_successfully, payment_pending, payment_declined, payment_declined_not_retriable, unknown_status "ended_successfully"
ID of the invoice for the first cycle. null when none was issued.
"9a8b7c6d-1234-4f5e-8a9b-0c1d2e3f4a5b"
Was this page helpful?