Skip to main content
POST
/
api
/
v1
/
server-to-server-interface
/
hpp
/
generate
/
link
Generate Hosted Payment Page (HPP) Link
curl --request POST \
  --url https://api-dev.paymentoptions.com/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 '
{
  "amount": "1000",
  "currency": "PHP",
  "merchant_id": "< Webhook url >",
  "return_url": {
    "webhook_url": "< Webhook url >",
    "success_url": "http://www.successurl.com/",
    "decline_url": "http://www.declineurl.com/",
    "cancel_url": "http://cancelurl.com/"
  },
  "payment_method": {
    "type": "gcash"
  },
  "merchant_txn_ref": "qwe",
  "customer_ip": "127.0.0.1",
  "billing_address": {
    "country": "JP",
    "email": "[email protected]",
    "phone_number": "8112345678",
    "address1": "1-2-3 Shinjuku",
    "city": "Shinjuku-ku",
    "state": "Tokyo",
    "postal_code": "1600022"
  },
  "shipping_address": {
    "country": "JP",
    "email": "[email protected]",
    "phone_number": "8112345678",
    "address1": "1-2-3 Shinjuku",
    "city": "Shinjuku-ku",
    "state": "Tokyo",
    "postal_code": "1600022"
  },
  "time_zone": "Asia/Kuala_Lumpur"
}
'
{
  "id": "c0728395-6a55-4f10-819e-03bdc917c4b1",
  "url": "https://checkout-dev.paymentoptions.com/HostedPaymentPage/GGNDZOmv",
  "amount": 1000,
  "currency": "PHP",
  "merchant_txn_ref": "qwe",
  "merchant_id": "< Webhook url >",
  "merchant_email": null,
  "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": "[email protected]",
    "state": "Tokyo",
    "country": "JP",
    "address1": "1-2-3 Shinjuku",
    "postal_code": "1600022",
    "phone_number": "8112345678"
  },
  "shipping_address": {
    "city": "Shinjuku-ku",
    "email": "[email protected]",
    "state": "Tokyo",
    "country": "JP",
    "address1": "1-2-3 Shinjuku",
    "postal_code": "1600022",
    "phone_number": "8112345678"
  }
}

Key Points

Merchant Configuration
  • The Merchant ID for GCash must be included in the payload along with the specific payment_method type set to gcash.
  • If the merchant is configured for GCash, the HPP will generate an E-Wallet payment link to enable customers to pay via GCash. See all supported E-Wallets…
E-Wallet Link
  • The HPP will display an option for customers to pay via GCash or generate an E-Wallet link for the customer to use.
  • This ensures a smooth process for customers using their GCash E-Wallet to complete transactions.

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 payload to generate an HPP link.

amount
string
required

The amount of the transaction. If passed as an empty string, the cardholder enters the amount manually on the HPP.

Example:

"1000"

currency
string
required

The abbreviation of the processing currency (e.g., PHP for Philippine Peso).

Maximum string length: 3
Example:

"PHP"

merchant_id
string
required

The unique identifier of the merchant (DASMID).

Maximum string length: 128
Example:

"< Webhook url >"

return_url
object
required

A JSON object containing the return URLs. (This field is mandatory for 3DS transactions.)

payment_method
object

A JSON object containing payment method details.

merchant_txn_ref
string

The merchant transaction reference ID.

Maximum string length: 45
Example:

"qwe"

customer_ip
string

The IP address of the customer initiating the transaction.

Example:

"127.0.0.1"

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.

time_zone
string

The time zone for the transaction.

Example:

"Asia/Kuala_Lumpur"

Response

200 - application/json

HPP link generated successfully.

id
string

The transaction reference ID.

Example:

"c0728395-6a55-4f10-819e-03bdc917c4b1"

url
string

The URL of the generated Hosted Payment Page.

Example:

"https://checkout-dev.paymentoptions.com/HostedPaymentPage/GGNDZOmv"

amount
integer

The transaction amount.

Example:

1000

currency
string

The processing currency.

Example:

"PHP"

merchant_txn_ref
string

The merchant transaction reference ID.

Example:

"qwe"

merchant_id
string

The merchant ID for the transaction.

Example:

"< Webhook url >"

merchant_email
string

The merchant's email address (if available).

Example:

null

return_url
object

The return URLs for transaction outcomes.

billing_address
object

The billing address details.

shipping_address
object

The shipping address details.