All URIs are relative to https://api.pay.jp
| Method | HTTP request | Description |
|---|---|---|
| create_customer | POST /v2/customers | Create Customer |
| delete_customer | DELETE /v2/customers/{customer_id} | Delete Customer |
| get_all_customers | GET /v2/customers | Get All Customers |
| get_customer | GET /v2/customers/{customer_id} | Get Customer |
| get_customer_payment_methods | GET /v2/customers/{customer_id}/payment_methods | Get Customer Payment Methods |
| update_customer | POST /v2/customers/{customer_id} | Update Customer |
CustomerResponse create_customer(customer_create_request)
Create Customer
- Basic Authentication (HTTPBasic):
- Bearer Authentication (HTTPBearer):
import payjpv2
from payjpv2.models.customer_create_request import CustomerCreateRequest
from payjpv2.models.customer_response import CustomerResponse
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.CustomersApi(api_client)
customer_create_request = payjpv2.CustomerCreateRequest() # CustomerCreateRequest |
try:
# Create Customer
api_response = api_instance.create_customer(customer_create_request)
print("The response of CustomersApi->create_customer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CustomersApi->create_customer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| customer_create_request | CustomerCreateRequest |
- Content-Type: application/json
- Accept: application/json, application/problem+json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
| 400 | Already Exists ID<br>Unsupported Payment Method Type<br>Payment Method Already Attached<br>Payment Method Customer Mismatch | - |
| 404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CustomerResponse delete_customer(customer_id)
Delete Customer
- Basic Authentication (HTTPBasic):
- Bearer Authentication (HTTPBearer):
import payjpv2
from payjpv2.models.customer_response import CustomerResponse
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.CustomersApi(api_client)
customer_id = 'customer_id_example' # str |
try:
# Delete Customer
api_response = api_instance.delete_customer(customer_id)
print("The response of CustomersApi->delete_customer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CustomersApi->delete_customer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| customer_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]
CustomerListResponse get_all_customers(limit=limit, starting_after=starting_after, ending_before=ending_before)
Get All Customers
- Basic Authentication (HTTPBasic):
- Bearer Authentication (HTTPBearer):
import payjpv2
from payjpv2.models.customer_list_response import CustomerListResponse
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.CustomersApi(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)
try:
# Get All Customers
api_response = api_instance.get_all_customers(limit=limit, starting_after=starting_after, ending_before=ending_before)
print("The response of CustomersApi->get_all_customers:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CustomersApi->get_all_customers: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | 取得するデータの最大件数 | [optional] [default to 10] |
| starting_after | str | このIDより後のデータを取得 | [optional] |
| ending_before | str | このIDより前のデータを取得 | [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]
CustomerResponse get_customer(customer_id)
Get Customer
- Basic Authentication (HTTPBasic):
- Bearer Authentication (HTTPBearer):
import payjpv2
from payjpv2.models.customer_response import CustomerResponse
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.CustomersApi(api_client)
customer_id = 'customer_id_example' # str |
try:
# Get Customer
api_response = api_instance.get_customer(customer_id)
print("The response of CustomersApi->get_customer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CustomersApi->get_customer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| customer_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]
PaymentMethodListResponse get_customer_payment_methods(customer_id, limit=limit, starting_after=starting_after, ending_before=ending_before)
Get Customer Payment Methods
- Basic Authentication (HTTPBasic):
- Bearer Authentication (HTTPBearer):
import payjpv2
from payjpv2.models.payment_method_list_response import PaymentMethodListResponse
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.CustomersApi(api_client)
customer_id = 'customer_id_example' # str |
limit = 10 # int | 取得するデータの最大件数 (optional) (default to 10)
starting_after = 'starting_after_example' # str | このIDより後のデータを取得 (optional)
ending_before = 'ending_before_example' # str | このIDより前のデータを取得 (optional)
try:
# Get Customer Payment Methods
api_response = api_instance.get_customer_payment_methods(customer_id, limit=limit, starting_after=starting_after, ending_before=ending_before)
print("The response of CustomersApi->get_customer_payment_methods:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CustomersApi->get_customer_payment_methods: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| customer_id | str | ||
| limit | int | 取得するデータの最大件数 | [optional] [default to 10] |
| starting_after | str | このIDより後のデータを取得 | [optional] |
| ending_before | str | このIDより前のデータを取得 | [optional] |
- Content-Type: Not defined
- Accept: application/json, application/problem+json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
| 404 | Not Found | - |
| 400 | Resource Missing | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CustomerResponse update_customer(customer_id, customer_update_request)
Update Customer
- Basic Authentication (HTTPBasic):
- Bearer Authentication (HTTPBearer):
import payjpv2
from payjpv2.models.customer_response import CustomerResponse
from payjpv2.models.customer_update_request import CustomerUpdateRequest
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.CustomersApi(api_client)
customer_id = 'customer_id_example' # str |
customer_update_request = payjpv2.CustomerUpdateRequest() # CustomerUpdateRequest |
try:
# Update Customer
api_response = api_instance.update_customer(customer_id, customer_update_request)
print("The response of CustomersApi->update_customer:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CustomersApi->update_customer: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| customer_id | str | ||
| customer_update_request | CustomerUpdateRequest |
- 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]