POST
/
api
/
v1
/
server-to-server-interface
/
hpp
/
generate
/
link
Generate HPP Link
curl --request POST \
  --url https://api-dev.paymentoptions.com/api/v1/api/v1/server-to-server-interface/hpp/generate/link \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "return_url": {
    "webhook_url": "< Webhook url >",
    "success_url": "http://www.successurl.com/",
    "decline_url": "http://www.declineurl.com/",
    "cancel_url": "http://cancelurl.com/"
  },
  "amount": 1000,
  "currency": "JPY",
  "merchant_id": "< Merchant ID >",
  "merchant_email": "merchant@testemail.com",
  "merchant_txn_ref": "2003089893366DTEST",
  "billing_address": {
    "country": "JP",
    "email": "billing@testemail.com",
    "phone_number": "8112345678",
    "address1": "1-2-3 Shinjuku",
    "city": "Shinjuku-ku",
    "state": "Tokyo",
    "postal_code": "1600022"
  },
  "shipping_address": {
    "country": "JP",
    "email": "shipping@testemail.com",
    "phone_number": "8112345678",
    "address1": "1-2-3 Shinjuku",
    "city": "Shinjuku-ku",
    "state": "Tokyo",
    "postal_code": "1600022"
  }
}'
{
  "id": "f49173ce-4916-445c-a831-3c1468acf14e",
  "url": "https://checkout-dev.paymentoptions.com/jp/HostedPaymentPage/hKJsdByR",
  "amount": 1000,
  "currency": "JPY",
  "merchant_txn_ref": "2003089893366DTEST",
  "merchant_id": "< Merchant ID >",
  "merchant_email": "merchant@testemail.com",
  "return_url": {
    "webhook_url": "< Webhook url >",
    "success_url": "http://www.successurl.com/",
    "decline_url": "http://www.declineurl.com/",
    "cancel_url": "http://cancelurl.com/"
  },
  "billing_address": {
    "city": "Shinjuku-ku",
    "email": "billing@testemail.com",
    "phone_number": "8112345678",
    "state": "Tokyo",
    "country": "JP",
    "address1": "1-2-3 Shinjuku",
    "postal_code": "1600022"
  },
  "shipping_address": {
    "city": "Shinjuku-ku",
    "email": "shipping@testemail.com",
    "phone_number": "8112345678",
    "state": "Tokyo",
    "country": "JP",
    "address1": "1-2-3 Shinjuku",
    "postal_code": "1600022"
  }
}

Key Points

  • If the payload is pre-filled with data (e.g., amount, currency, customer details, return_url, payment method), these details will be reflected on the HPP, providing a streamlined user experience.
  • If the payload lacks certain data, the customer will need to manually enter the missing information on the HPP.
  • Ensure that the necessary headers and authentication details are included to successfully generate the HPP link.

Flow diagram

Flow diagram image

ApplePay & GooglePay

When a merchant is configured for Apple Pay and Google Pay, the Hosted Payment Page (HPP) will display buttons for Google Pay and Apple Pay, allowing customers to complete payments through these methods

Key Points

Merchant Configuration The Merchant ID for either Apple Pay or Google Pay must be included in the HPP payload when making a request to generate the payment link.These payment options will automatically appear on the HPP if the merchant is properly configured for them.Payment Buttons The HPP will dynamically display Google Pay and Apple Pay buttons based on the availability and configuration of the merchant’s account.Customers can seamlessly use either method to complete the transaction directly from the HPP.If both Apple Pay and Google Pay are configured for the same merchant (i.e., same DAS MID), you can control button priority by including the following optional parameter in the HPP payload:When set to true, this will prioritize displaying Google Pay on the payment interface. If omitted, the default prioritization will apply based on device and browser compatibility.

Api Parameters

Authorizations

Authorization
string
header
required

API Key for Authorization. Format: 'Basic YOUR_API_KEY_HERE'

x-api-key
string
header
required

API Key specific to x-api-key.

Body

application/json

The request payload to generate an HPP link.

return_url
object
required

A JSON object containing the Return URLs.

currency
string
required

The processing currency (e.g., JPY).

Maximum length: 3
Example:

"JPY"

merchant_id
string
required

The merchant ID (DASMID).

Maximum length: 128
Example:

"< Merchant ID >"

merchant_email
string
required

The email address of the Merchant.

Maximum length: 45
Example:

"merchant@testemail.com"

billing_address
object
required

A JSON object containing the billing address of the cardholder.

amount
number

The amount of the transaction.

Example:

1000

merchant_txn_ref
string

The merchant transaction reference ID.

Maximum length: 45
Example:

"2003089893366DTEST"

shipping_address
object

A JSON object containing the shipping address of the cardholder.

Response

200 - application/json

HPP link generated successfully

id
string

The transaction reference ID.

Example:

"f49173ce-4916-445c-a831-3c1468acf14e"

url
string

The URL Link of the hosted payment page link generated.

Example:

"https://checkout-dev.paymentoptions.com/jp/HostedPaymentPage/hKJsdByR"

amount
number

The amount of the transaction.

Example:

1000

currency
string

The processing currency of the transaction.

Example:

"JPY"

merchant_txn_ref
string

The merchant transaction reference ID.

Example:

"2003089893366DTEST"

merchant_id
string

The DAS merchant ID of the transaction performed.

Example:

"< Merchant ID >"

merchant_email
string

The email address of the Merchant.

Example:

"merchant@testemail.com"

return_url
object

A JSON object containing the Return URL.

billing_address
object

A JSON object containing the billing address of the cardholder.

shipping_address
object

A JSON object containing the shipping address of the cardholder.