Getting Started

Direct API integration Guide

5min

Introduction

This guide aims to assist you in incorporating our Direct APIs into your system. If you have no intention of utilising octifi-websdk.js, kindly proceed with reading the following information.

Recommendation

We recommend using our provided SDK if you're comfortable using JavaScript on your client-side, as it hides complexity and is the suggested way to integrate with our APIs. You can learn more about using it in our web integration guide.ο»Ώ

Alternatively, you can use the REST APIs and manually redirect the user in simple steps

ο»Ώ

Integration Architecture
Integration Architecture
ο»Ώ

ο»Ώ

Obtain a pre-checkout token by sending a POST request to the endpoint provided below, using your public key. The API response will contain the pre-checkout token.
POST
Request
Header Parameters
Authorization
required
String
Api-Key <Public-Key>
ο»Ώ

Key

Required

Description

Example Value

config

Yes

Configuration settings for the payment modal.

Object

modal

Yes

Indicates whether a modal (popup) should be displayed for the payment process.

Note: It should be always false. As we deprecated the modal popup

false

public_api_key

Yes

Public API key used for authentication.

"your public key"

merchant_logo

No

URL or path to the merchant's logo image.

"" (empty string, no logo specified)

redirect_confirmation_url_action

Yes

The HTTP method (GET ) used to redirect users to the confirmation URL.

Note: POST method deprecated.

"GET"

redirect_callbacks

Yes

Configuration for redirect URLs upon payment success and failure.

Object

onSuccess

Yes

URL to redirect to when the payment is successful.

"https://your_app.com/callback/success/"

onFail

Yes

URL to redirect to when the payment fails.

"https://your_app.com/callback/failed/"

checkout

Yes

Payment checkout details.

Object

checkout

Yes

Nested object for payment checkout.

Object

checkout

Yes

Nested object for payment checkout.

Object

merchant

Yes

Information about the merchant.

Object

name

Yes

Name of the merchant.

"Merchant Name"

bill

Yes

Billing details for the purchase.

Object

display_name

No

Display name or description of the product being purchased.

"Product purchase name"

tax_amount

Yes

The tax amount for the purchase (if applicable).

0

total_amount

Yes

The total purchase amount.

"500" or "500.98"

currency

Yes

The currency code for the purchase.

"MYR" or "SGD"

merchant_order_id

Yes

Unique identifier for the merchant's order. Can we UUID or numeric or alpha numeric

"487b0b67-7924-4484-ab14-ee7e51fb7c3d" or "1234555" or "ORD_123123"

customer

Yes

Customer details.

Object

phone_number

No

Customer's phone number. For better user experience

"" (empty string, no phone number specified)

email

No

Customer's email address.

country_code

No

Country code for the customer's location.

"" (empty string, no country code specified)

modal

Yes

Indicates whether a modal (popup) should be displayed for the payment process within the checkout section.

Note: It should be always false. As we deprecated the modal popup

false

Generate a checkout token using the pre-checkout token obtained in Step 1. To obtain the checkout token, send a POST request to the endpoint provided below, using your public key. The API response will contain the checkout token.
POST
Request
Header Parameters
Authorization
required
String
Api-Key <Public-Key>
ο»Ώ
Create a charge by sending a POST request to the endpoint provided below, using your private key. The API response will contain a charge ID, which should be saved for future refunds.
POST
Request
Header Parameters
Authorization
required
String
Api-Key <Private-Key>
ο»Ώ
If you don't want to capture a charge immediately upon creating it, you can set the is_capture parameter to false in the charge create API (Step 3) . Then, you can use the charge_id to capture the charge at a later time by making another API call.
POST
Request
Header Parameters
Authrization
required
String
Api-Key <Private-Key>
ο»Ώ

ο»Ώ