Billing

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

get
Authorizations
Responses
200

OK

application/json
get
GET /billing/v1/account HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "active": true,
  "legal_entity_identifier": "text",
  "number": "text",
  "organization_id": "text",
  "remittance": true,
  "scu_consumed_mtd": 1,
  "scu_remaining_mtd": 1,
  "start_date": "text",
  "status": "text",
  "subscription": {
    "payment_collection_method": "text",
    "status": "text"
  },
  "tier": "text",
  "trial_credit": 1
}

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

get
Authorizations
Responses
200

OK

application/json
get
GET /billing/v1/account/postpaid-commit-ledger HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
[
  {
    "contract_entitlement_id": "text",
    "created_at": "text",
    "id": "text",
    "invoice_amount": 1,
    "min_compute_commit": 1,
    "org_id": "text",
    "period": "text",
    "unused_compute_commit": 1
  }
]

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

get
Authorizations
Responses
200

OK

application/json
get
GET /billing/v1/account/prepaid-credit-ledger HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
[
  {
    "amount": 1,
    "batch": 1,
    "contract_id": "text",
    "created_at": "text",
    "id": "text",
    "org_id": "text",
    "reason": "text",
    "type": "text"
  }
]

Returns usage allocation summary

get
Authorizations
Query parameters
yearstringOptional

billing year

monthstringOptional

billing month

Responses
200

OK

application/json
get
GET /billing/v1/bills HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "additional_compute_discount": 1,
  "billing_mode": "text",
  "currency": "text",
  "currency_symbol": "text",
  "data_transfer_cost": 1,
  "discount": 1,
  "discounted_compute_cost": 1,
  "id": "text",
  "line_items": [
    {
      "bill_id": "text",
      "cost": {
        "ANY_ADDITIONAL_PROPERTY": [
          {
            "active_nodes": 1,
            "instance": "text",
            "name": "text",
            "price_per_hour": 1,
            "total_cost": 1,
            "total_hours": 1
          }
        ]
      },
      "id": "text",
      "service": {
        "name": "text",
        "provider": "text",
        "region": "text",
        "service_id": "text",
        "topology": "text"
      }
    }
  ],
  "min_compute_cost": 1,
  "org_id": "text",
  "period": "text",
  "remaining_credit": 1,
  "support_cost": 1,
  "support_type": "text",
  "tier": "text",
  "total": 1,
  "total_compute_cost": 1,
  "total_storage_cost": 1,
  "undiscounted_compute_cost": 1,
  "unused_compute_commit": 1,
  "unused_compute_commit_ledger": 1,
  "usage_days": 1
}

Returns organization contacts

get
Authorizations
Responses
200

OK

application/json
get
GET /billing/v1/contacts HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
[
  {
    "address": {
      "address_line_1": "text",
      "address_line_2": "text",
      "city": "text",
      "country": "text",
      "postal_code": "text",
      "state": "text"
    },
    "email": "text",
    "first_name": "text",
    "id": "text",
    "last_name": "text",
    "phone": "text",
    "type": "text"
  }
]

Create organization contacts

post
Authorizations
Responses
200

OK

application/json
post
POST /billing/v1/contacts HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "address": {
    "address_line_1": "text",
    "address_line_2": "text",
    "city": "text",
    "country": "text",
    "postal_code": "text",
    "state": "text"
  },
  "email": "text",
  "first_name": "text",
  "id": "text",
  "last_name": "text",
  "phone": "text",
  "type": "text"
}

Delete organization contacts

delete
Authorizations
Path parameters
contact_idstringRequired

Contact identifier

Responses
204

No Content

No content

delete
DELETE /billing/v1/contacts/{contact_id} HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*

No content

Update organization contacts

patch
Authorizations
Path parameters
contact_idstringRequired

Contact identifier

Responses
204

No Content

No content

patch
PATCH /billing/v1/contacts/{contact_id} HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*

No content

get
Authorizations
Responses
200

OK

application/json
get
GET /billing/v1/contracts/{org_id} HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
[
  {
    "billing_mode": "text",
    "created_at": "text",
    "created_by": "text",
    "currency": "text",
    "end_date": "text",
    "entitlements": [
      {
        "contract_id": "text",
        "created_at": "text",
        "end_date": "text",
        "entitlement_id": "text",
        "id": "text",
        "spec": null,
        "start_date": "text"
      }
    ],
    "estimated_contract_commit": 1,
    "estimated_contract_value": 1,
    "execution_date": "text",
    "id": "text",
    "integration_id": "text",
    "marketing_collaboration_discount": true,
    "org_id": "text",
    "renewal_date": "text",
    "renewal_id": "text",
    "start_date": "text",
    "state": "text",
    "updated_at": "text",
    "updated_by": "text"
  }
]

Returns list of invoices

get
Authorizations
Query parameters
start_datestringOptional

