Integration Guide

The steps for technical integration of Snap are explained below.


Preparation

Sign Up for Merchant Account

Sign up for a Merchant Administration Portal (MAP) account, to get your API Key.

Retrieving API Keys

Retrieve API key that will be used for this guide.


Integration Steps Overview

  1. Acquire redirect url

  2. Display Snap payment page on frontend

  3. Customer perform payment on payment page

  4. Handling payment status update on your backend


1. Acquiring Redirect URL

API request should be done from merchant backend to acquire Snap transaction token by providing payment information and Server Key. There are at least three components that are required to obtain the Snap token which are explained in the table given below.

Element
Description

API Key

API server key. For more details, refer to Retrieving API Access Keys

order_no

Unique transaction order ID, defined from your side. One ID could be used only once for the order of the material. Allowed character are Alphanumeric, dash(-), underscore(_), and dot (.) String, max 50.

merchant_id

your merchant ID. Integer.

amount

transaction amount. Integer.

phone

customer phone, optional. Integer, max 15.

name

customer name, optional. String.

email

customer email, optional. Email.

Charge API Sample Request

base_url :

Endpoints

Environment
Method
URL

Production

POST

{{base_url}}/merchant/fiat/order

HTTP Headers

Accept

application/json

Content-Type

application/json

Authorization

API-KEY

API-KEY: "YourApiKey"

Sample Request to Obtain Transaction URL

curl --location -g '{{host}}/merchant/fiat/order' \
--data '{
    "order_no" : "N-12346",
    "merchant_id" : "12",
    "amount" : "200000",
    "phone" : "081208120812",
    "name" : "customer name"
}'
Using Postman

Postman is an API development tool which is used to build, test and modify APIs. You can view our Postman Collection with the steps given below.

  1. Download and open Postman.

  2. Use this button to import our Postman Collection.

Run in Postman

  1. Navigate to Create Order Fiat.

  2. For more details, refer to Postman Collection.

Successful Sample Response

{
    "status_code": 201,
    "message": "Order created successfully",
    "data": {
        "request": {
            "order_no": "N-12346",
            "merchant_id": 12,
            "amount": 200000,
            "phone": 81208120812,
            "name": "customer name",
            "email": "testing@gmail.com",
            "currency": "IDR"
        },
        "url": "https://webview.neropay.id?key=l1e3heBxF/qkps94trvEAtBFuj3fo399i4TVdQr8GycKzs1kUEy5UEd7ld/3GWTDvl+gg494kcJ6h2VXP/pOPNFO508nyUxosETk4JT3X2Qf8RfyzVo2WKauSEr4yKbz",
        "key": "l1e3heBxF/qkps94trvEAtBFuj3fo399i4TVdQr8GycKzs1kUEy5UEd7ld/3GWTDvl+gg494kcJ6h2VXP/pOPNFO508nyUxosETk4JT3X2Qf8RfyzVo2WKauSEr4yKbz"
    }
}

Status Codes and Errors

Status Code
Description
Example

201

Successful creation of url.

"url": "https://webview.neropay.id?key=l1e3heBxF/qkps94trvEAtBFuj3fo399i4TVdQr8GycKzs1kUEy5UEd7ld/3GWTDvl+gg494kcJ6h2VXP/pOPNFO508nyUxosETk4JT3X2Qf8RfyzVo2WKauSEr4yKbz"

400

Failed to create a URL.

"Error Bad Request"

401

Failed to create a URL.

"Error Unathorized"

500

Failed to create a URL.

"Internal Server Error"

2. Displaying Snap Payment Page on Frontend

To display Snap payment page within your site, there is a method to choose.

Redirection Method

You can use url retrieved from backend in the previous step to redirect customer to url hosted by Neropay.

You can also use WebView to display Snap payment page within your mobile app - also useful if you're looking to implement in cross platform applications (e.g Flutter or React) or native applications (SDK method is also available and recommended for native app).

Redirection Method - Using url

Last updated