このページは現在翻訳中です。

KakaoPay

このページで扱うトピック

KakaoPay lets you accept online payments from KakaoPay users on your website or in your mobile app. Customers make purchases with KakaoPay in the KakaoPay app on a smartphone, or on a computer by scanning a QR code with the KakaoPay app or logging in to their KakaoPay account.

The following guide explains how to enable KakaoPay, how KakaoPay payments work, how to accept KakaoPay payments with the Omise API, and how to refund and void KakaoPay charges.

KakaoPay at a glance

Item Value
Supported countries Singapore, Thailand
Currencies SGD (Singapore), THB (Thailand)
Source type kakaopay
Payment flow app_redirect
platform_type values IOS, ANDROID, or WEB (optional)
Charge amount limits (Singapore) SGD 1.00 to SGD 20,000.00
Charge amount limits (Thailand) THB 20.00 to THB 150,000.00
Void cutoff The first 00:15 GMT+8 (23:15 Thailand time) after the charge is created
Minimum API version 2017-11-02
How to enable Email support@omise.co

Enable KakaoPay

KakaoPay is available to Omise merchants in Singapore and Thailand and requires API version 2017-11-02 or later.

To enable KakaoPay, email support@omise.co and request KakaoPay for your Omise account.

How KakaoPay payments work

KakaoPay supports payments in mobile apps and on websites. KakaoPay sources use the app_redirect flow: your website or mobile app redirects the customer to the KakaoPay checkout page, where the customer authorizes and confirms the payment.

Customer device How the customer pays
Smartphone In the KakaoPay app
Computer By scanning a QR code with the KakaoPay app on a smartphone
Computer By logging in to their KakaoPay account

The following screenshots show the KakaoPay payment flow on a smartphone and with a QR code on a computer. The numbers in each step match the numbers in the screenshot.

KakaoPay payment flow on a smartphone

KakaoPay payment flow in the KakaoPay app on a smartphone

  1. The customer selects the wallet to pay with (1).
  2. The customer is redirected to the wallet app to confirm the payment (2).
  3. The wallet app shows the payment details (3).
  4. The customer taps Back to merchant to return to the confirmation page on your website or app (4).

KakaoPay payment flow on a computer with a QR code

KakaoPay payment flow with a QR code on a computer

  1. The customer selects the wallet to pay with (1).
  2. A QR code is displayed (2).
  3. The customer opens the wallet app on their smartphone and opens its QR code scanner (3).
  4. The customer scans the QR code (4).
  5. The wallet app shows a payment summary, and the customer confirms the payment (5).
  6. The wallet app shows the payment confirmation slip, and the customer can return to the payment confirmation page on your website (6).
  7. After you receive the charge.complete webhook event, you confirm the payment result with the customer (7).

Accept KakaoPay payments with the Omise API

A KakaoPay integration has four steps:

  1. Create a KakaoPay source.
  2. Create a KakaoPay charge with the source.
  3. Redirect the customer to KakaoPay to authorize the charge.
  4. Confirm the result of the KakaoPay charge.

