Skip to documentation
YPYakaApp YakaniPay
Menu

API reference

Hosted Payment Page

HPP API Reference

Overview

The Hosted Payment Page redirects customers to a secure provider-managed payment interface. Sensitive payment credentials do not touch the merchant's servers, helping reduce PCI DSS scope.

01

Reduced PCI scope

Payment data stays on the hosted payment service.

02

No card handling

The provider handles sensitive card data.

03

Mobile optimized

Responsive checkout across phones and computers.

04

Multiple methods

Cards, wallets, and supported accounts in one flow.

HPP request

Generate an HPP token and redirect URL by calling the unified API endpoint:

Code example
POST /asm
{
  "schemaVersion": "1.0",
  "requestId": "{{$guid}}",
  "timestamp": "{{$timestamp}}",
  "channelName": "WEB",
  "serviceName": "API_PURCHASE",
  "serviceParams": {
    "merchantUid": {{MERCHANT_UID}},
    "storeId": {{STORE_ID}},
    "hppKey": {{HPP_KEY}},
    "transactionInfo": {
      "referenceId": "ORDER-2024-001",
      "invoiceId": "INV-001",
      "amount": "150.00",
      "currency": "USD",
      "description": "E-commerce purchase",
      "returnUrl": "https://yoursite.com/payment/return",
      "cancelUrl": "https://yoursite.com/payment/cancel"
    }
  }
}

Request parameters

ParameterTypePresenceDescription
schemaVersionStringConstantAPI schema version, such as 1.0
requestIdUUID StringRequiredUnique request identifier
merchantUidStringRequiredMerchant identifier issued during account setup
storeIdStringRequiredMerchant store identifier
hppKeyStringRequiredHPP authentication key
transactionInfo.referenceIdStringRequiredUnique internal order reference
transactionInfo.invoiceIdStringRequiredTransaction invoice ID
transactionInfo.amountStringRequiredAmount with two decimal places
transactionInfo.currencyStringRequiredISO 4217 currency code, such as USD
transactionInfo.descriptionStringOptionalTransaction description
transactionInfo.returnUrlStringRequiredPost-payment redirect URL
transactionInfo.cancelUrlStringOptionalCancellation redirect URL

Response

A successful request returns an HPP URL for the customer redirect:

Code example
{
  "schemaVersion": "1.0",
  "timestamp": "2024-11-05 09:04:44.741",
  "responseId": "{{$guid}}",
  "responseCode": "2001",
  "errorCode": "0",
  "responseMsg": "RCS_SUCCESS",
  "params": {
    "hppRequestId": "HPP-2024-001",
    "hppToken": "eyJhbGciOiJIUzI1NiIsInR...",
    "hppUrl": "https://hpp.waafipay.com/pay?token=eyJhbGci...",
    "expiresAt": "2024-11-05 09:09:44.741"
  }
}