Skip to main content

Overview

This document provides a detailed reference for all common and business parameters required when integrating with Oceanpayment APIs. It covers parameter formats, rules, and usage guidelines to ensure smooth API calls. Review these details before making API requests.

Request Flow

Request Parameters

All API Calls Require

Note

These parameters are mandatory for all API calls, usually related to authentication, request signing, and basic billing information.

ParameterTypeLengthRequiredDescriptionExample
accountstring6YesOceanpayment account number
terminalstring8-12YesOceanpayment terminal number
signValuestring64YesSecurity signature to validate the request, SHA256 encrypted
keystring64ConditionalOceanpayment public key
  • Embedded-(required for embedded credit card integration)
backUrlstring1-500YesURL where the synchronous payment result will be returned
noticeUrlstring1-500NoServer callback URL for asynchronous payment notifications and other updates
methodsstring1-50YesPayment method
order_numberstring1-50YesMerchant’s order ID
order_currencystring3YesTransaction currency
order_amountstring1-10YesTransaction amount
  • Up to 2 decimal places (e.g., 1.00)
  • No transaction is needed if amount is 0

Billing Information

ParameterTypeLengthRequiredDescriptionNotes
billing_firstNamestring1-50YesCustomer first name
  • To ensure consistent request signing,
    remove the following characters: leading/trailing spaces, double quotes, <, >, and single quotes.
billing_lastNamestring1-50YesCustomer last name
  • To ensure consistent request signing,
    remove the following characters: leading/trailing spaces, double quotes, <, >, and single quotes.
billing_emailstring1-50YesCustomer email
  • To ensure consistent request signing,
    remove the following characters: leading/trailing spaces, double quotes, <, >, and single quotes.
billing_phonestring0-50NoCustomer phone
billing_countrystring1-100YesBilling country
billing_statestring1-100YesBilling state/province/county
billing_citystring0-500NoCustomer city
billing_addressstring0-500NoCustomer address
billing_zipstring0-50NoPostal code
billing_ipstring0-50ConditionalCustomer IP.

Product Information

Information

Product information is required for settlement compliance. All related fields are mandatory.

ParameterTypeLengthRequiredDescriptionExample
productNamestring1-500YesProduct name(s)
  • For multiple products, separate them with commas (,)
productNumstring1-50YesProduct quantity
  • For multiple products, separate them with commas (,)
productSkustring1-500YesSKU
  • For multiple products, separate them with commas (,)
productPricestring1-500YesUnit price
  • For multiple products, separate them with commas (,)

Shipping Information

If shipping information is unavailable, billing info can be reused.

ParameterTypeLengthRequiredDescriptionExample
ship_firstNamestring1-50NoShipping first name
ship_lastNamestring1-50NoShipping last name
ship_emailstring1-50NoShipping email
ship_phonestring0-50NoShipping phone
ship_countrystring1-100NoShipping country code
ship_statestring1-100NoShipping state/province code
ship_citystring0-500NoShipping city
ship_addrstring0-500NoShipping street address
ship_zipstring0-50NoShipping postal code

Business Parameters

Pass parameters according to the integration scenario requirements.

ParameterTypeLengthRequiredDescriptionExample
order_notesstring0-500NoMerchant notes, returned as-is
pagesstring0-50NoPayment page terminal
  • 0: Desktop (default)
  • 1: Mobile
logoUrlstring0-50NoLogo displayed on payment page
languagestring0-50NoPayment page language. If not specified, the language will default to the browser’s language.
cssUrlstring0-50NoURL of an online CSS file to override the payment page’s style
  • Must start with https://
  • Overrides the default Oceanpayment payment page styles
  • Only applicable for Hosted Checkout and Embedded integration.
pay_websitestring0-500NoThe merchant's source URL
  • This field is required for SaaS/platform-built stores.

Additional Parameters (Alternative Payment)

Note

When using local payment methods, some additional parameters are required. Please pay attention to the specific parameter requirements for each payment method.

ParameterTypeLengthRequiredDescription
pay_bankCodestring1-50ConditionalSupported bank code
pay_countryCodestring1-50ConditionalSupported country code
pay_installmentsstring1-50ConditionalNumber of installments
pay_cpfstring1-50ConditionalConsumer CPF, CPF / taxpayer ID
pay_accountNumberstring1-50Conditional
  • ApplePay & GooglePay – Payment Token returned via direct integration
  • WeChatPay/Alipay POS payments – Merchant-scanned customer authorization code
    • WeChat authorization code format: ^1[0-6][0-9]16$
    • Alipay authorization code format: ^\d24$
  • Customer account number

Klarna Product Information