start date

Responses
200

OK

application/json
get
GET /billing/v1/invoices HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
[
  {
    "invoice_amount": 1,
    "invoice_date": "text",
    "invoice_due_date": "text",
    "invoice_id": "text",
    "invoice_pdf_url": "text",
    "org_id": "text",
    "period": "text"
  }
]

Returns list of invoices

get
Authorizations
Path parameters
invoice_idstringRequired

Invoice identifier

Query parameters
asstringOptional

resource or service

Responses
200

OK

application/json
get
GET /billing/v1/invoices/{invoice_id} HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "bill_date": "text",
  "currency": "text",
  "invoice_amount": 1,
  "invoice_date": "text",
  "invoice_due_date": "text",
  "invoice_id": "text",
  "invoice_pdf_url": "text",
  "org_id": "text",
  "period": "text",
  "scu_consumed": 1,
  "scu_remaining": 1,
  "services": [
    {
      "cost": 1,
      "node_cost": 1,
      "nodes": [
        {
          "active_nodes": 1,
          "cost": 1,
          "quantity": 1,
          "rate": 1,
          "rate_unit": "text",
          "size": "text",
          "unit": "text"
        }
      ],
      "service": {
        "arch": "text",
        "instance": "text",
        "name": "text",
        "provider": "text",
        "region": "text",
        "service_id": "text",
        "tier": "text",
        "topology": "text"
      },
      "storage": {
        "cost": 1,
        "iops": {
          "cost": 1,
          "quantity": 1,
          "rate": 1,
          "rate_unit": "text",
          "unit": "text"
        },
        "quantity": 1,
        "rate": 1,
        "rate_unit": "text",
        "throughput": {
          "cost": 1,
          "quantity": 1,
          "rate": 1,
          "rate_unit": "text",
          "unit": "text"
        },
        "total_cost": 1,
        "type": "text",
        "unit": "text"
      }
    }
  ],
  "status": "text",
  "symbol": "text",
  "usage_end_date": "text",
  "usage_start_date": "text"
}

Returns active countries

get
Authorizations
Query parameters
activebooleanOptional

true or false

Responses
200

OK

application/json
get
GET /billing/v1/locale/country HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
[
  {
    "active": true,
    "iso3166_2": "text",
    "iso3166_3": "text",
    "lei": "text",
    "name": "text",
    "vat": true
  }
]

Returns active states/provinces

get
Authorizations
Query parameters
activebooleanOptional

true or false

countrystringOptional

iso3166-2 country code

Responses
200

OK

application/json
get
GET /billing/v1/locale/state-province HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
200

OK

[
  {
    "active": true,
    "country": "text",
    "iso_short": "text",
    "name": "text"
  }
]

Returns prices for different meters

get
Path parameters
offeringstringRequired

Offering identifier

Query parameters
providerstringOptional

provider name

productstringOptional

product name

topologystringOptional

topology name

tierstringOptional

tier name

Responses
200

OK

application/json
get
GET /billing/v1/meters/{id} HTTP/1.1
Host: api.skysql.com/
Accept: */*
[
  {
    "class": "text",
    "description": "text",
    "label": "text",
    "meter_id": "text",
    "name": "text",
    "offering_id": "text",
    "price_dimensions": {
      "ANY_ADDITIONAL_PROPERTY": true
    },
    "unit": "text"
  }
]

Returns prices for different meters

get
Path parameters
offeringstringRequired

Offering identifier

Query parameters
providerstringOptional

provider name

productstringOptional

product name

topologystringOptional

topology name

tierstringOptional

tier name

Responses
200

OK

application/json
get
GET /billing/v1/offerings HTTP/1.1
Host: api.skysql.com/
Accept: */*
[
  {
    "description": "text",
    "name": "text",
    "offering_id": "text",
    "product_mapping": "text"
  }
]

Returns prices for different meters

get
Path parameters
offeringstringRequired

Offering identifier

Query parameters
providerstringOptional

provider name

productstringOptional

product name

topologystringOptional

topology name

tierstringOptional

tier name

Responses
200

OK

application/json
get
GET /billing/v1/offerings/{id}/meters HTTP/1.1
Host: api.skysql.com/
Accept: */*
[
  {
    "class": "text",
    "description": "text",
    "label": "text",
    "meter_id": "text",
    "name": "text",
    "offering_id": "text",
    "price_dimensions": {
      "ANY_ADDITIONAL_PROPERTY": true
    },
    "unit": "text"
  }
]

Returns Payment Profile for request context OrgID

get
Responses
200

OK

application/json
get
GET /billing/v1/payment-methods HTTP/1.1
Host: api.skysql.com/
Accept: */*
[
  {
    "billing_details": {
      "country": "text",
      "name": "text"
    },
    "card": {
      "card_type": "text",
      "cvc_validation": true,
      "expiration_month": 1,
      "expiration_year": 1,
      "masked_card_number": "text"
    },
    "default_payment_method": true,
    "payment_method_id": "text",
    "type": "text"
  }
]

