Billing -payments
Calculate tax
POST
/billing/v1/tax/calculateCalculate tax for a plan purchase
Authorization
Bearer Authorization<token>
In: header
Request Body
requiredapplication/json{
"amount": 0,
"billing_address": {
"city": "string",
"country": "string",
"email": "string",
"line1": "string",
"line2": "string",
"name": "string",
"phone": "string",
"postal_code": "string",
"state": "string"
},
"billing_cycle": "string",
"currency": "string",
"interval_count": 0,
"line_items": [
{
"amount": 0,
"reference": "string",
"tax_code": "string"
}
],
"metadata": {
"property1": "string",
"property2": "string"
},
"plan_id": "string",
"plan_name": "string"
}amount?number
billing_address?object
city?string
country?string
email?string
line1?string
line2?string
name?string
phone?string
postal_code?string
state?string
billing_cycle?string
currency?string
interval_count?integer
line_items?array<object>
amount?integer
reference?string
tax_code?string
metadata?object
plan_id?string
plan_name?string
Response Body
200application/json
OK
type: object
amount_total?integer
base_amount?integer
billing_address?object
city?string
country?string
email?string
line1?string
line2?string
name?string
phone?string
postal_code?string
state?string
billing_cycle?string
calculated_at?string
calculation_id?string
currency?string
plan_id?string
plan_name?string
tax_amount_exclusive?integer
tax_amount_inclusive?integer
tax_percentage?number
curl -X POST "https://api.rixl.com/billing/v1/tax/calculate" \
-H "Content-Type: application/json" \
-d '{}'const body = JSON.stringify({})
fetch("https://api.rixl.com/billing/v1/tax/calculate", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://api.rixl.com/billing/v1/tax/calculate"
body := strings.NewReader(`{}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://api.rixl.com/billing/v1/tax/calculate"
body = """{}"""
response = requests.request("POST", url, data = body, headers = {
"Content-Type": "application/json"
})
print(response.text)import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import java.net.http.HttpRequest.BodyPublishers;
var body = BodyPublishers.ofString("""{}""");
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("https://api.rixl.com/billing/v1/tax/calculate"))
.header("Content-Type", "application/json")
.POST(body)
.build();
try {
HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
System.out.println("Status code: " + response.statusCode());
System.out.println("Response body: " + response.body());
} catch (Exception e) {
e.printStackTrace();
}using System;
using System.Net.Http;
using System.Text;
var body = new StringContent("""
{}
""", Encoding.UTF8, "application/json");
var client = new HttpClient();
var response = await client.PostAsync("https://api.rixl.com/billing/v1/tax/calculate", body);
var responseBody = await response.Content.ReadAsStringAsync();OK
application/json
{
"amount_total": 0,
"base_amount": 0,
"billing_address": {
"city": "string",
"country": "string",
"email": "string",
"line1": "string",
"line2": "string",
"name": "string",
"phone": "string",
"postal_code": "string",
"state": "string"
},
"billing_cycle": "string",
"calculated_at": "string",
"calculation_id": "string",
"currency": "string",
"plan_id": "string",
"plan_name": "string",
"tax_amount_exclusive": 0,
"tax_amount_inclusive": 0,
"tax_percentage": 0
}