# Billing

## GET /billing/v1/account

> Returns account record based on X-SkySQL-Org-ID header value

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.Account":{"type":"object","properties":{"active":{"type":"boolean"},"legal_entity_identifier":{"type":"string"},"number":{"type":"string"},"organization_id":{"type":"string"},"remittance":{"type":"boolean"},"scu_consumed_mtd":{"type":"number"},"scu_remaining_mtd":{"type":"number"},"start_date":{"type":"string"},"status":{"type":"string"},"subscription":{"$ref":"#/components/schemas/dto.Subscription"},"tier":{"type":"string"},"trial_credit":{"type":"number"}}},"dto.Subscription":{"type":"object","properties":{"payment_collection_method":{"type":"string"},"status":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/account":{"get":{"tags":["Billing"],"summary":"Returns account record based on X-SkySQL-Org-ID header value","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dto.Account"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /billing/v1/account/postpaid-commit-ledger

> Returns account record based on X-SkySQL-Org-ID header value

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.CommitLedger":{"type":"object","properties":{"contract_entitlement_id":{"type":"string"},"created_at":{"type":"string"},"id":{"type":"string"},"invoice_amount":{"type":"number"},"min_compute_commit":{"type":"number"},"org_id":{"type":"string"},"period":{"type":"string"},"unused_compute_commit":{"type":"number"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/account/postpaid-commit-ledger":{"get":{"tags":["Billing"],"summary":"Returns account record based on X-SkySQL-Org-ID header value","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.CommitLedger"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /billing/v1/account/prepaid-credit-ledger

> Returns account record based on X-SkySQL-Org-ID header value

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.CreditLedger":{"type":"object","properties":{"amount":{"type":"number"},"batch":{"type":"integer"},"contract_id":{"type":"string"},"created_at":{"type":"string"},"id":{"type":"string"},"org_id":{"type":"string"},"reason":{"type":"string"},"type":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/account/prepaid-credit-ledger":{"get":{"tags":["Billing"],"summary":"Returns account record based on X-SkySQL-Org-ID header value","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.CreditLedger"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /billing/v1/bills

> Returns usage allocation summary

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.Bill":{"type":"object","properties":{"additional_compute_discount":{"type":"number"},"billing_mode":{"type":"string"},"currency":{"type":"string"},"currency_symbol":{"type":"string"},"data_transfer_cost":{"type":"number"},"discount":{"type":"number"},"discounted_compute_cost":{"type":"number"},"id":{"type":"string"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/dto.BillingLineItem"}},"min_compute_cost":{"type":"number"},"org_id":{"type":"string"},"period":{"type":"string"},"remaining_credit":{"type":"number"},"support_cost":{"type":"number"},"support_type":{"type":"string"},"tier":{"type":"string"},"total":{"type":"number"},"total_compute_cost":{"type":"number"},"total_storage_cost":{"type":"number"},"undiscounted_compute_cost":{"type":"number"},"unused_compute_commit":{"type":"number"},"unused_compute_commit_ledger":{"type":"number"},"usage_days":{"type":"integer"}}},"dto.BillingLineItem":{"type":"object","properties":{"bill_id":{"type":"string"},"cost":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/dto.BillingLineItemCost"}}},"id":{"type":"string"},"service":{"$ref":"#/components/schemas/dto.BillingLineItemService"}}},"dto.BillingLineItemCost":{"type":"object","properties":{"active_nodes":{"type":"integer"},"instance":{"type":"string"},"name":{"type":"string"},"price_per_hour":{"type":"number"},"total_cost":{"type":"number"},"total_hours":{"type":"number"}}},"dto.BillingLineItemService":{"type":"object","properties":{"name":{"type":"string"},"provider":{"type":"string"},"region":{"type":"string"},"service_id":{"type":"string"},"topology":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/bills":{"get":{"tags":["Billing"],"summary":"Returns usage allocation summary","parameters":[{"schema":{"type":"string"},"description":"billing year","name":"year","in":"query"},{"schema":{"type":"string"},"description":"billing month","name":"month","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dto.Bill"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /billing/v1/contacts

> Returns organization contacts

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.AccountContact":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/dto.ContactAddress"},"email":{"type":"string"},"first_name":{"type":"string"},"id":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"type":{"type":"string"}}},"dto.ContactAddress":{"type":"object","properties":{"address_line_1":{"type":"string"},"address_line_2":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"postal_code":{"type":"string"},"state":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/contacts":{"get":{"tags":["Billing"],"summary":"Returns organization contacts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.AccountContact"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## POST /billing/v1/contacts

> Create organization contacts

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.AccountContact":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/dto.ContactAddress"},"email":{"type":"string"},"first_name":{"type":"string"},"id":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"type":{"type":"string"}}},"dto.ContactAddress":{"type":"object","properties":{"address_line_1":{"type":"string"},"address_line_2":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"postal_code":{"type":"string"},"state":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/contacts":{"post":{"tags":["Billing"],"summary":"Create organization contacts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dto.AccountContact"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## DELETE /billing/v1/contacts/{contact\_id}

> Delete organization contacts

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/contacts/{contact_id}":{"delete":{"tags":["Billing"],"summary":"Delete organization contacts","parameters":[{"schema":{"type":"string"},"description":"Contact identifier","name":"contact_id","in":"path","required":true}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## PATCH /billing/v1/contacts/{contact\_id}

> Update organization contacts

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/contacts/{contact_id}":{"patch":{"tags":["Billing"],"summary":"Update organization contacts","parameters":[{"schema":{"type":"string"},"description":"Contact identifier","name":"contact_id","in":"path","required":true}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /billing/v1/contracts/{org\_id}

>

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.Contract":{"type":"object","properties":{"billing_mode":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":"string"},"currency":{"type":"string"},"end_date":{"type":"string"},"entitlements":{"type":"array","items":{"$ref":"#/components/schemas/dto.Entitlement"}},"estimated_contract_commit":{"type":"number"},"estimated_contract_value":{"type":"number"},"execution_date":{"type":"string"},"id":{"type":"string"},"integration_id":{"type":"string"},"marketing_collaboration_discount":{"type":"boolean"},"org_id":{"type":"string"},"renewal_date":{"type":"string"},"renewal_id":{"type":"string"},"start_date":{"type":"string"},"state":{"type":"string"},"updated_at":{"type":"string"},"updated_by":{"type":"string"}}},"dto.Entitlement":{"type":"object","properties":{"contract_id":{"type":"string"},"created_at":{"type":"string"},"end_date":{"type":"string"},"entitlement_id":{"type":"string"},"id":{"type":"string"},"spec":{},"start_date":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/contracts/{org_id}":{"get":{"tags":["Billing"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.Contract"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /billing/v1/invoices

> Returns list of invoices

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.Invoice":{"type":"object","properties":{"invoice_amount":{"type":"number"},"invoice_date":{"type":"string"},"invoice_due_date":{"type":"string"},"invoice_id":{"type":"string"},"invoice_pdf_url":{"type":"string"},"org_id":{"type":"string"},"period":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/invoices":{"get":{"tags":["Billing"],"summary":"Returns list of invoices","parameters":[{"schema":{"type":"string"},"description":"start date","name":"start_date","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.Invoice"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /billing/v1/invoices/{invoice\_id}

> Returns list of invoices

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.InvoiceWithDetails":{"type":"object","properties":{"bill_date":{"type":"string"},"currency":{"type":"string"},"invoice_amount":{"type":"number"},"invoice_date":{"type":"string"},"invoice_due_date":{"type":"string"},"invoice_id":{"type":"string"},"invoice_pdf_url":{"type":"string"},"org_id":{"type":"string"},"period":{"type":"string"},"scu_consumed":{"type":"number"},"scu_remaining":{"type":"number"},"services":{"type":"array","items":{"$ref":"#/components/schemas/dto.ServiceUsage"}},"status":{"type":"string"},"symbol":{"type":"string"},"usage_end_date":{"type":"string"},"usage_start_date":{"type":"string"}}},"dto.ServiceUsage":{"type":"object","properties":{"cost":{"type":"number"},"node_cost":{"type":"number"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/dto.NodeUsage"}},"service":{"$ref":"#/components/schemas/dto.Service"},"storage":{"$ref":"#/components/schemas/dto.StorageUsage"}}},"dto.NodeUsage":{"type":"object","properties":{"active_nodes":{"type":"integer"},"cost":{"type":"number"},"quantity":{"type":"number"},"rate":{"type":"number"},"rate_unit":{"type":"string"},"size":{"type":"string"},"unit":{"type":"string"}}},"dto.Service":{"type":"object","properties":{"arch":{"type":"string"},"instance":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string"},"region":{"type":"string"},"service_id":{"type":"string"},"tier":{"type":"string"},"topology":{"type":"string"}}},"dto.StorageUsage":{"type":"object","properties":{"cost":{"type":"number"},"iops":{"$ref":"#/components/schemas/dto.IOPSUsage"},"quantity":{"type":"number"},"rate":{"type":"number"},"rate_unit":{"type":"string"},"throughput":{"$ref":"#/components/schemas/dto.ThroughputUsage"},"total_cost":{"type":"number"},"type":{"type":"string"},"unit":{"type":"string"}}},"dto.IOPSUsage":{"type":"object","properties":{"cost":{"type":"number"},"quantity":{"type":"number"},"rate":{"type":"number"},"rate_unit":{"type":"string"},"unit":{"type":"string"}}},"dto.ThroughputUsage":{"type":"object","properties":{"cost":{"type":"number"},"quantity":{"type":"number"},"rate":{"type":"number"},"rate_unit":{"type":"string"},"unit":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/invoices/{invoice_id}":{"get":{"tags":["Billing"],"summary":"Returns list of invoices","parameters":[{"schema":{"type":"string"},"description":"Invoice identifier","name":"invoice_id","in":"path","required":true},{"schema":{"type":"string"},"description":"resource or service","name":"as","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dto.InvoiceWithDetails"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /billing/v1/locale/country

> Returns active countries

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.Country":{"type":"object","properties":{"active":{"type":"boolean"},"iso3166_2":{"type":"string"},"iso3166_3":{"type":"string"},"lei":{"type":"string"},"name":{"type":"string"},"vat":{"type":"boolean"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/locale/country":{"get":{"tags":["Billing"],"summary":"Returns active countries","parameters":[{"schema":{"type":"boolean"},"description":"true or false","name":"active","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.Country"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /billing/v1/locale/state-province

> Returns active states/provinces

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.StateProvince":{"type":"object","properties":{"active":{"type":"boolean"},"country":{"type":"string"},"iso_short":{"type":"string"},"name":{"type":"string"}}}}},"paths":{"/billing/v1/locale/state-province":{"get":{"tags":["Billing"],"summary":"Returns active states/provinces","parameters":[{"schema":{"type":"boolean"},"description":"true or false","name":"active","in":"query"},{"schema":{"type":"string"},"description":"iso3166-2 country code","name":"country","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.StateProvince"}}}}}}}}}}
```

## GET /billing/v1/meters/{id}

> Returns prices for different meters

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"paths":{"/billing/v1/meters/{id}":{"get":{"tags":["Billing"],"summary":"Returns prices for different meters","parameters":[{"schema":{"type":"string"},"description":"Offering identifier","name":"offering","in":"path","required":true},{"schema":{"type":"string"},"description":"provider name","name":"provider","in":"query"},{"schema":{"type":"string"},"description":"product name","name":"product","in":"query"},{"schema":{"type":"string"},"description":"topology name","name":"topology","in":"query"},{"schema":{"type":"string"},"description":"tier name","name":"tier","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.Meter"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}},"components":{"schemas":{"dto.Meter":{"type":"object","properties":{"class":{"type":"string"},"description":{"type":"string"},"label":{"type":"string"},"meter_id":{"type":"string"},"name":{"type":"string"},"offering_id":{"type":"string"},"price_dimensions":{"type":"object","additionalProperties":{"type":"boolean"}},"unit":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}}}
```

## GET /billing/v1/offerings

> Returns prices for different meters

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"paths":{"/billing/v1/offerings":{"get":{"tags":["Billing"],"summary":"Returns prices for different meters","parameters":[{"schema":{"type":"string"},"description":"Offering identifier","name":"offering","in":"path","required":true},{"schema":{"type":"string"},"description":"provider name","name":"provider","in":"query"},{"schema":{"type":"string"},"description":"product name","name":"product","in":"query"},{"schema":{"type":"string"},"description":"topology name","name":"topology","in":"query"},{"schema":{"type":"string"},"description":"tier name","name":"tier","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.OfferingDTO"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}},"components":{"schemas":{"dto.OfferingDTO":{"type":"object","properties":{"description":{"type":"string"},"name":{"type":"string"},"offering_id":{"type":"string"},"product_mapping":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}}}
```

## GET /billing/v1/offerings/{id}/meters

> Returns prices for different meters

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"paths":{"/billing/v1/offerings/{id}/meters":{"get":{"tags":["Billing"],"summary":"Returns prices for different meters","parameters":[{"schema":{"type":"string"},"description":"Offering identifier","name":"offering","in":"path","required":true},{"schema":{"type":"string"},"description":"provider name","name":"provider","in":"query"},{"schema":{"type":"string"},"description":"product name","name":"product","in":"query"},{"schema":{"type":"string"},"description":"topology name","name":"topology","in":"query"},{"schema":{"type":"string"},"description":"tier name","name":"tier","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.Meter"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}},"components":{"schemas":{"dto.Meter":{"type":"object","properties":{"class":{"type":"string"},"description":{"type":"string"},"label":{"type":"string"},"meter_id":{"type":"string"},"name":{"type":"string"},"offering_id":{"type":"string"},"price_dimensions":{"type":"object","additionalProperties":{"type":"boolean"}},"unit":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}}}
```

## GET /billing/v1/payment-methods

> Returns Payment Profile for request context OrgID

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"paths":{"/billing/v1/payment-methods":{"get":{"tags":["Billing"],"summary":"Returns Payment Profile for request context OrgID","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.PaymentMethod"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}},"components":{"schemas":{"dto.PaymentMethod":{"type":"object","properties":{"billing_details":{"$ref":"#/components/schemas/dto.BillingDetails"},"card":{"$ref":"#/components/schemas/dto.Card"},"default_payment_method":{"type":"boolean"},"payment_method_id":{"type":"string"},"type":{"type":"string"}}},"dto.BillingDetails":{"type":"object","properties":{"country":{"type":"string"},"name":{"type":"string"}}},"dto.Card":{"type":"object","properties":{"card_type":{"type":"string"},"cvc_validation":{"type":"boolean"},"expiration_month":{"type":"integer"},"expiration_year":{"type":"integer"},"masked_card_number":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}}}
```

## POST /billing/v1/payment-methods/setup-intent

> To setup payment method in Stripe

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.SetupIntentResponse":{"type":"object","properties":{"intent":{"type":"string"},"key":{"type":"string"},"secret":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/payment-methods/setup-intent":{"post":{"consumes":["application/json"],"tags":["Billing"],"summary":"To setup payment method in Stripe","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dto.SetupIntentResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## DELETE /billing/v1/payment-methods/{pm\_id}

> Deleted payment method by id

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"paths":{"/billing/v1/payment-methods/{pm_id}":{"delete":{"tags":["Billing"],"summary":"Deleted payment method by id","parameters":[{"schema":{"type":"string"},"description":"Payment identifier","name":"pm_id","in":"path","required":true}],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}},"components":{"schemas":{"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}}}
```

## PATCH /billing/v1/payment-methods/{pm\_id}

> Returns Payment Profile for request context OrgID

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"paths":{"/billing/v1/payment-methods/{pm_id}":{"patch":{"tags":["Billing"],"summary":"Returns Payment Profile for request context OrgID","parameters":[{"schema":{"type":"string"},"description":"Payment identifier","name":"pm_id","in":"path","required":true}],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}},"components":{"schemas":{"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}}}
```

## GET /billing/v1/prices/{offering}

> Returns prices for different meters

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"paths":{"/billing/v1/prices/{offering}":{"get":{"tags":["Billing"],"summary":"Returns prices for different meters","parameters":[{"schema":{"type":"string"},"description":"Offering identifier","name":"offering","in":"path","required":true},{"schema":{"type":"string"},"description":"provider name","name":"provider","in":"query"},{"schema":{"type":"string"},"description":"product name","name":"product","in":"query"},{"schema":{"type":"string"},"description":"topology name","name":"topology","in":"query"},{"schema":{"type":"string"},"description":"tier name","name":"tier","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/dto.MeterPrice"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}},"components":{"schemas":{"dto.MeterPrice":{"type":"object","properties":{"dimensions":{"type":"object","additionalProperties":{"type":"string"}},"end_range":{"type":"number"},"id":{"type":"string"},"meter":{"$ref":"#/components/schemas/dto.Meter"},"price":{"$ref":"#/components/schemas/dto.Price"},"start_range":{"type":"number"},"type":{"type":"string"}}},"dto.Meter":{"type":"object","properties":{"class":{"type":"string"},"description":{"type":"string"},"label":{"type":"string"},"meter_id":{"type":"string"},"name":{"type":"string"},"offering_id":{"type":"string"},"price_dimensions":{"type":"object","additionalProperties":{"type":"boolean"}},"unit":{"type":"string"}}},"dto.Price":{"type":"object","properties":{"currency":{"type":"string"},"monthly_commit":{"type":"number"},"multiplier":{"type":"number"},"price_per_hour":{"type":"number"},"price_per_min":{"type":"number"},"price_per_month":{"type":"number"},"scale_fabric_price_per_hour":{"type":"number"},"scale_fabric_price_per_min":{"type":"number"},"scale_fabric_price_per_month":{"type":"number"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}}}
```

## GET /billing/v1/tax

> Returns organization tax information

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.RequestAccountTax":{"type":"object","properties":{"country":{"type":"string"},"postal_code":{"type":"string"},"registration":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/tax":{"get":{"tags":["Billing"],"summary":"Returns organization tax information","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dto.RequestAccountTax"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## POST /billing/v1/tax

> Create organization tax information

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.RequestAccountTax":{"type":"object","properties":{"country":{"type":"string"},"postal_code":{"type":"string"},"registration":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/tax":{"post":{"tags":["Billing"],"summary":"Create organization tax information","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dto.RequestAccountTax"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## DELETE /billing/v1/tax/{tax\_id}

> Delete organization tax information

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/tax/{tax_id}":{"delete":{"tags":["Billing"],"summary":"Delete organization tax information","parameters":[{"schema":{"type":"string"},"description":"Tax identifier","name":"tax_id","in":"path","required":true}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## PATCH /billing/v1/tax/{tax\_id}

> Update organization tax information

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v1/tax/{tax_id}":{"patch":{"tags":["Billing"],"summary":"Update organization tax information","parameters":[{"schema":{"type":"string"},"description":"Tax identifier","name":"tax_id","in":"path","required":true}],"responses":{"204":{"description":"No Content"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /billing/v2/bills

> Returns usage allocation summary

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"dto.BillV2":{"type":"object","properties":{"additional_compute_discount":{"type":"number"},"billing_mode":{"type":"string"},"currency":{"type":"string"},"currency_symbol":{"type":"string"},"data_transfer_cost":{"type":"number"},"discount":{"type":"number"},"discounted_compute_cost":{"type":"number"},"id":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/dto.ResourceLineItemDTO"}},"min_compute_cost":{"type":"number"},"org_id":{"type":"string"},"other_cost":{"type":"number"},"period":{"type":"string"},"remaining_credit":{"type":"number"},"support_cost":{"type":"number"},"support_type":{"type":"string"},"tier":{"type":"string"},"total":{"type":"number"},"total_compute_cost":{"type":"number"},"total_storage_cost":{"type":"number"},"undiscounted_compute_cost":{"type":"number"},"unused_compute_commit":{"type":"number"},"usage_days":{"type":"integer"}}},"dto.ResourceLineItemDTO":{"type":"object","properties":{"id":{"type":"string"},"line_items":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/dto.BillingLineItemCostDTO"}}},"resource":{"$ref":"#/components/schemas/dto.ResourceLineDetailsDTO"},"total":{"type":"number"}}},"dto.BillingLineItemCostDTO":{"type":"object","properties":{"billable_usage":{"type":"number"},"dimensions":{"type":"object","additionalProperties":{"type":"string"}},"included_usage":{"type":"number"},"included_usage_amount":{"type":"number"},"included_usage_limit":{"type":"number"},"meter":{"type":"string"},"price_id":{"type":"string"},"quantity":{"type":"number"},"rate":{"type":"number"},"rate_unit":{"type":"string"},"total":{"type":"number"},"unit":{"type":"string"}}},"dto.ResourceLineDetailsDTO":{"type":"object","properties":{"dimensions":{"type":"object","additionalProperties":{"type":"string"}},"name":{"type":"string"},"resource_id":{"type":"string"}}},"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/billing/v2/bills":{"get":{"tags":["Billing"],"summary":"Returns usage allocation summary","parameters":[{"schema":{"type":"string"},"description":"billing year","name":"year","in":"query"},{"schema":{"type":"string"},"description":"billing month","name":"month","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/dto.BillV2"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```

## GET /public/services/bcs/invoices/{invoice\_id}/pdf

> Export invoice to PDF

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"errr.SkySQLError":{"type":"object","properties":{"code":{"description":"http status code to return","type":"integer"},"err":{"type":"string"},"exception":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"array","items":{"$ref":"#/components/schemas/errr.MetadataField"}},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.MetadataField":{"type":"object","properties":{"key":{"type":"string"},"value":{}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/public/services/bcs/invoices/{invoice_id}/pdf":{"get":{"tags":["Billing"],"summary":"Export invoice to PDF","parameters":[{"schema":{"type":"string"},"description":"Invoice identifier","name":"invoice_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/pdf":{"schema":{"type":"array","items":{"type":"integer"}}}}},"400":{"description":"Bad Request","content":{"application/pdf":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"401":{"description":"Unauthorized","content":{"application/pdf":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}},"500":{"description":"Internal Server Error","content":{"application/pdf":{"schema":{"$ref":"#/components/schemas/errr.SkySQLError"}}}}}}}}}
```
