Division
Division (also referred to as Sub-Merchant) is a logical group under a merchant that organizes multiple shops. It enables merchants to manage business units, track performance, and process payments or settlements at the division level.
Merchant management is also available for shop. Check our Merchant Management Overview for more details
Before you start
You will need to register your business in our Merchant Portal to obtain your testing credentials. After you have created your test account, make sure you have done the following:
- Finish your company registration and select Division as your solution.
- Obtain your testing credentials from the merchant portal.
Process Flow
The general flow of Division is as follows:
Visit the Division API Overview for other scenarios.

- Merchant initiates the process by calling the Create Division API to DANA to create a new division.
- DANA receives the request and begins validating the division information provided by the merchant. After validation, DANA processes the request to create a new division in the system.
- DANA returns the result of the division creation process back to the merchant, indicating success or failure.
- Merchant initiates the process by calling the Update Division API to DANA to update division information.
- DANA receives the request and validates the update division information provided by the merchant.
- DANA returns the result of the division update process back to the merchant, confirming the updated division information.
- Merchant initiates the process by calling the Query Division API to DANA to got division information.
- DANA receives the request and processes the query to retrieve division information.
- DANA returns the result containing division information details back to the merchant.
- NodeJS
- Go
- PHP
Step 1 : Library Installation
Visit our Libraries & Plugins guide for detailed information on our SDK.
DANA provides server-side API libraries for several programming languages, available through common package managers, for easier installation and version management. Follow the guide below to install our library:
Requirements
- Node.js version 18 or later
- Your testing credentials from the merchant portal.
Installation
Install using npm or visit our Githubnpm install dana-node@latest --save
Set up the env
PRIVATE_KEY or PRIVATE_KEY_PATH # Your private key
ORIGIN # Your application's origin URL
X_PARTNER_ID # clientId provided during onboarding
ENV # DANA's environment either 'sandbox' or 'production'
Obtaining merchant credentials: Authentication
Step 2 : Initialize the library
Visit our Authentication guide to learn about the authentication process when not using our Library.
Follow the guide below to initialize the library
import { Dana } from 'dana-node';
const danaClient = new Dana({
partnerId: "YOUR_PARTNER_ID", // process.env.X_PARTNER_ID
privateKey: "YOUR_PRIVATE_KEY", // process.env.X_PRIVATE_KEY
origin: "YOUR_ORIGIN", // process.env.ORIGIN
env: "sandbox", // process.env.DANA_ENV or process.env.ENV or "sandbox" or "production"
clientSecret: "YOUR_CLIENT_SECRET", // process.env.X_CLIENT_SECRET
});
const { merchantManagementApi } = danaClient;
Step 3 : Save your a new Division information
Use Create Division API to create a new division. Each division has a unique identifier (divisionId
).
To create a new division, make a POST
request to the Create Division API.
import { Dana } from 'dana-node';
import { CreateDivisionRequest, CreateDivisionResponse } from 'dana-node/merchant_management/v1';
// .. initialize client with authentication
const request: CreateDivisionRequest = {
// Define the request parameters for the API call here
};
const response: CreateDivisionResponse = await merchantManagementApi.createDivision(request);
Step 4 : Maintain your division information by hitting Update Division API
Use this API to modify or update information of an existing division (e.g. name, contact details, address, settings).
To update a division, make a POST
request to Update Division API.
import { Dana } from 'dana-node';
import { UpdateDivisionRequest, UpdateDivisionResponse } from 'dana-node/merchant_management/v1';
// .. initialize client with authentication
const request: UpdateDivisionRequest = {
// Define the request parameters for the API call here
};
const response: UpdateDivisionResponse = await merchantManagementApi.updateDivision(request);
Step 5 : Inquire your division information
Use Query Division API to retrieve the latest division information, such as getting division details by ID or getting a list of all divisions under a merchant.
import { Dana } from 'dana-node';
import { QueryDivisionRequest, QueryDivisionResponse } from 'dana-node/merchant_management/v1';
// .. initialize client with authentication
const request: QueryDivisionRequest = {
// Define the request parameters for the API call here
};
const response: QueryDivisionResponse = await merchantManagementApi.queryDivision(request);
Additional Enum Configuration
The library provides several enums (enumerations) to represent a fixed set of constant values, ensuring consistency and reducing errors during integration.
import { MobileNoInfoVerifiedEnum } from 'dana-node/merchant_management/v1';
// Use the enum value
const verified = MobileNoInfoVerifiedEnum.True;
The following enums are available in the Library Division:
- GOODS_SOLD_TYPE
- USER_PROFILING
- BusinessEntity
- DivisionIdType
- DivisionType
- DocType
- Loyalty
- OwnerIdType
- ParentRoleType
- PgDivisionFlag
- ResourceType
- ResultStatus
- ShopBizType
- ShopIdType
- ShopOwning
- ShopParentType
- SizeType
- Verified
Step 6 : Test using our automated test suite
Visit our Scenario Testing guide for detailed information on testing requirements.
We are required by local regulators to ensure your integration works correctly across all critical use cases. Use our sandbox environment and Merchant Portal to safely conduct UAT testing on a list of mandatory testing scenarios.
To complete our mandatory testing requirements, follow these steps:
- Access your Integration Checklist page inside the Merchant Portal
- Complete all the mandatory testing scenarios provided
- Download your verified API Logs using the Download Verification Proof button
- Complete your Go Live Submission checklist
- Submit your verified API logs on your Production Submission form
UAT Testing Script
Use our specialized UAT testing suite to save days of debugging.
To speed up your integration, we have provided an automated test suite. It takes under 15 minutes to run your integration against our test scenarios. Check out the Github repo for more instructions
Step 7 : Submit testing documents & apply for production
As part of regulatory compliance, merchants are required to submit UAT testing documents to meet Bank Indonesia's requirements. After completing sandbox testing, follow these steps to move to production:
Generate production keys
Create your production private and public keys, follow this instruction: Authentication - Production Credential.Complete your UAT testing checklist
Confirm that you have completed all testing scenarios from our Merchant Portal.Fill out your Production Submission form
Follow the instructions inside our Merchant Portal to apply for production credentials. We will process your application in 1-2 days.Obtain production credentials
Once approved, you will receive your production credentials such as: Merchant ID, Client ID known as X-PARTNER-ID, and Client Secret.
Testing in production environment
Configure production environment
Switch your application settings from sandbox to production environment by updating the API endpoints and credentials.Test using production credentials
Conduct the same testing scenarios as sandbox testing, using your production credentials.UAT production sign-off
Once testing is complete, DANA will prepare the UAT Production Sign Off document in the Merchant Portal. Both merchant and DANA representatives must sign this document to formally approve the integration.Receive live payments
After receiving all approvals, your DANA integration will be activated and ready for live payments from your customers.
Ready to submit testing documents?
Access our merchant portal for detailed guide to start receiving live payments
Step 1 : Library Installation
Visit our Libraries & Plugins guide for detailed information on our SDK.
DANA provides server-side API libraries for several programming languages, available through common package managers, for easier installation and version management. Follow the guide below to install our library:
Requirements
- go.mod
- go.sum file
- Your testing credentials from the merchant portal.
Installation
Install or visit our Githubgo get github.com/dana-id/dana-go
Set up the env
PRIVATE_KEY or PRIVATE_KEY_PATH # Your private key
ORIGIN # Your application's origin URL
X_PARTNER_ID # clientId provided during onboarding
ENV # DANA's environment either 'sandbox' or 'production'
Obtaining merchant credentials: Authentication
Import Package
import (
merchant_management "github.com/dana-id/dana-go/merchant_management/v1"
)
Step 2 : Initialize the library
Visit our Authentication guide to learn about the authentication process when not using our Library.
Follow the guide below to initialize the library
package main
import (
"context"
"fmt"
"os"
dana "github.com/dana-id/dana-go"
"github.com/dana-id/dana-go/config"
merchant_management "github.com/dana-id/dana-go/merchant_management/v1"
)
func main() {
configuration := config.NewConfiguration()
// Set API keys
configuration.APIKey = &config.APIKey{
// ENV: config.ENV_SANDBOX, // use config.ENV_PRODUCTION for production. Can use DANA_ENV instead
DANA_ENV: config.ENV_SANDBOX, // use config.ENV_PRODUCTION for production
X_PARTNER_ID: os.Getenv("X_PARTNER_ID"),
PRIVATE_KEY: os.Getenv("PRIVATE_KEY"),
ORIGIN: os.Getenv("ORIGIN"),
// PRIVATE_KEY_PATH: os.Getenv("PRIVATE_KEY_PATH"),
}
apiClient := dana.NewAPIClient(configuration)
Step 3 : Save your a new division information
Use Create Division API to create a new division. Each division has a unique identifier (divisionId
).
To create a new division, make a POST
request to the Create Division API.
package main
import (
"context"
"fmt"
"os"
dana "github.com/dana-id/dana-go"
"github.com/dana-id/dana-go/config"
merchant_management "github.com/dana-id/dana-go/merchant_management/v1"
)
func main() {
_, r, err := apiClient.MerchantManagementAPI.CreateDivision(context.Background()).CreateDivisionRequest(request).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MerchantManagementAPI.CreateDivision``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateDivision`: CreateDivisionResponse
fmt.Fprintf(os.Stdout, "Response from `MerchantManagementAPI.CreateDivision`: %v\n", r.Body)
}
Step 4 : Maintain your division information by hitting Update Division API
Use this API to update information about an existing division. You can modify existing division information such as name, address, phone number, etc.
To update a division, make a POST
request to Update Division API.
package main
import (
"context"
"fmt"
"os"
dana "github.com/dana-id/dana-go"
"github.com/dana-id/dana-go/config"
merchant_management "github.com/dana-id/dana-go/merchant_management/v1"
)
func main() {
// ... define authentication
request := merchant_management.UpdateDivisionRequest{
// Fill in required fields here, refer to Update Division API Detail
}
_, r, err := apiClient.MerchantManagementAPI.UpdateDivision(context.Background()).UpdateDivisionRequest(request).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MerchantManagementAPI.UpdateDivision``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateDivision`: UpdateDivisionResponse
fmt.Fprintf(os.Stdout, "Response from `MerchantManagementAPI.UpdateDivision`: %v\n", r.Body)
}
Step 5 : Inquire your division information
Use Query Division API to retrieve the latest division information, such as getting division details by ID or getting a list of all divisions under a merchant.
package main
import (
"context"
"fmt"
"os"
dana "github.com/dana-id/dana-go"
"github.com/dana-id/dana-go/config"
merchant_management "github.com/dana-id/dana-go/merchant_management/v1"
)
func main() {
// ... define authentication
request := merchant_management.QueryDivisionRequest{
// Fill in required fields here, refer to Query Division API Detail
}
_, r, err := apiClient.MerchantManagementAPI.QueryDivision(context.Background()).QueryDivisionRequest(request).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `MerchantManagementAPI.QueryDivision``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `QueryDivision`: QueryDivisionResponse
fmt.Fprintf(os.Stdout, "Response from `MerchantManagementAPI.QueryDivision`: %v\n", r.Body)
}
Additional Enum Configuration
The library provides several enums (enumerations) to represent a fixed set of constant values, ensuring consistency and reducing errors during integration.
import merchant_management "github.com/dana-id/dana-go/merchant_management/v1"
value := string(merchant_management.SHOPPARENTTYPE_MERCHANT_)
The following enums are available in the Library Division:
- GOODS_SOLD_TYPE
- USER_PROFILING
- BusinessEntity
- DivisionIdType
- DivisionType
- DocType
- Loyalty
- OwnerIdType
- ParentRoleType
- PgDivisionFlag
- ResourceType
- ResultStatus
- ShopBizType
- ShopIdType
- ShopOwning
- ShopParentType
- SizeType
- Verified
Step 6 : Test using our automated test suite
Visit our Scenario Testing guide for detailed information on testing requirements.
We are required by local regulators to ensure your integration works correctly across all critical use cases. Use our sandbox environment and Merchant Portal to safely conduct UAT testing on a list of mandatory testing scenarios.
To complete our mandatory testing requirements, follow these steps:
- Access your Integration Checklist page inside the Merchant Portal
- Complete all the mandatory testing scenarios provided
- Download your verified API Logs using the Download Verification Proof button
- Complete your Go Live Submission checklist
- Submit your verified API logs on your Production Submission form
UAT Testing Script
Use our specialized UAT testing suite to save days of debugging.
To speed up your integration, we have provided an automated test suite. It takes under 15 minutes to run your integration against our test scenarios. Check out the Github repo for more instructions
Step 7 : Submit testing documents & apply for production
As part of regulatory compliance, merchants are required to submit UAT testing documents to meet Bank Indonesia's requirements. After completing sandbox testing, follow these steps to move to production:
Generate production keys
Create your production private and public keys, follow this instruction: Authentication - Production Credential.Complete your UAT testing checklist
Confirm that you have completed all testing scenarios from our Merchant Portal.Fill out your Production Submission form
Follow the instructions inside our Merchant Portal to apply for production credentials. We will process your application in 1-2 days.Obtain production credentials
Once approved, you will receive your production credentials such as: Merchant ID, Client ID known as X-PARTNER-ID, and Client Secret.
Testing in production environment
Configure production environment
Switch your application settings from sandbox to production environment by updating the API endpoints and credentials.Test using production credentials
Conduct the same testing scenarios as sandbox testing, using your production credentials.UAT production sign-off
Once testing is complete, DANA will prepare the UAT Production Sign Off document in the Merchant Portal. Both merchant and DANA representatives must sign this document to formally approve the integration.Receive live payments
After receiving all approvals, your DANA integration will be activated and ready for live payments from your customers.
Ready to submit testing documents?
Access our merchant portal for detailed guide to start receiving live payments
Step 1 : Library Installation
Visit our Libraries & Plugins guide for detailed information on our SDK.
DANA provides server-side API libraries for several programming languages, available through common package managers, for easier installation and version management. Follow the guide below to install our library:
Requirements
- PHP 7.4+, compatible with PHP 8.0.
- Your testing credentials from the merchant portal.
Installation
Install using composer or visit our Github- Using Composer
- Add the following code to
composer.json
- Add the following code to
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
- Run
composer install
- Manual Installation
<?php
require_once('/path/to/DanaPhp/vendor/autoload.php');
Set up the env
PRIVATE_KEY or PRIVATE_KEY_PATH # Your private key
ORIGIN # Your application's origin URL
X_PARTNER_ID # clientId provided during onboarding
ENV # DANA's environment either 'sandbox' or 'production'
CHANNEL_ID # XXX
Obtaining merchant credentials: Authentication
Import Package
use Dana\MerchantManagement\v1
Step 2 : Initialize the library
Visit our Authentication guide to learn about the authentication process when not using our Library.
Follow the guide below to initialize the library
<?php
use Dana\Configuration;
use Dana\Env;
use Dana\MerchantManagement\v1\Api\MerchantManagementApi;
use Dana\MerchantManagement\v1\Model\QueryDivisionRequest;
// Set up configuration with authentication settings
$configuration = new Configuration();
// The Configuration constructor automatically loads values from environment variables
// Choose one of PRIVATE_KEY or PRIVATE_KEY_PATH to set, if you set both, PRIVATE_KEY will be ignored
$configuration->setApiKey('PRIVATE_KEY', getenv('PRIVATE_KEY'));
// $configuration->setApiKey('PRIVATE_KEY_PATH', getenv('PRIVATE_KEY_PATH'));
$configuration->setApiKey('ORIGIN', getenv('ORIGIN'));
$configuration->setApiKey('X_PARTNER_ID', getenv('X_PARTNER_ID'));
$configuration->setApiKey('DANA_ENV', Env::SANDBOX);
// Choose one of ENV or DANA_ENV to set, if you set both, ENV will be ignored
// $configuration->setApiKey('ENV', Env::SANDBOX);
$configuration->setApiKey('CLIENT_SECRET', getenv('CLIENT_SECRET'));
$apiInstance = new MerchantManagementApi(
null, // this also can be set to custom http client which implements `GuzzleHttp\ClientInterface`
$configuration
);
Step 3 : Save your a new division information
Use Create Division API to create a new division. Each division has a unique identifier (divisionId
).
To create a new division, make a POST
request to the Create Division API.
<?php
use Dana\Configuration;
use Dana\Env;
use Dana\MerchantManagement\v1\Api\MerchantManagementApi;
use Dana\MerchantManagement\v1\Model\CreateDivisionRequest;
// ... define authentication
$createDivisionRequest = CreateDivisionRequest();
try {
$result = $apiInstance->createDivision($createDivisionRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MerchantManagementApi->createDivision: ', $e->getMessage(), PHP_EOL;
}
Step 4 : Maintain your division information by hitting Update Division API
Use this API to update information about an existing division. You can modify existing division (e.g. name, contact details, address, settings).
To update a division, make a POST
request to Update Division API.
<?php
use Dana\Configuration;
use Dana\Env;
use Dana\MerchantManagement\v1\Api\MerchantManagementApi;
use Dana\MerchantManagement\v1\Model\UpdateDivisionRequest;
// ... define authentication
$updateDivisionRequest = UpdateDivisionRequest();
try {
$result = $apiInstance->updateDivision($updateDivisionRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MerchantManagementApi->updateDivision: ', $e->getMessage(), PHP_EOL;
}
Step 5 : Inquire your division information
Use Query Division API to retrieve the latest division information, such as getting division details by ID or getting a list of all divisions under a merchant.
<?php
use Dana\Configuration;
use Dana\Env;
use Dana\MerchantManagement\v1\Api\MerchantManagementApi;
use Dana\MerchantManagement\v1\Model\QueryDivisionRequest;
// ... define authentication
$queryDivisionRequest = QueryDivisionRequest();
try {
$result = $apiInstance->queryDivision($queryDivisionRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MerchantManagementApi->queryDivision: ', $e->getMessage(), PHP_EOL;
}
Additional Enum Configuration
The library provides several enums (enumerations) to represent a fixed set of constant values, ensuring consistency and reducing errors during integration.
// Importing an enum class
use Dana\MerchantManagement\v1\Enum\GoodsSoldType;
// Using enum constants
$model->setProperty(GoodsSoldType::DIGITAL);
// Using enum values directly as strings
$model->setProperty('DIGITAL');
The following enums are available in the Library Division:
- GOODS_SOLD_TYPE
- USER_PROFILING
- BusinessEntity
- DivisionIdType
- DivisionType
- DocType
- Loyalty
- OwnerIdType
- ParentRoleType
- PgDivisionFlag
- ResourceType
- ResultStatus
- ShopBizType
- ShopIdType
- ShopOwning
- ShopParentType
- SizeType
- Verified
Step 6 : Test using our automated test suite
Visit our Scenario Testing guide for detailed information on testing requirements.
We are required by local regulators to ensure your integration works correctly across all critical use cases. Use our sandbox environment and Merchant Portal to safely conduct UAT testing on a list of mandatory testing scenarios.
To complete our mandatory testing requirements, follow these steps:
- Access your Integration Checklist page inside the Merchant Portal
- Complete all the mandatory testing scenarios provided
- Download your verified API Logs using the Download Verification Proof button
- Complete your Go Live Submission checklist
- Submit your verified API logs on your Production Submission form
UAT Testing Script
Use our specialized UAT testing suite to save days of debugging.
To speed up your integration, we have provided an automated test suite. It takes under 15 minutes to run your integration against our test scenarios. Check out the Github repo for more instructions
Step 7 : Submit testing documents & apply for production
As part of regulatory compliance, merchants are required to submit UAT testing documents to meet Bank Indonesia's requirements. After completing sandbox testing, follow these steps to move to production:
Generate production keys
Create your production private and public keys, follow this instruction: Authentication - Production Credential.Complete your UAT testing checklist
Confirm that you have completed all testing scenarios from our Merchant Portal.Fill out your Production Submission form
Follow the instructions inside our Merchant Portal to apply for production credentials. We will process your application in 1-2 days.Obtain production credentials
Once approved, you will receive your production credentials such as: Merchant ID, Client ID known as X-PARTNER-ID, and Client Secret.
Testing in production environment
Configure production environment
Switch your application settings from sandbox to production environment by updating the API endpoints and credentials.Test using production credentials
Conduct the same testing scenarios as sandbox testing, using your production credentials.UAT production sign-off
Once testing is complete, DANA will prepare the UAT Production Sign Off document in the Merchant Portal. Both merchant and DANA representatives must sign this document to formally approve the integration.Receive live payments
After receiving all approvals, your DANA integration will be activated and ready for live payments from your customers.
Ready to submit testing documents?
Access our merchant portal for detailed guide to start receiving live payments