BillingGroup

請求グループのAPIリファレンスは以下の通りです。

Create

請求グループの作成

Role actions

  • ModifyBillingGroup

Request

POST /billinggroup HTTP1.1
Authorization: Bearer {token}
Content-Type: application/json

{request body}

以下に{request body}のリクエストペイロードの例を示します。

{request body}

{
    "billinggroup_id":"Billing1",
    "billinggroup_name":"Billing1",
    "company_name":"Billing1 company",
    "phone":"03‐1234‐5678",
    "postal":"12345",
    "address":"123 street",
    "billing_title":"billing title",
    "personal":"personal name",
    "remarks":"test automation",
    "inv_aggregate":false,
    "language":"ja",
    "invoices": {
        "aws": {
            "calc_type":"account",
            "currency":"jpy",
            "discount_calc_logic":"usageamount",
            "discount_rate":0,
            "discount_target_usage":"cloudpaywithfee",
            "substitution_fee":"percent",
            "substitution_fee_calc_target":"nondiscount",
            "substitution_fee_calc_type":"allsum",
            "substitution_fee_target_usage":"cloudpaywithfee",
            "substitution_fix":0,
            "substitution_rate":0,
            "support_amount_target":"allusage",
            "support_fee":"fix",
            "support_fee_calc_target":"nondiscount",
            "support_fix":0,
            "support_rate":0,
            "tax_rate":0
        }
  }
}

{request body} description

invoices object description

Response

HTTP 200

{
    "status":"success",
    "company_id":"RomwoEjdjhws",
    "billinggroup_id":"Billing1"
}

Pythonでのサンプル

import requests
import json

def get_token():
    # Note: you can see details https://docs.alphaus.cloud/v/api-reference/authentication
    # Assign generated values for client_id and client_secret
    params={
        "grant_type": "client_credentials",
        "client_id": "{client_id}",
        "client_secret": "{client_secret}",
        "scope": "openid",
    }
    try:
        response = requests.post(
            url="https://login.alphaus.cloud/ripple/access_token",
            headers={
            },
            params=params,
            files=params,
        )
    except requests.exceptions.RequestException:
        print('HTTP Request failed')

    r = response.json()
    return r['access_token'], r["token_type"]

def send_request(type, token):
    # Authorization header
    auth = type + " " + token
    try:
        response = requests.post(
            url="https://api.alphaus.cloud/m/ripple/billinggroup",
            headers={
                "Content-Type": "application/json;",
                "Authorization": auth
            },
            data=json.dumps({
                "display_cost": "true_unblended_cost",
                "phone": None,
                "billinggroup_id": "BG-SAMPLE-01",
                "billinggroup_name": "BG-SAMPLE-01",
                "inv_aggregate": True,
                "personal": None,
                "exchange_rate_type": None,
                "company_name": "BG-SAMPLE-01",
                "postal": None,
                "address": None,
                "billing_title": None,
                "remarks": None
            })
        )
        print('Response HTTP Status Code: {status_code}'.format(
            status_code=response.status_code))
        print('Response HTTP Response Body: {content}'.format(
            content=response.content))
    except requests.exceptions.RequestException:
        print('HTTP Request failed')

access_token, token_type = get_token()
send_request(token_type, access_token)

List

請求グループリストの取得

Role actions

  • ReadBillingGroup

  • ModifyBillingGroup

Request

GET /billinggroup HTTP1.1
Authorization: Bearer {token}

Response

HTTP 200

[
    {
    "company_id":"RomwoEjdjhws",
    "billinggroup_id":"Billing1",
    "billinggroup_name":"Billing1",
    "name":"Billing1 Company",
    "invoices":{
        "aws": {
            "calc_type":"account",
            "currency":"jpy",
            "discount_calc_logic":"usageamount",
            "discount_rate":0,
            "discount_target_usage":"cloudpaywithfee",
            "substitution_fee":"percent",
            "substitution_fee_calc_target":"nondiscount",
            "substitution_fee_calc_type":"allsum",
            "substitution_fee_target_usage":"cloudpaywithfee",
            "substitution_fix":0,
            "substitution_rate":0,
            "support_amount_target":"allusage",
            "support_fee":"fix",
            "support_fee_calc_target":"nondiscount",
            "support_fix":0,
            "support_rate":0,
            "tax_rate":0
        }
        "azure": {
            "calc_type":"account",
            "currency":"jpy",
            "discount_calc_logic":"usageamount",
            "discount_rate":0,
            "discount_target_usage":"cloudpaywithfee",
            "substitution_fee":"percent",
            "substitution_fee_calc_target":"nondiscount",
            "substitution_fee_calc_type":"allsum",
            "substitution_fee_target_usage":"cloudpaywithfee",
            "substitution_fix":0,
            "substitution_rate":0,
            "support_amount_target":"allusage",
            "support_fee":"fix",
            "support_fee_calc_target":"nondiscount",
            "support_fix":0,
            "support_rate":0,
            "tax_rate":0
        }
    },
    "contact":"personal name",
    "address":"123 street",
    "postal":"12345",
    "phone":"03‐1234‐5678",
    "title":null,
    "req_generate":null,
    "remarks":null,
    "inv_aggregate":null,
    "project_id":null,
    "project_code":null,
    "project_label":null,
    "project_currency":null,
    "language":"ja",
    "qrcode":false,
    "invoice_template_id":null,
    "custom_fields":null,
    "untagged_groups":null,
    "account":[],
    "tag":[]
    },
    ...
]

List details

請求グループ詳細の取得

Role actions

  • ReadBillingGroup

  • ModifyBillingGroup

Request

GET /billinggroup/{id}/resource HTTP1.1
Authorization: Bearer {token}

