TakeMe Pay Universal Payment API (1.0)
This documentation covers creating a PredefinedPayment, updating a PredefinedPayment, querying the status of a PredefinedPayment and querying for all the PredefinedPayments within a specific time range.
Create a PredefinedPayment for online usage.
This API creates a PredefinedPayment under the 'online_payment' PaymentInterface. Upon successful creation, the PredefinedPayment will be returned together with a URL for performing checkout. Refer to create_with_url_print for offline scenarios.
Authorizations:
query Parameters
amount required | integer <int32> Amount of the PredefinedPayment to create, in Japanese Yen. The amount should be greater than or equal to 50 Yen. |
custom | string A customizable field to attach to the created PredefinedPayment. |
expires_after | integer <int32> The duration, in seconds, after which the created PredefinedPayment would expire. |
order_no | string An optional order number in the client system. If |
redirection_url | string URL of the webpage / website to redirect to after payment was finished. |
webhook_callback_url | string URL of webhook to call to after payment was finished. |
tip_vas_enabled | boolean Whether Tip feature should be enabled for this PredefinedPayment. |
Responses
Callbacks
Request samples
- curl
curl -X 'POST' 'https://stg.ribenmeishi.com/v3/predefined_payments/create_online_payment' \ -H 'X-Auth-API-Key: {{ YOUR_API_KEY_HERE }}' \ -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \ --data-urlencode 'amount=50' \ --data-urlencode 'custom=座席番号001' \ --data-urlencode 'redirection_url=https://www.example.com' \ --data-urlencode 'expires_after=3600'
Response samples
- 200
{- "predefined_payment": {
- "amount": 0,
- "amount_total": 0,
- "amount_vas": 0,
- "associated_payments": [
- {
- "datetime": 1669970830000,
- "update_time": "2022-12-02T17:46:56.000+09",
- "amount": 0,
- "history": [
- {
- "operation_time": "2019-08-24T14:15:22Z",
- "status": 0
}
], - "id": "string",
- "payment": "string",
- "payment_method": "string",
- "payment_number": "string",
- "shop_number": "string",
- "status": 0,
- "type": "string"
}
], - "custom": "string",
- "expired": true,
- "fulfilled": true,
- "invalidated": true,
- "order_no": "string",
- "payment": "string",
- "payment_method": "unionpay",
- "payment_interface": "user_scan",
- "redirection_url": "string",
- "shop_id": "2abd8c70-add7-11e9-9c8d-06e3f0309cbd",
- "started": true,
- "token": "tk_7778ae388f7510a7e008ba06efc19",
- "value_added_services": [
- {
- "comment": "string",
- "items": [
- { }
], - "state": "string",
- "type": "string",
- "create_time": "2022-12-02T17:46:56.000+09",
- "update_time": "2022-12-02T17:46:56.000+09",
- "createTime": 1669970830000,
- "updateTime": 1669970830000
}
], - "create_time": "2022-12-02T17:46:56.000+09",
- "update_time": "2022-12-02T17:46:56.000+09",
- "createTime": 1669970830000,
- "updateTime": 1669970830000
}, - "url": "string"
}
Callback payload samples
{- "token": "string",
- "partner_order_no": "string",
- "payment_amount": 0,
- "payment_method": "unionpay",
- "payment_number": "string",
- "payment_status": "string",
- "payment_currency_info": {
- "countryCode": "string",
- "currencyCode": "string",
- "exchangeRate": 0,
- "amountLocal": 0,
- "amountPaidLocal": 0
}
}
Create a PredefinedPayment for offline usage.
This API creates a PredefinedPayment under the 'dynamic_qr_print' PaymentInterface. Upon successful creation, the PredefinedPayment will be returned together with a URL for performing checkout. Refer to create_online_payment for online scenarios.
Authorizations:
query Parameters
amount required | integer <int32> Amount of the PredefinedPayment to create, in Japanese Yen. The amount should be greater than or equal to 50 Yen. |
custom | string A customizable field to attach to the created PredefinedPayment. |
expires_after | integer <int32> The duration, in seconds, after which the created PredefinedPayment would expire. |
order_no | string An optional order number in the client system. If |
redirection_url | string URL of the webpage / website to redirect to after payment was finished. |
webhook_callback_url | string URL of webhook to call to after payment was finished. |
tip_vas_enabled | boolean Whether Tip feature should be enabled for this PredefinedPayment. |
Responses
Request samples
- curl
curl -X 'POST' 'https://stg.ribenmeishi.com/v3/predefined_payments/create_with_url_print' \ -H 'X-Auth-API-Key: {{ YOUR_API_KEY_HERE }}' \ -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \ --data-urlencode 'amount=50' \ --data-urlencode 'custom=座席番号001' \ --data-urlencode 'redirection_url=https://www.example.com' \ --data-urlencode 'expires_after=3600'
Response samples
- 200
{- "predefined_payment": {
- "amount": 0,
- "amount_total": 0,
- "amount_vas": 0,
- "associated_payments": [
- {
- "datetime": 1669970830000,
- "update_time": "2022-12-02T17:46:56.000+09",
- "amount": 0,
- "history": [
- {
- "operation_time": "2019-08-24T14:15:22Z",
- "status": 0
}
], - "id": "string",
- "payment": "string",
- "payment_method": "string",
- "payment_number": "string",
- "shop_number": "string",
- "status": 0,
- "type": "string"
}
], - "custom": "string",
- "expired": true,
- "fulfilled": true,
- "invalidated": true,
- "order_no": "string",
- "payment": "string",
- "payment_method": "unionpay",
- "payment_interface": "user_scan",
- "redirection_url": "string",
- "shop_id": "2abd8c70-add7-11e9-9c8d-06e3f0309cbd",
- "started": true,
- "token": "tk_7778ae388f7510a7e008ba06efc19",
- "value_added_services": [
- {
- "comment": "string",
- "items": [
- { }
], - "state": "string",
- "type": "string",
- "create_time": "2022-12-02T17:46:56.000+09",
- "update_time": "2022-12-02T17:46:56.000+09",
- "createTime": 1669970830000,
- "updateTime": 1669970830000
}
], - "create_time": "2022-12-02T17:46:56.000+09",
- "update_time": "2022-12-02T17:46:56.000+09",
- "createTime": 1669970830000,
- "updateTime": 1669970830000
}, - "url": "string"
}
Retrieve a PredefinedPayment
Retrieve a PredefinedPayment by its token. The token
can by found in the predefined_payment
object when a PredefinedPayment is created.
path Parameters
token required | string token of the PredefinedPayment |
query Parameters
simple | boolean Default: false Whether or not to return a simplified version of the specified PredefinedPayment. If this parameter is set to |
Responses
Request samples
- curl
curl 'https://stg.ribenmeishi.com/v3/predefined_payments/tk_ec0d312d184855103c82df1bddc20'
Response samples
- 200
{- "amount": 0,
- "amount_total": 0,
- "amount_vas": 0,
- "associated_payments": [
- {
- "datetime": 1669970830000,
- "update_time": "2022-12-02T17:46:56.000+09",
- "amount": 0,
- "history": [
- {
- "operation_time": "2019-08-24T14:15:22Z",
- "status": 0
}
], - "id": "string",
- "payment": "string",
- "payment_method": "string",
- "payment_number": "string",
- "shop_number": "string",
- "status": 0,
- "type": "string"
}
], - "custom": "string",
- "expired": true,
- "fulfilled": true,
- "invalidated": true,
- "order_no": "string",
- "payment": "string",
- "payment_method": "unionpay",
- "payment_interface": "user_scan",
- "redirection_url": "string",
- "shop_id": "2abd8c70-add7-11e9-9c8d-06e3f0309cbd",
- "started": true,
- "token": "tk_7778ae388f7510a7e008ba06efc19",
- "value_added_services": [
- {
- "comment": "string",
- "items": [
- { }
], - "state": "string",
- "type": "string",
- "create_time": "2022-12-02T17:46:56.000+09",
- "update_time": "2022-12-02T17:46:56.000+09",
- "createTime": 1669970830000,
- "updateTime": 1669970830000
}
], - "create_time": "2022-12-02T17:46:56.000+09",
- "update_time": "2022-12-02T17:46:56.000+09",
- "createTime": 1669970830000,
- "updateTime": 1669970830000
}
Retrieve all the PredefinedPayments
Authorizations:
query Parameters
time_start | integer <int64> Starting time of query, in UNIX timestamp milliseconds. Only PredefinedPayments created after this timestamp will be returned by the query. |
time_end | integer <int64> Ending time of query, in UNIX timestamp milliseconds. Only PredefinedPayments created before this timestamp will be returned by the query. |
offset | integer <int32> Example: offset=0 Only return PredefinedPayments from this index. Say for example that, there are 10000 PredefinedPayments in total, and specifying |
limit | integer <int32> Default: 10 Only return PredefinedPayments from this index. Say for example that, there are 10000 PredefinedPayments in total, and specifying |
time_asc | boolean Default: false Whether to return PredefinedPayment results ordered by time ascending or descending. Please specify this parameter to be |
order_by | string Default: "create_time" Specify whether to order PredefinedPayments by their time of creation or time of update. Please specify this parameter to be |
order_no | string order_no |
Responses
Request samples
- curl
# Query all PredefinedPayments that were created after # Tuesday, December 1, 2020 12:00:00 AM GMT, # and fetch the first 20 entries curl 'https://stg.ribenmeishi.com/v3/predefined_payments?time_start=1606780800000&offset=0&limit=20' \ -H 'X-Auth-API-Key: {{ YOUR_API_KEY_HERE }}'
Response samples
- 200
{- "count": 0,
- "data": [
- {
- "amount": 0,
- "amount_total": 0,
- "amount_vas": 0,
- "associated_payments": [
- {
- "datetime": 1669970830000,
- "update_time": "2022-12-02T17:46:56.000+09",
- "amount": 0,
- "history": [
- {
- "operation_time": "2019-08-24T14:15:22Z",
- "status": 0
}
], - "id": "string",
- "payment": "string",
- "payment_method": "string",
- "payment_number": "string",
- "shop_number": "string",
- "status": 0,
- "type": "string"
}
], - "custom": "string",
- "expired": true,
- "fulfilled": true,
- "invalidated": true,
- "order_no": "string",
- "payment": "string",
- "payment_method": "unionpay",
- "payment_interface": "user_scan",
- "redirection_url": "string",
- "shop_id": "2abd8c70-add7-11e9-9c8d-06e3f0309cbd",
- "started": true,
- "token": "tk_7778ae388f7510a7e008ba06efc19",
- "value_added_services": [
- {
- "comment": "string",
- "items": [
- { }
], - "state": "string",
- "type": "string",
- "create_time": "2022-12-02T17:46:56.000+09",
- "update_time": "2022-12-02T17:46:56.000+09",
- "createTime": 1669970830000,
- "updateTime": 1669970830000
}
], - "create_time": "2022-12-02T17:46:56.000+09",
- "update_time": "2022-12-02T17:46:56.000+09",
- "createTime": 1669970830000,
- "updateTime": 1669970830000
}
], - "offset": 0,
- "total": 0
}
Update a PredefinedPayment
Authorizations:
query Parameters
custom | string A customizable field to attach to the created PredefinedPayment. |
expires_after | integer <int32> The duration, in seconds, after which the created PredefinedPayment would expire. |
invalidated | boolean |
redirection_url | string URL of the webpage / website to redirect to after payment was finished. |
tip_vas_enabled | boolean Whether Tip feature should be enabled for this PredefinedPayment. |
order_no | string Either |
token | string Either |
Responses
Response samples
- 200
{- "predefined_payment": {
- "amount": 0,
- "amount_total": 0,
- "amount_vas": 0,
- "associated_payments": [
- {
- "datetime": 1669970830000,
- "update_time": "2022-12-02T17:46:56.000+09",
- "amount": 0,
- "history": [
- {
- "operation_time": "2019-08-24T14:15:22Z",
- "status": 0
}
], - "id": "string",
- "payment": "string",
- "payment_method": "string",
- "payment_number": "string",
- "shop_number": "string",
- "status": 0,
- "type": "string"
}
], - "custom": "string",
- "expired": true,
- "fulfilled": true,
- "invalidated": true,
- "order_no": "string",
- "payment": "string",
- "payment_method": "unionpay",
- "payment_interface": "user_scan",
- "redirection_url": "string",
- "shop_id": "2abd8c70-add7-11e9-9c8d-06e3f0309cbd",
- "started": true,
- "token": "tk_7778ae388f7510a7e008ba06efc19",
- "value_added_services": [
- {
- "comment": "string",
- "items": [
- { }
], - "state": "string",
- "type": "string",
- "create_time": "2022-12-02T17:46:56.000+09",
- "update_time": "2022-12-02T17:46:56.000+09",
- "createTime": 1669970830000,
- "updateTime": 1669970830000
}
], - "create_time": "2022-12-02T17:46:56.000+09",
- "update_time": "2022-12-02T17:46:56.000+09",
- "createTime": 1669970830000,
- "updateTime": 1669970830000
}, - "url": "string"
}
API for refunding a Payment
Please note that this API requires a payment number. The payments that are created by a PredefinedPayment is usually found by querying a PredefinedPayment and following the JSON path $.associated_payments
. Each payment contains a field payment_number
, and that is the parameter needed for this refund API.
Authorizations:
query Parameters
payment_number required | string The |
Responses
Request samples
- curl
## Payment Refund curl -X 'POST' 'https://stg.ribenmeishi.com/v3/universal_payments/refund' \ -H 'X-Auth-API-Key: {{ YOUR_API_KEY_HERE }}' \ -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \ --data-urlencode 'payment_number={{ PAYMENT_NUMBER }}'
Response samples
- 200
{- "message": "string",
- "payment": {
- "datetime": 1669970830000,
- "update_time": "2022-12-02T17:46:56.000+09",
- "amount": 0,
- "history": [
- {
- "operation_time": "2019-08-24T14:15:22Z",
- "status": 0
}
], - "id": "string",
- "payment": "string",
- "payment_method": "string",
- "payment_number": "string",
- "shop_number": "string",
- "status": 0,
- "type": "string"
}, - "result_code": "2000"
}
Create payment request for mini program
path Parameters
token required | string token of the PredefinedPayment |
number required | string number of payment entity |
query Parameters
openid | string OpenID of login info |
appid | string Mini program app ID |
Responses
Response samples
- 200
- 400
{- "charge": {
- "timeStamp": "string",
- "nonceStr": "string",
- "package": "string",
- "signType": "string",
- "paySign": "string"
}, - "id": "string",
- "number": "string",
- "payment": "WECHATPAY"
}
API for Key validation
You may utilize this API for checking whether your API Key is valid, or to test connection to TakeMe servers.
Authorizations:
Responses
Request samples
- curl
## whoami curl 'https://stg.ribenmeishi.com/v3/api_keys/whoami' \ -H 'X-Auth-API-Key: {{ YOUR_API_KEY_HERE }}' \ -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
Response samples
- 200
{- "legal_person": {
- "companyEmail": "string",
- "companyName": "string",
- "contractDate": "2019-08-24T14:15:22Z",
- "contractNumber": "string",
- "id": "string"
}, - "shop": {
- "id": "string",
- "is_payable": true,
- "name": "string",
- "name_ja": "string",
- "number": "string",
- "review_enabled": true
}, - "shop_device": {
- "createTime": "2019-08-24T14:15:22Z",
- "deviceName": "string",
- "deviceNumber": "string",
- "devicePushNotificationChannel": "string",
- "devicePushNotificationToken": "string",
- "deviceType": "string",
- "disabled": true,
- "id": "string",
- "mobileDevicePreferredLanguage": "string",
- "parentShop": "string",
- "updateTime": "2019-08-24T14:15:22Z"
}
}