Calculate tax
POST
/billing/v1/tax/calculateCalculate tax for a plan purchase
Authorization
Bearer Authorization<token>
In: header
Request Body
requiredapplication/json{
"$ref": "#/components/schemas/internal_billing.calculateTaxBody",
"$ref-value": {
"properties": {
"amount": {
"type": "number"
},
"billing_address": {
"$ref": "#/components/schemas/internal_billing.billingAddressBody",
"$ref-value": {
"properties": {
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"email": {
"type": "string"
},
"line1": {
"type": "string"
},
"line2": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"postal_code": {
"type": "string"
},
"state": {
"type": "string"
}
},
"type": "object"
}
},
"billing_cycle": {
"type": "string"
},
"currency": {
"type": "string"
},
"interval_count": {
"type": "integer"
},
"line_items": {
"items": {
"$ref": "#/components/schemas/internal_billing.taxLineItemBody",
"$ref-value": {
"properties": {
"amount": {
"type": "integer"
},
"reference": {
"type": "string"
},
"tax_code": {
"type": "string"
}
},
"type": "object"
}
},
"type": "array"
},
"metadata": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"plan_id": {
"type": "string"
},
"plan_name": {
"type": "string"
}
},
"type": "object"
}
}Response Body
200application/json
OK
type: unknown
{
"$ref": "#/components/schemas/billingv1.PlanTaxCalculationResponse",
"$ref-value": {
"properties": {
"amount_total": {
"type": "integer"
},
"base_amount": {
"type": "integer"
},
"billing_address": {
"$ref": "#/components/schemas/billingv1.BillingAddress",
"$ref-value": {
"properties": {
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"email": {
"type": "string"
},
"line1": {
"type": "string"
},
"line2": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"postal_code": {
"type": "string"
},
"state": {
"type": "string"
}
},
"type": "object"
}
},
"billing_cycle": {
"type": "string"
},
"calculated_at": {
"type": "string"
},
"calculation_id": {
"type": "string"
},
"currency": {
"type": "string"
},
"plan_id": {
"type": "string"
},
"plan_name": {
"type": "string"
},
"tax_amount_exclusive": {
"type": "integer"
},
"tax_amount_inclusive": {
"type": "integer"
},
"tax_percentage": {
"type": "number"
}
},
"type": "object"
}
}curl -X POST "https://api.rixl.com/billing/v1/tax/calculate" \
-H "Content-Type: application/json" \
-d '{}'OK
application/json
{
"$ref": "#/components/schemas/billingv1.PlanTaxCalculationResponse",
"$ref-value": {
"properties": {
"amount_total": {
"type": "integer"
},
"base_amount": {
"type": "integer"
},
"billing_address": {
"$ref": "#/components/schemas/billingv1.BillingAddress",
"$ref-value": {
"properties": {
"city": {
"type": "string"
},
"country": {
"type": "string"
},
"email": {
"type": "string"
},
"line1": {
"type": "string"
},
"line2": {
"type": "string"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"postal_code": {
"type": "string"
},
"state": {
"type": "string"
}
},
"type": "object"
}
},
"billing_cycle": {
"type": "string"
},
"calculated_at": {
"type": "string"
},
"calculation_id": {
"type": "string"
},
"currency": {
"type": "string"
},
"plan_id": {
"type": "string"
},
"plan_name": {
"type": "string"
},
"tax_amount_exclusive": {
"type": "integer"
},
"tax_amount_inclusive": {
"type": "integer"
},
"tax_percentage": {
"type": "number"
}
},
"type": "object"
}
}