リクエストパラーメータの{id}は請求グループ内部ID{company_id}です

Response

HTTP 200

{
    "company_id":"RomwoEjdjhws",
    "billinggroup_id":"Billing1",
    "billinggroup_name":"Billing1",
    "name":"Billing1 Company",
    "invoices":{
        "aws": {
            "calc_type":"account",
            "currency":"jpy",
            "discount_calc_logic":"usageamount",
            "discount_rate":0,
            "discount_target_usage":"cloudpaywithfee",
            "substitution_fee":"percent",
            "substitution_fee_calc_target":"nondiscount",
            "substitution_fee_calc_type":"allsum",
            "substitution_fee_target_usage":"cloudpaywithfee",
            "substitution_fix":0,
            "substitution_rate":0,
            "support_amount_target":"allusage",
            "support_fee":"fix",
            "support_fee_calc_target":"nondiscount",
            "support_fix":0,
            "support_rate":0,
            "tax_rate":0
        }
        "azure": {
            "calc_type":"account",
            "currency":"jpy",
            "discount_calc_logic":"usageamount",
            "discount_rate":0,
            "discount_target_usage":"cloudpaywithfee",
            "substitution_fee":"percent",
            "substitution_fee_calc_target":"nondiscount",
            "substitution_fee_calc_type":"allsum",
            "substitution_fee_target_usage":"cloudpaywithfee",
            "substitution_fix":0,
            "substitution_rate":0,
            "support_amount_target":"allusage",
            "support_fee":"fix",
            "support_fee_calc_target":"nondiscount",
            "support_fix":0,
            "support_rate":0,
            "tax_rate":0
        }
    },
    "contact":"personal name",
    "address":"123 street",
    "postal":"12345",
    "phone":"03‐1234‐5678",
    "title":null,
    "req_generate":null,
    "remarks":null,
    "inv_aggregate":null,
    "project_id":null,
    "project_code":null,
    "project_label":null,
    "project_currency":null,
    "language":"ja",
    "qrcode":false,
    "invoice_template_id":null,
    "custom_fields":null,
    "untagged_groups":null,
    "account":[],
    "tag":[]
}

Update

請求グループ情報の更新

Role actions

  • ModifyBillingGroup

Request

POST /billinggroup/{id} HTTP1.1
Authorization: Bearer {token}
Content-Type: application/json

{request body}

以下に{request body}のリクエストペイロードの例を示します。

{request body}

{
    "billinggroup_id":"Billing1",
    "billinggroup_name":"Billing1",
    "company_name":"Billing1 Company",
    "phone":"03-123-4567",
    "postal":"1243",
    "address":"updateed address",
    "billing_title":null,
    "personal":"Personal name",
    "remarks":"Some remarks data",
    "inv_aggregate":false,
    "project_id":"{created_project_id}",
    "language": "ja"
}

Response

HTTP 200

{"status":"success"}

Update invoice setting

請求グループ請求書設定の更新

Role actions

  • ModifyBillingGroup

Request

POST /billinggroup/{id}/invoices HTTP1.1
Authorization: Bearer {token}
Content-Type: application/json

{request body}

以下に{request body}のリクエストペイロードの例を示します。

{request body}

{
  "invoices": {
    "calc_type":"account",
    "currency":"jpy",
    "discount_calc_logic":"usageamount",
    "discount_rate":0,
    "discount_target_usage":"cloudpaywithfee",
    "substitution_fee":"percent",
    "substitution_fee_calc_target":"nondiscount",
    "substitution_fee_calc_type":"allsum",
    "substitution_fee_target_usage":"cloudpaywithfee",
    "substitution_fix":0,
    "substitution_rate":0,
    "support_amount_target":"allusage",
    "support_fee":"fix",
    "support_fee_calc_target":"nondiscount",
    "support_fix":0,
    "support_rate":0,
    "tax_rate":0.10
  },
  "vendor":"{vendor}"
}

Response

HTTP 200

{"status":"success"}

Update free format

請求グループその他費用の追加・更新

Role actions

  • ModifyBillingGroup

Request

POST /billinggroup/{id}/freeformat/{vendor} HTTP1.1
Authorization: Bearer {token}
Content-Type: application/json

{request body}

リクエストパラーメータの{id}は請求グループ内部ID{company_id}です。

以下に{request body}のリクエストペイロードの例を示します。

{request body}

{
    "additional_items":[
    {
        "enabled":true,
        "label":"testlabel",
        "unit_cost":1,
        "quantity":10000,
        "total":10000
    }
]
}

additional_items object description

Response

HTTP 200

{"status":"success"}

Delete free format

請求グループその他費用の削除

Role actions

  • ModifyBillingGroup

Request

DELETE /billinggroup/{id}/freeformat/{vendor} HTTP1.1
Authorization: Bearer {token}
Content-Type: application/json

リクエストパラーメータの{id}は請求グループ内部ID{company_id}です。

請求グループに追加されているその他費用を全て削除します。

Response

HTTP 200

{"status":"success"}

Update Invoice Template

請求グループ請求テンプレートの更新

Role actions

  • ModifyBillingGroup

Request

POST /billinggroup/{id}/invoicetemplate HTTP1.1
Authorization: Bearer {token}
Content-Type: application/json

{request body}

リクエストパラーメータの{id}は請求グループ内部ID{company_id}です

以下に{request body}のリクエストペイロードの例を示します。

{request body}

{
    "invoice_template_id": "abcdefg"
}

Response

HTTP 200

{"status":"success"}

Delete

請求グループの削除

Role actions

  • ModifyBillingGroup

Request

DELETE /billinggroup/{id} HTTP1.1
Authorization: Bearer {token}

Response

HTTP 200

{"status":"success"}

Last updated