v1

latestOpenAPI 3.0.02026-07-246335313.6 KB
Payment APIs

Initiate Payment

Create a payment transaction for specific PSP and their supported Payment Methods. Please refer the list of supported PSPs & payment methods on PortOne. Once you have the response, depending on the “Payment Method” attribute, you will be either redirected to the PSP hosted payment page OR results page incase of Card/ Installment methods.

post/api/initiatePayment

Headers

Content-Typestring
X-Portone-Client-Keystring

Request body

keystring required

The unique PortOne key for merchant

merchant_order_idstring required

The unique merchant order reference generated by the merchant

pmt_channelstring required

The Payment Channel Key listed in PortOne docs

pmt_methodstring required

The Payment Method Key listed in PortOne docs

descriptionstring required

The description of the transaction

environment'live' | 'sandbox' required

The environment of the transaction is either live OR sandbox

amountnumber double required

The amount of transaction, can be a floating-point number

currencystring required

The currency of transaction

signature_hashstring required

The signature_hash of transaction details generated as per <a href="/docs/payment-request" target="_blank">Payment Request Signature Documentation</a>

success_urlstring required

The url of success page hosted by merchant.

failure_urlstring required

The url of failure page hosted by merchant.

pending_urlstring

The url of pending page hosted by merchant.

routing_enabledboolean

Boolean flag to identify if routing is enabled

transaction_type'PREAUTH' | 'PURCHASE'

The type of the transaction to capture

user_configured_field1string

Custom user configured field 1

user_configured_field2string

Custom user configuration field 2

user_configured_field3string

Custom user configuration field 3

user_configured_field4string

Custom user configuration field 4

user_configured_field5string

Custom user configuration field 5

Example request

{
  "key": "pbmYjsswixLjpqmj",
  "merchant_order_id": "<Unique Merchant Order ID>",
  "amount": 100000,
  "currency": "VND",
  "signature_hash": "<Generated SignatureHash>",
  "billing_details": {
    "billing_name": "Billing Name",
    "billing_surname": "Shipping Surname",
    "billing_email": "billingemail@gmail.com",
    "billing_phone": "8959893980",
    "billing_address": {
      "city": "City",
      "country_code": "VN",
      "locale": "Locale",
      "line_1": "Line 1",
      "line_2": "Line 2",
      "postal_code": "400202",
      "state": "State"
    }
  },
  "shipping_details": {
    "shipping_name": "Shipping Name",
    "shipping_surname": "Shipping Surname",
    "shipping_email": "shippingemail@gmail.com",
    "shipping_phone": "8959893980",
    "shipping_address": {
      "city": "City",
      "country_code": "VN",
      "locale": "Locale",
      "line_1": "Line 1",
      "line_2": "Line 2",
      "postal_code": "400202",
      "state": "State"
    }
  },
  "token_params": {
    "token": "39ad3aac0486492fae11f96327ad9d97",
    "partial_card_number": "424242******4242",
    "expiry_month": "06",
    "expiry_year": "2022",
    "type": "mastercard",
    "save_card": true
  },
  "success_url": "https://checkout.portone.cloud/success.html",
  "failure_url": "https://checkout.portone.cloud/failure.html",
  "pending_url": "https://checkout.portone.cloud/pending.html",
  "pmt_channel": "MOMOPAY",
  "pmt_method": "MOMOPAY_WALLET",
  "description": "Test Example",
  "environment": "sandbox",
  "order_details": [
    {
      "id": "abc",
      "name": "item1",
      "price": 20110,
      "quantity": 1,
      "image": "https://www.google.com",
      "additional_details": {}
    }
  ],
  "routing_enabled": true,
  "routing_params": {
    "type": "failover",
    "data": [
      {
        "channel_key": "OMISE",
        "method_key": "OMISE_CREDIT_CARD",
        "rank": 2
      },
      {
        "channel_key": "STRIPE",
        "method_key": "STRIPE_CARD",
        "rank": 1
      }
    ]
  },
  "transaction_type": "PURCHASE",
  "user_configured_field1": "SampleData1",
  "user_configured_field2": "SampleData2",
  "user_configured_field3": "SampleData3",
  "user_configured_field4": "SampleData4",
  "user_configured_field5": "SampleData5"
}

Response

Successful response

is_successboolean

The boolean flag denoting if payment link/charge was successfully created

redirect_urlstring

The unique PortOne key for merchant

channel_order_refstring

The unique Order reference generated by PSP for transaction.

merchant_order_refstring

The unique Order reference generated by merchant for transaction.

order_refstring

The unique Order reference generated by PortOne for transaction.

messagestring

The extra message about the transaction

deep_linkstring

The deep-link for transaction to use in mobile

additional_dataobject

The additional metadata of transaction

qrcode_urlstring

The QR Code Image URL which merchant can use to scan and complete the transaction

expiry_in_minutesstring

The expiration time in minutes for the QRCode based transaction