Note

When using Klarna, the total order amount must exactly match the sum of the itemized amounts; otherwise, the payment may fail.

ParameterTypeLengthRequiredDescriptionExample
itemListstring1-500YesProduct node information
  • JSON format, with a maximum of 25 nodes allowed.
{
  "0": {
    "type": "1",
    "title": "book",
    "sku": "#001",
    "price": "100",
    "quantity": "1",
    "total_amount": "100.00",
    "taxRate": "0.01",
    "taxPrice": "1",
    "image_url": "https://www.example.com/a.jpg",
    "product_url": "https://www.example.com/a.html",
    "remark": ""
  },
  "1": {
    "type": "3",
    "title": "discount",
    "sku": "#002",
    "price": "1",
    "quantity": "1",
    "total_amount": "1",
    "taxRate": "0.01",
    "taxPrice": "0.01",
    "image_url": "",
    "product_url": "",
    "remark": ""
  },
  "2": {
    "type": "4",
    "title": "shipping_fee",
    "sku": "#002",
    "price": "1",
    "quantity": "1",
    "total_amount": "1",
    "taxRate": "0.01",
    "taxPrice": "0.01",
    "image_url": "",
    "product_url": "",
    "remark": ""
  },
  "3": {
    "type": "5",
    "title": "sales_tax",
    "sku": "#002",
    "price": "1",
    "quantity": "1",
    "total_amount": "1",
    "taxRate": "1",
    "taxPrice": "1",
    "image_url": "",
    "product_url": "",
    "remark": ""
  }
}

The total order amount consists of the following components:

  • Product Amount:Unit price × quantity for each product
  • Taxes: Applicable to products, shipping, or the entire order
  • Shipping Fees: Shipping, courier, or delivery charges
  • Discounts: Coupons, promotions, or other discounts

Total Order Amount = Product Amount + Taxes + Shipping Fees − Discounts

Airline Parameters

info

Applicable for airline payment scenarios only.

ParameterTypeLengthRequiredDescriptionExample
travel_totalTaxes
string0-50No
Taxes and Fees
travel_websiteLanguage
string0-50No
Website Language
travel_ticketNumber
string1-200Yes
Ticket number
travel_adult
string1Yes
Adult number
travel_child
string1Yes
Number of children
travel_infant
string1Yes
Number of babies
travel_electronicTicket
string1Yes
Is it an electronic ticket
  • 1: True
  • 0: False
    +travel_customerInfoJson
    object-Yes
    Passenger node information (JSON format)

    QuickPay

    Create Quickpay ID

    Note

    When using the subscription scenario to create a Quickpay ID, the customer_id field is required.

    ParameterTypeLengthRequiredDescriptionExample
    customer_idstring1-50YesUser ID
    • A unique value used by the merchant to distinguish different users
    NO123456

    Initiate Payment

    Note

    When initiating a debit in subscription scenarios or quickpay, the quickpay_id field is required.

    ParameterTypeLengthRequiredDescriptionExample
    quickpay_idstring1–200YesA unique Quickpay ID generated by Oceanpayment
    • Format: UUID
    c6db7a28-7639-4d24-b7c5-6cd222c3e0fc

    Response Parameters

    Browser Synchronous Response:

    • Each payment is returned via POST to the backUrl provided in the transaction request.
    • The default return method is POST, but it can be changed to GET if needed.
    ParameterTypeDescriptionExample
    response_typestringCallback type
    • 0: browser return
    • 1: server async notification
    accountstringOceanpayment account number
    terminalstringOceanpayment terminal number
    signValuestringSecurity signature to validate the request, SHA256 encrypted
    methodsstringPayment method
    order_numberstringMerchant order ID
    order_currencystringCurrency
    order_amountstringAmount
    order_notesstringNotes
    card_numberstringCard number
    card_typestringCard type
    payment_countrystringCustomer IP country
    payment_idstringOceanpayment payment ID
    payment_statusstringTransaction status
    • -1: Pending (preauth)
    • 0: Failed
    • 1: Success
    payment_authTypestringTransaction type
    • 0: Sale
    • 1: PreAuth non-3D
    • 2: 3D non-PreAuth
    • 3: 3D PreAuth
    payment_detailsstringPayment details for display on result page
    • The website can process this and display it to the consumer on the payment result page.
    payment_solutionsstringSuggested solution if payment fails
    • The website can process this and display it to the consumer on the payment result page.
    payment_riskstringFailed risk rules (format: rule=score;...)
    pay_barCodestringOrder print code

    Asynchronous Notifications

    Refer to the full list of Oceanpayment asynchronous notification parameters.