To setup payment method in Stripe

post
Authorizations
Responses
200

OK

application/json
post
POST /billing/v1/payment-methods/setup-intent HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "intent": "text",
  "key": "text",
  "secret": "text"
}

Deleted payment method by id

delete
Path parameters
pm_idstringRequired

Payment identifier

Responses
204

No Content

No content

delete
DELETE /billing/v1/payment-methods/{pm_id} HTTP/1.1
Host: api.skysql.com/
Accept: */*

No content

Returns Payment Profile for request context OrgID

patch
Path parameters
pm_idstringRequired

Payment identifier

Responses
204

No Content

No content

patch
PATCH /billing/v1/payment-methods/{pm_id} HTTP/1.1
Host: api.skysql.com/
Accept: */*

No content

Returns prices for different meters

get
Path parameters
offeringstringRequired

Offering identifier

Query parameters
providerstringOptional

provider name

productstringOptional

product name

topologystringOptional

topology name

tierstringOptional

tier name

Responses
200

OK

application/json
get
GET /billing/v1/prices/{offering} HTTP/1.1
Host: api.skysql.com/
Accept: */*
[
  {
    "dimensions": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    },
    "end_range": 1,
    "id": "text",
    "meter": {
      "class": "text",
      "description": "text",
      "label": "text",
      "meter_id": "text",
      "name": "text",
      "offering_id": "text",
      "price_dimensions": {
        "ANY_ADDITIONAL_PROPERTY": true
      },
      "unit": "text"
    },
    "price": {
      "currency": "text",
      "monthly_commit": 1,
      "multiplier": 1,
      "price_per_hour": 1,
      "price_per_min": 1,
      "price_per_month": 1,
      "scale_fabric_price_per_hour": 1,
      "scale_fabric_price_per_min": 1,
      "scale_fabric_price_per_month": 1
    },
    "start_range": 1,
    "type": "text"
  }
]

Returns organization tax information

get
Authorizations
Responses
200

OK

application/json
get
GET /billing/v1/tax HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "country": "text",
  "postal_code": "text",
  "registration": "text"
}

Create organization tax information

post
Authorizations
Responses
200

OK

application/json
post
POST /billing/v1/tax HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "country": "text",
  "postal_code": "text",
  "registration": "text"
}

Delete organization tax information

delete
Authorizations
Path parameters
tax_idstringRequired

Tax identifier

Responses
204

No Content

No content

delete
DELETE /billing/v1/tax/{tax_id} HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*

No content

Update organization tax information

patch
Authorizations
Path parameters
tax_idstringRequired

Tax identifier

Responses
204

No Content

No content

patch
PATCH /billing/v1/tax/{tax_id} HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*

No content

Returns usage allocation summary

get
Authorizations
Query parameters
yearstringOptional

billing year

monthstringOptional

billing month

Responses
200

OK

application/json
get
GET /billing/v2/bills HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "additional_compute_discount": 1,
  "billing_mode": "text",
  "currency": "text",
  "currency_symbol": "text",
  "data_transfer_cost": 1,
  "discount": 1,
  "discounted_compute_cost": 1,
  "id": "text",
  "items": [
    {
      "id": "text",
      "line_items": {
        "ANY_ADDITIONAL_PROPERTY": [
          {
            "billable_usage": 1,
            "dimensions": {
              "ANY_ADDITIONAL_PROPERTY": "text"
            },
            "included_usage": 1,
            "included_usage_amount": 1,
            "included_usage_limit": 1,
            "meter": "text",
            "price_id": "text",
            "quantity": 1,
            "rate": 1,
            "rate_unit": "text",
            "total": 1,
            "unit": "text"
          }
        ]
      },
      "resource": {
        "dimensions": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "name": "text",
        "resource_id": "text"
      },
      "total": 1
    }
  ],
  "min_compute_cost": 1,
  "org_id": "text",
  "other_cost": 1,
  "period": "text",
  "remaining_credit": 1,
  "support_cost": 1,
  "support_type": "text",
  "tier": "text",
  "total": 1,
  "total_compute_cost": 1,
  "total_storage_cost": 1,
  "undiscounted_compute_cost": 1,
  "unused_compute_commit": 1,
  "usage_days": 1
}

Export invoice to PDF

get
Authorizations
Path parameters
invoice_idstringRequired

Invoice identifier

Responses
200

OK

application/pdf
Responseinteger[]
get
GET /public/services/bcs/invoices/{invoice_id}/pdf HTTP/1.1
Host: api.skysql.com/
X-API-Key: YOUR_API_KEY
Accept: */*
[
  1
]

Was this helpful?