On-Session Payment API
On-session payment APIはユーザーがpayment時にデバイスにアクセスしている状態で決済するためのAPIです。ユーザーは加盟店との連携承認を行うこと、または既に連携を行っているユーザーから引落しを行うことが可能です。
概要
On-session payment APIは
- Payment linkの作成
- Customerの作成
- 新規ユーザーへのCharge(引落)の実行
- 既存ユーザーへのCharge(引落)の実行 が可能です
リクエスト
- Customer Object
- Charge Object
- Redirect Object
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Required | Customer's email address | |
| customer_id | string | Optional | Customer ID |
| force_kyc | boolean | Optional | Whether to require KYC verification |
| name | string | Optional | Customer's full name |
| katakana_last_name | string | Optional | Customer's last name in katakana |
| katakana_first_name | string | Optional | Customer's first name in katakana |
| address | string | Optional | Customer's address |
| birth_date | string | Optional | Customer's birth date (YYYY-MM-DD) |
| gender | string | Optional | Customer's gender ("male" or "female") |
| metadata | object | Optional | Additional data for tracking |
| Parameter | Type | Required | Description |
|---|---|---|---|
| price | number | Optional | Amount to charge in JPY |
| description | string | Optional | Description of the charge |
| metadata | object | Optional | Additional data for the charge |
| one_off_charge | boolean | Optional | Will not provide a customer id in response. Use if this charge is one-off (like a single EC payment) and you do not require saving customer id for future deductions. |
| Parameter | Type | Required | Description |
|---|---|---|---|
| success_url | string | Required | URL to redirect after successful payment |
| failure_url | string | Required | URL to redirect after failed payment |
レスポンス
- Success Response
- Response Fields
{
"charge": {
"id": "chg-73d45202-c751-40ac-8b8d-52eb8b009f53",
"price": 100,
"description": "商品の説明",
"metadata": {
"order_id": "order_456"
},
"customer": {
"id": "cus-ct7c7p31ihult8kvli20",
"email": "example@email.jp",
"createdAt": "2024-12-03T08:40:04.924031Z",
"updatedAt": "2024-12-03T08:40:04.924031Z"
},
"expiresAt": "2024-12-03T10:10:04.923338257Z"
},
"paymentLink": {
"url": "https://pay.jamm-pay.jp/payment?payment_id=09e09114-f0ac-4c2a-a669-8ad1c07b7209",
"expiresAt": "2024-12-03T10:10:04.923338257Z"
}
}
| Field | Type | Description |
|---|---|---|
| charge.id | string | Always Unique identifier for the charge |
| charge.price | number | Always Amount to be charged in JPY |
| charge.metadata | object | Optional Additional data for the charge |
| customer.id | string | Optional Unique identifier for the customer |
| customer.email | string | Always Customer's email address |
| paymentLink.url | string | Always URL that can be sent to the customer |
| paymentLink.expiresAt | string | Always When the payment link expires |
エラーコード
INVALID_REQUEST
Missing or invalid parameters in the request
PAYMENT_EXPIRED
The payment link has expired (90 minutes after creation)
KYC_REQUIRED
Customer must complete KYC verification before proceeding
CUSTOMER_EXISTS
A customer with this email already exists
INVALID_AMOUNT
The charge amount is invalid or outside allowed range