All URIs are relative to https://api.pay.jp
| Method | HTTP request | Description |
|---|---|---|
| create_tax_rate | POST /v2/tax_rates | Create Tax Rate |
| get_all_tax_rates | GET /v2/tax_rates | Get All Tax Rates |
| get_tax_rate | GET /v2/tax_rates/{tax_rate_id} | Get Tax Rate |
| update_tax_rate | POST /v2/tax_rates/{tax_rate_id} | Update Tax Rate |
TaxRateDetailsResponse create_tax_rate(tax_rate_create_request)
Create Tax Rate
- Basic Authentication (HTTPBasic):
- Bearer Authentication (HTTPBearer):
import payjpv2
from payjpv2.models.tax_rate_create_request import TaxRateCreateRequest
from payjpv2.models.tax_rate_details_response import TaxRateDetailsResponse
from payjpv2.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.pay.jp
# See configuration.py for a list of all supported configuration parameters.
configuration = payjpv2.Configuration(
host = "https://api.pay.jp"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: HTTPBasic
configuration = payjpv2.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure Bearer authorization: HTTPBearer
configuration = payjpv2.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with payjpv2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = payjpv2.TaxRatesApi(api_client)
tax_rate_create_request = payjpv2.TaxRateCreateRequest() # TaxRateCreateRequest |
try:
# Create Tax Rate
api_response = api_instance.create_tax_rate(tax_rate_create_request)
print("The response of TaxRatesApi->create_tax_rate:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TaxRatesApi->create_tax_rate: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| tax_rate_create_request | TaxRateCreateRequest |
- Content-Type: application/json
- Accept: application/json, application/problem+json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TaxRateListResponse get_all_tax_rates(limit=limit, starting_after=starting_after, ending_before=ending_before, active=active, inclusive=inclusive)
Get All Tax Rates
- Basic Authentication (HTTPBasic):
- Bearer Authentication (HTTPBearer):
import payjpv2
from payjpv2.models.tax_rate_list_response import TaxRateListResponse
from payjpv2.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.pay.jp
# See configuration.py for a list of all supported configuration parameters.
configuration = payjpv2.Configuration(
host = "https://api.pay.jp"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: HTTPBasic
configuration = payjpv2.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure Bearer authorization: HTTPBearer
configuration = payjpv2.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with payjpv2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = payjpv2.TaxRatesApi(api_client)
limit = 10 # int | 取得するデータの最大件数 (optional) (default to 10)
starting_after = 'starting_after_example' # str | このIDより後のデータを取得 (optional)
ending_before = 'ending_before_example' # str | このIDより前のデータを取得 (optional)
active = True # bool | この税率が有効であるかどうか。無効にした場合でも、すでに設定されている定期課金などでは使用可能です。 (optional)
inclusive = True # bool | 税込みかどうか。税込 = `true` 税抜 = `false` (optional)
try:
# Get All Tax Rates
api_response = api_instance.get_all_tax_rates(limit=limit, starting_after=starting_after, ending_before=ending_before, active=active, inclusive=inclusive)
print("The response of TaxRatesApi->get_all_tax_rates:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TaxRatesApi->get_all_tax_rates: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | 取得するデータの最大件数 | [optional] [default to 10] |
| starting_after | str | このIDより後のデータを取得 | [optional] |
| ending_before | str | このIDより前のデータを取得 | [optional] |
| active | bool | この税率が有効であるかどうか。無効にした場合でも、すでに設定されている定期課金などでは使用可能です。 | [optional] |
| inclusive | bool | 税込みかどうか。税込 = `true` 税抜 = `false` | [optional] |
- Content-Type: Not defined
- Accept: application/json, application/problem+json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
| 400 | Resource Missing | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TaxRateDetailsResponse get_tax_rate(tax_rate_id)
Get Tax Rate
- Basic Authentication (HTTPBasic):
- Bearer Authentication (HTTPBearer):
import payjpv2
from payjpv2.models.tax_rate_details_response import TaxRateDetailsResponse
from payjpv2.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.pay.jp
# See configuration.py for a list of all supported configuration parameters.
configuration = payjpv2.Configuration(
host = "https://api.pay.jp"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: HTTPBasic
configuration = payjpv2.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure Bearer authorization: HTTPBearer
configuration = payjpv2.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with payjpv2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = payjpv2.TaxRatesApi(api_client)
tax_rate_id = 'tax_rate_id_example' # str |
try:
# Get Tax Rate
api_response = api_instance.get_tax_rate(tax_rate_id)
print("The response of TaxRatesApi->get_tax_rate:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TaxRatesApi->get_tax_rate: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| tax_rate_id | str |
- Content-Type: Not defined
- Accept: application/json, application/problem+json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
| 404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TaxRateDetailsResponse update_tax_rate(tax_rate_id, tax_rate_update_request)
Update Tax Rate
- Basic Authentication (HTTPBasic):
- Bearer Authentication (HTTPBearer):
import payjpv2
from payjpv2.models.tax_rate_details_response import TaxRateDetailsResponse
from payjpv2.models.tax_rate_update_request import TaxRateUpdateRequest
from payjpv2.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.pay.jp
# See configuration.py for a list of all supported configuration parameters.
configuration = payjpv2.Configuration(
host = "https://api.pay.jp"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: HTTPBasic
configuration = payjpv2.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Configure Bearer authorization: HTTPBearer
configuration = payjpv2.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with payjpv2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = payjpv2.TaxRatesApi(api_client)
tax_rate_id = 'tax_rate_id_example' # str |
tax_rate_update_request = payjpv2.TaxRateUpdateRequest() # TaxRateUpdateRequest |
try:
# Update Tax Rate
api_response = api_instance.update_tax_rate(tax_rate_id, tax_rate_update_request)
print("The response of TaxRatesApi->update_tax_rate:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TaxRatesApi->update_tax_rate: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| tax_rate_id | str | ||
| tax_rate_update_request | TaxRateUpdateRequest |
- Content-Type: application/json
- Accept: application/json, application/problem+json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
| 404 | Not Found | - |
| 400 | Metadata Limit Exceeded | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]