Use your public key to create the KakaoPay source on the client (the customer's browser or mobile phone), and your secret key to create the KakaoPay charge on your server. If both the source and the charge must be created on your server, you can create them in one request with your secret key. Your public key and secret key are on the keys page of your dashboard.

Method Keys used When to use
Create the source and charge separately Public key for the source, secret key for the charge You create the source on the client with Omise.js or an Omise mobile SDK, and create the charge on your server.
Create the source and charge in one request Secret key only Your server creates both the source and the charge.

The following sequence diagram shows the full KakaoPay flow when you create the source and charge separately.

sequenceDiagram participant Customer participant OmiseJS participant Merchant participant OmiseAPI Customer->>OmiseJS: Send payment details for purchase OmiseJS->>OmiseAPI: Request source with payment details OmiseAPI-->>OmiseJS: Return source OmiseJS->>Merchant: Pass source to merchant server Merchant->>OmiseAPI: Request charge with source and purchase details OmiseAPI-xMerchant: Send charge.create webhook event OmiseAPI-->>Merchant: Return charge Merchant->>Customer: Redirect customer to authorize_uri Customer->>OmiseAPI: Authorize charge at authorize_uri OmiseAPI-->>Customer: Redirect customer to return_uri OmiseAPI-xMerchant: Send charge.complete webhook event Merchant-xCustomer: Send charge result to customer by email

Step 1: Create a KakaoPay source

When the customer confirms that they want to pay with KakaoPay, create a source with type set to kakaopay. You can create the source with Omise.js, the Omise mobile SDK for iOS or Android, or the Sources API.

If your server creates the source and charge in one request, skip to Create a KakaoPay source and charge in one request.

KakaoPay source parameters:

Parameter Type Description
amount integer (required) Charge amount in the smallest currency unit. For example, 150000 is SGD 1,500.00. For minimum and maximum amounts, see KakaoPay charge amount limits.
currency string (required) Three-letter ISO 4217 currency code: SGD for Singapore or THB for Thailand.
type string (required) kakaopay
platform_type string (optional) Platform the customer pays on: IOS, ANDROID, or WEB.

The following examples create a KakaoPay source for SGD 1,500.00 on the web platform. Replace omise_public_key and $OMISE_PUBLIC_KEY with your test public key.

Note: In Omise.js, pass the source type as the first argument of Omise.createSource, not inside the options object.

Create a KakaoPay source with Omise.js:

Omise.setPublicKey(omise_public_key);

Omise.createSource('kakaopay', {
  "amount": 150000,
  "currency": "SGD",
  "platform_type": "WEB"
}, function(statusCode, response) {
  console.log(response);
});

Create a KakaoPay source with curl:

curl https://api.omise.co/sources \
  -u $OMISE_PUBLIC_KEY: \
  -d "amount=150000" \
  -d "currency=SGD" \
  -d "type=kakaopay" \
  -d "platform_type=WEB"

Example KakaoPay source response:

{
  "object": "source",
  "id": "src_test_62kimchi4bibim8bapx",
  "livemode": false,
  "location": "/sources/src_test_62kimchi4bibim8bapx",
  "amount": 150000,
  "barcode": null,
  "bank": null,
  "created_at": "2023-06-15T02:25:08Z",
  "currency": "SGD",
  "email": null,
  "flow": "app_redirect",
  "installment_term": null,
  "absorption_type": null,
  "name": null,
  "mobile_number": null,
  "phone_number": null,
  "platform_type": "WEB",
  "scannable_code": null,
  "billing": null,
  "shipping": null,
  "items": [],
  "references": null,
  "store_id": null,
  "store_name": null,
  "terminal_id": null,
  "type": "kakaopay",
  "zero_interest_installments": null,
  "charge_status": "unknown",
  "receipt_amount": null,
  "discounts": []
}

The id attribute is the source ID. Source IDs begin with src_. Send the source ID to your server to create the charge.

Step 2: Create a KakaoPay charge

Create a charge with your secret key and the following parameters:

Parameter Description
amount (required) Must match the amount of the source.
currency (required) Must match the currency of the source.
source (required) The source ID from step 1.
return_uri (required) The page on your website where the customer is redirected after authorizing the payment. Must be an HTTPS URL.

Create a KakaoPay charge from a source ID

Replace $OMISE_SECRET_KEY with your test secret key and $SOURCE_ID with the source ID.

curl https://api.omise.co/charges \
  -u $OMISE_SECRET_KEY: \
  -d "amount=150000" \
  -d "currency=SGD" \
  -d "return_uri=https://example.com/orders/345678/complete" \
  -d "source=$SOURCE_ID"

Example KakaoPay charge response:

{
  "object": "charge",
  "id": "chrg_test_62tteok3bokki9sojux",
  "location": "/charges/chrg_test_62tteok3bokki9sojux",
  "amount": 150000,
  "net": 145650,
  "fee": 4350,
  "fee_vat": 0,
  "interest": 0,
  "interest_vat": 0,
  "funding_amount": 150000,
  "refunded_amount": 0,
  "transaction_fees": {
    "fee_flat": "0.0",
    "fee_rate": "2.9",
    "vat_rate": "0.0"
  },
  "platform_fee": {
    "fixed": null,
    "amount": null,
    "percentage": null
  },
  "currency": "SGD",
  "funding_currency": "SGD",
  "ip": null,
  "refunds": {
    "object": "list",
    "data": [],
    "limit": 20,
    "offset": 0,
    "total": 0,
    "location": "/charges/chrg_test_62tteok3bokki9sojux/refunds",
    "order": "chronological",
    "from": "1970-01-01T00:00:00Z",
    "to": "2023-06-15T02:25:10Z"
  },
  "link": null,
  "description": null,
  "metadata": {},
  "card": null,
  "source": {
    "object": "source",
    "id": "src_test_62kimchi4bibim8bapx",
    "livemode": false,
    "location": "/sources/src_test_62kimchi4bibim8bapx",
    "amount": 150000,
    "barcode": null,
    "bank": null,
    "created_at": "2023-06-15T02:25:08Z",
    "currency": "SGD",
    "email": null,
    "flow": "app_redirect",
    "installment_term": null,
    "absorption_type": null,
    "name": null,
    "mobile_number": null,
    "phone_number": null,
    "platform_type": "WEB",
    "scannable_code": null,
    "billing": null,
    "shipping": null,
    "items": [],
    "references": null,
    "store_id": null,
    "store_name": null,
    "terminal_id": null,
    "type": "kakaopay",
    "zero_interest_installments": null,
    "charge_status": "pending",
    "receipt_amount": null,
    "discounts": []
  },
  "schedule": null,
  "customer": null,
  "dispute": null,
  "transaction": null,
  "failure_code": null,
  "failure_message": null,
  "status": "pending",
  "authorize_uri": "https://pay.omise.co/payments/pay2_test_62seoul7busan2jejux/authorize",
  "return_uri": "https://example.com/orders/345678/complete",
  "created_at": "2023-06-15T02:25:10Z",
  "paid_at": null,
  "expires_at": "2023-06-22T02:25:10Z",
  "expired_at": null,
  "reversed_at": null,
  "zero_interest_installments": false,
  "branch": null,
  "terminal": null,
  "device": null,
  "authorized": false,
  "capturable": false,
  "capture": true,
  "disputable": false,
  "livemode": false,
  "refundable": false,
  "reversed": false,
  "reversible": false,
  "voided": false,
  "paid": false,
  "expired": false
}

A new KakaoPay charge has a status of pending and an authorize_uri. Step 3 uses the authorize_uri.

Create a KakaoPay source and charge in one request

To create the source and charge in a single request, use your secret key and pass the source parameters as source[...] fields instead of a source ID.

curl https://api.omise.co/charges \
  -u $OMISE_SECRET_KEY: \
  -d "amount=150000" \
  -d "currency=SGD" \
  -d "return_uri=https://example.com/orders/345678/complete" \
  -d "source[type]=kakaopay" \
  -d "source[platform_type]=WEB"

The response is a charge object in the same format as the preceding example response.

Step 3: Redirect the customer to authorize the KakaoPay charge

Redirect the customer to the URL in the charge's authorize_uri so the customer can authorize the charge, as described in How KakaoPay payments work.

After the customer completes authorization, the customer is redirected to the URL in return_uri.

Step 4: Confirm the result of the KakaoPay charge

A webhook is the best way to learn when a KakaoPay charge is complete:

  1. Set up an endpoint on your server to receive webhook events.
  2. Add the endpoint URL on the webhooks page of your dashboard.
  3. When a charge completes, Omise sends a POST request to your endpoint with an event object. The event's key attribute is charge.complete, and its data attribute contains the charge object. For the event object structure, see the Events API.
  4. When you receive the charge.complete event, retrieve the charge by its id and confirm that its status matches the status in the event. Retrieving the charge is optional but recommended.

KakaoPay charge statuses:

status Meaning
pending The payment is not complete yet.
successful The payment is complete.
failed The payment failed. Check the charge's failure_code and failure_message attributes for the reason.
expired The charge expired before the customer paid.

KakaoPay failure codes:

failure_code Description
payment_expired Payment expired.
payment_rejected Payment rejected by the issuer.
failed_processing General payment processing failure.
invalid_account No valid account was found for the payment method.
insufficient_fund The account has insufficient funds, or the payment method has reached its limit.

For all charge attributes, see the Charges API.

Test KakaoPay payments

In test mode, open the charge's authorize_uri to use the web simulator, and mark the charge as Successful or Failed.

Refund and void KakaoPay charges

Request KakaoPay refunds through the Refunds API.

A refund requested before the first 00:15 GMT+8 after the charge is created is processed as a void. A refund requested at or after the cutoff is processed as a refund. In Thailand time (GMT+7), the void cutoff is 23:15.

For example, a KakaoPay charge is created at 15:00 GMT+8 (14:00 Thailand time) on 20 January. A refund requested before 00:15 GMT+8 on 21 January (23:15 Thailand time on 20 January) is processed as a void. A refund requested at or after that time is processed as a refund.

KakaoPay charge amount limits

Amounts are in the smallest currency unit.

Country Currency Minimum amount Maximum amount
Singapore SGD 100 (SGD 1.00) 2000000 (SGD 20,000.00)
Thailand THB 2000 (THB 20.00) 15000000 (THB 150,000.00)

FAQ

Which countries and currencies does KakaoPay support?

KakaoPay is available to Omise merchants in Singapore (SGD) and Thailand (THB).

How do I enable KakaoPay?

Email support@omise.co and request KakaoPay for your Omise account.

How does a customer pay with KakaoPay?

On a smartphone, the customer pays in the KakaoPay app. On a computer, the customer scans a QR code with the KakaoPay app or logs in to their KakaoPay account.

What are the minimum and maximum KakaoPay charge amounts?

In Singapore, the minimum is SGD 1.00 and the maximum is SGD 20,000.00. In Thailand, the minimum is THB 20.00 and the maximum is THB 150,000.00.

What values does platform_type accept?

The platform_type parameter accepts IOS, ANDROID, or WEB. The parameter is optional.

What is the KakaoPay void cutoff time?

A refund requested before the first 00:15 GMT+8 after the charge is created is processed as a void, and a refund requested at or after the cutoff is processed as a refund. In Thailand time (GMT+7), the cutoff is 23:15. For details, see Refund and void KakaoPay charges.

How do I refund a KakaoPay charge?

Request the refund through the Refunds API. Omise processes the request as a void or as a refund, depending on whether the request is made before the void cutoff.

How do I test KakaoPay payments?

In test mode, open the charge's authorize_uri and mark the charge as Successful or Failed in the web simulator.

Omiseは、お客様のウェブサイト全般における利便性を向上するためにクッキーを利用し、お客様のアクセス、閲覧履歴に関する情報を収集します。 当社のウェブサイトを閲覧し続けることにより、お客様は当社のプライバシーポリシーに同意することとします。 詳細はこちら