Transaction tokens: Create
Application token secret is required for this route
Request
POST https://api.univapay.com/tokens
Parameters:
Parameters | |
payment_type | string [Required] See payment methods. |
type | string See token types. Certain payment methods may restrict the type. If set to recurring , and your account does not have permission to make an infinitely chargable token, you must supply the usage_limit parameter. |
usage_limit | string How often the token can be used if it is recurring . If you have permission to create infinitely chargable recurring tokens, this can be left blank. |
string [Required] Email address Optional for online payments | |
ip_address | string [Conditional] The IPv4 address of the customer’s device. The following payment providers require this parameter: – we_chat_online (web , http_get ) |
metadata | object See metadata. |
metadata.univapay-customer-id | string (UUID) metadata.univapay-customer-id |
data | object [Required] See card data for card , Apple Pay data for apple_pay , qr scan data for qr_scan and convienence store data for konbini payment type. |
Card data
Parameters | |
data.cardholder | string [Required] The cardholder’s name. |
data.card_number | string [Required] The card number. |
data.exp_month | string [Required] The card’s expiration month. |
data.exp_year | string [Required] The card’s expiration year. |
data.cvv | string [Required] The card’s CVV value. |
data.line1 | string The address for the card (line 1). |
data.line2 | string The address for the card (line 2). |
data.state | string The address for the card (state name). |
data.city | string The address for the card (city name). |
data.country | string The address for the card (country code, in ISO 3166-1 alpha-2 format). |
data.zip | string The address for the card (zip code). |
data.phone_number.country_code | string The phone number for the card (country code). |
data.phone_number.local_number | string The phone number for the card. |
cvv_authorize.enabled | boolean Set to true to enable the feature. Defaults to false. |
cvv_authorize.currency | string (ISO-4217) Sets the currency to make the authorization in. Defaults to the merchant base currency. |
Apple Pay data
Parameters | |
data.applepay_token | string [Required] The Apple Pay token. |
data.cardholder | string [Required] The cardholder’s name. |
data.line1 | string The address for the card (line 1). |
data.line2 | string The address for the card (line 2). |
data.state | string The address for the card (state name). |
data.city | string The address for the card (city name). |
data.country | string The address for the card (country code, in ISO 3166-1 alpha-2 format). |
data.zip | string The address for the card (zip code). |
data.phone_number.country_code | string The phone number for the card (country code). |
data.phone_number.local_number | string The phone number for the card. |
QR CPM data
Parameters | |
data.scanned_qr | string [Required] The scanned QR code from the user’s wallet app. |
QR MPM data
Parameters | |
data.brand | string [Required] The payments brand to use. Valid values include: – alipay_merchant_qr Alipay China– pay_pay_merchant Pay Pay– we_chat_mpm WeChat Pay |
Convenience store data
Parameters | |
data.customer_name | string [Required] The customer’s name. |
data.phone_number.country_code | string [Required] The country code of the phone number. Only Japanese numbers are accepted. |
data.phone_number.local_number | string [Required] The customer’s phone number. |
data.convenience_store | string [Required] The convenience store the customer has selected to make payment at. Only the following are accepted values seven_eleven , family_mart , lawson , mini_stop , seico_mart , pay_easy , circle_k , sunkus , daily_yamazaki , yamazaki_daily_store . |
data.expiration_period | string (ISO-8601 Duration) The payment expiration date. Minimum 30 minutes and maximum 30 days from the date of creation with 30 days as default if not supplied. Example: P7D |
data.expiration_time_shift | string (ISO-8601 Time with Timezone) The time to set for the payment after taking into account the expiration_period for this payment. For example, if the expiration after adding expiration_period is 2023-06-01T15:00:00+09:00 and expiration_time_shift is set as 09:00:00+09:00 then the final expiration will be set as 2023-06-01T09:00:00+09:00 .*When this field is set, expiration_period must be at least 1 day.Available only for convenience store payment. *This parameter is invalid forFor “7-Eleven” and “Seicomart”/Other Payments (“Circle K”/”Sunkus”/”Pay-easy”) because the time specification is not available. |
Online payments data
Parameters | |
data.brand | string [Required] The payment brand to use. Valid values include: – alipay_online Alipay China– alipay_plus_online Alipay+– pay_pay_online Pay Pay– we_chat_online WeChat Pay |
data.call_method | string [Required] The execution method requested by the client. Is one of http_get , http_get_mobile , http_post , sdk , web , app .– sdk refers to usage directly in a SDK provided by the payment provider.– web refers to usage directly in a special browser environment with specific API extensions.– app refers to usage in a native app environment in a SDK provided by the payment provider.– http_get or http_post , the issuer_token can be directly executed in a new browser window or in an iframe with the correct corresponding HTTP method.– http_get_mobile is the same as http_get but will return a page specific for mobile browsersThe following brands support the following call methods: – alipay_online: http_get , sdk (miniapp), app – alipay_plus_online: http_get , http_get_mobile , sdk (miniapp), app – pay_pay_online: http_post – we_chat_online: http_get (H5), sdk (miniapp), app (in-app), web (official account) |
data.user_identifier | string [Conditional] A unique user identifier, usually provided by the payments gateway application that can uniquely identify a user device. This is a requirement by certain payment providers to prevent fraud. The following brands for these call methods require the user identifier to be provided: – we_chat_online : sdk (miniapp), web (official account) |
data.os_type | string [Conditional] The OS of the underlying mobile device. Valid values include: – android – ios The following brands require the os type to be provided: – alipay_plus_online : http_get_mobile , app |
Bank transfer payment data
Parameters | |
data.brand | string [Required] The payment brand to use. Valid values include: – aozora_bank GMO Aozora Net Bank |
data.match_amount | string [Optional] The algorithm for matching on the transferred amount. This has precedence over your store/merchant setting. One of the following values: – disabled : The transferred amount matching is disabled.– exact : The transferred amount must match.– exact : The transferred amount must match otherwise the transfer is rejected by the bank.– minimum : The transferred amount must be at least the requested amount otherwise the transfer is rejected by the bank.– maximum : The transferred amount must be less than or equals to the requested amount otherwise the transfer is rejected by the bank. |
data.expiration_period | ISO8601 Duration [Optional] The period of time before the charge request expires. E.g. Expire after 7 days: P7D |
data.expiration_time_shift | ISO8601 Time with time zone [Optional] Shifts the expiration to a specific time after data.expiration_period is applied.This field is only valid if data.expiration_period is populated.E.g. If a charge was created at 2022-07-01T15:00:00Z and the expiration period was P7D , the following time shifts will produce the following expirations:– 09:15:00+09:00 ⇒ 2022-07-08T09:15:00+09:00 – 09:15:00Z ⇒ 2022-07-07T09:15:00Z |
Headers:
Authorization: Bearer {jwt}
Content-Type: application/json
Body:
curl --request POST \
--url https://api.univapay.com/tokens \
--header 'Authorization: Bearer {secret}.{jwt}' \
--header 'Content-type: application/json' \
--data "{
\"payment_type\": \"card\",
\"subscription\": false,
\"email\": \"taro.momo@univapay.com\",
\"data\": {
\"cardholder\": \"TARO MOMO\",
\"card_number\": \"4916741415383284\",
\"exp_month\": \"12\",
\"exp_year\": \"2018\",
\"cvv\": \"999\",
\"line1\": \"123 abc st\",
\"line2\": \"apt 123\",
\"state\": \"OR\",
\"city\": \"Portland\",
\"country\": \"US\",
\"zip\": \"12345\",
\"phone_number\": {
\"country_code\": \"1\",
\"local_number\": \"8029854583\"
},
\"cvv_authorize\": {
\"enabled\": true,
\"currency\": \"JPY\"
}
}
}"
Response
Code: 201
Headers:
Content-Type: application/json
Body:
{
"id": "1c94ed2e-1841-11e7-a481-a393b47973f4",
"store_id": "af857264-180c-11e7-9be2-276aea4fed28",
"email": "taro.momo@univapay.com",
"payment_type": "card",
"mode": "test",
"type": "one_time",
"metadata": {},
"created_on": 1491205358955,
"last_used_on": null,
"data": {
"card": {
"cardholder": "TARO MOMO",
"exp_month": 12,
"exp_year": 2018,
"last_four": "3284",
"brand": "visa",
"country": "BR",
"category": "classic",
"issuer": "BANCO SANTANDER BRASIL, S.A.",
"sub_brand": "none"
},
"billing": {
"line1": "123 abc st",
"line2": "apt 123",
"state": "OR",
"city": "Portland",
"country": "US",
"zip": "12345",
"phone_number": {
"country_code": 1,
"local_number": "8029854583"
}
},
"cvv_authorize": {
"enabled": true,
"status": "current",
"currency": "JPY",
"charge_id": "8fb15bae-119b-4e57-8504-ae7230c68139",
"credentials_id": "e093d719-0c07-4597-b14b-c4a504832aca"
}
}
}