メインコンテンツまでスキップ

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.

Payment flow

Payment Flow Diagram

Universal Payment

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:
API_KEY
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 order_no is set when creating a PredefinedPayment, the order_no may be used later when updating or querying the PredefinedPayment.

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 -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

Content type
application/json
{
  • "predefined_payment": {
    },
  • "url": "string"
}

Callback payload samples

Callback
POST: Called after payment finished
Content type
application/json
{
  • "token": "string",
  • "partner_order_no": "string",
  • "payment_amount": 0,
  • "payment_method": "unionpay",
  • "payment_number": "string",
  • "payment_status": "string",
  • "payment_currency_info": {
    }
}

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:
API_KEY
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 order_no is set when creating a PredefinedPayment, the order_no may be used later when updating or querying the PredefinedPayment.

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 -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

Content type
application/json
{
  • "predefined_payment": {
    },
  • "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 true, associated_payments and value_added_services will be omitted from the PredefinedPayment response.

Responses

Request samples

curl 'https://stg.ribenmeishi.com/v3/predefined_payments/tk_ec0d312d184855103c82df1bddc20'

Response samples

Content type
application/json
{
  • "amount": 0,
  • "amount_total": 0,
  • "amount_vas": 0,
  • "associated_payments": [
    ],
  • "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": [
    ],
  • "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:
API_KEY
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 offset=10 will return the 10th, 11th, 12th and so on in the response.

limit
integer <int32>
Default: 10

Only return PredefinedPayments from this index. Say for example that, there are 10000 PredefinedPayments in total, and specifying offset=0 and limit=10 will return the first 10 elements in the response.

time_asc
boolean
Default: false

Whether to return PredefinedPayment results ordered by time ascending or descending. Please specify this parameter to be false if you wish the first result to be the newest payment.

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 create_time if you wish results to be ordered by create time, and update_time if you wish results to be ordered by update time.

order_no
string

order_no

Responses

Request samples

# 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

Content type
application/json
{
  • "count": 0,
  • "data": [
    ],
  • "offset": 0,
  • "total": 0
}

Update a PredefinedPayment

Authorizations:
API_KEY
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 order_no or token is required for updating the PredefinedPayment.

token
string

Either order_no or token is required for updating the PredefinedPayment.

Responses

Response samples

Content type
application/json
{
  • "predefined_payment": {
    },
  • "url": "string"
}

Get Available Payment Methods

Get Available Payment Methods for a specifc PredefinedPayment

path Parameters
token
required
string

token

Responses

Response samples

Content type
application/json
[
  • {
    }
]

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:
API_KEY
query Parameters
payment_number
required
string

The payment_number of a payment entity.

Responses

Request samples

## 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

Content type
application/json
{
  • "message": "string",
  • "payment": {
    },
  • "result_code": "2000"
}

WeChat Mini Program

API for WeChat Mini Program Payment Flow Diagram

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

Content type
application/json
{
  • "charge": {
    },
  • "id": "string",
  • "number": "string",
  • "payment": "WECHATPAY"
}

Authorization

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:
API_KEY

Responses

Request samples

## 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

Content type
application/json
{
  • "legal_person": {
    },
  • "shop": {
    },
  • "shop_device": {
    }
}