NAV Navbar
json php

Getting Started

Welcome to Duitku OVO Payment API Documentation page. This process is used to create payment with OVO from merchant site without redirected to Duitku payment page.

This process will send push payment notification to customer who have registered in OVO apps. If appropriate, the customer can approve the payment on their OVO apps.

Create Transaction

You can create transaction by sending this API request to duitku server.

HTTP Request

Method : HTTP POST

Type : application/json

Development : https://sandbox.duitku.com/webapi/api/merchant/ovo/createtransaction

Production : https://passport.duitku.com/webapi/api/merchant/ovo/createtransaction

Request Parameters Create Transaction

<?php
    $merchantCode = 'DXXXXX'; // from duitku
    $apiKey = 'XXXXXXXXXX7968XXXXXXXXXFB05332AF'; // from duitku
    $paymentAmount = 40000;
    $merchantOrderId = time() . ''; // from merchant duitku unique
    $productDetails = 'Payment example for OVO H2H';
    $additionalParam = ''; // optional
    $merchantUserInfo = ''; // optional
    $email = '[email protected]'; // Customer's email
    $phoneNumber = '08123456789'; // Customer's phone
    $signature = md5($merchantCode . $merchantOrderId . $paymentAmount . $apiKey);

    $item1 = array(
        'name' => 'Test Item 1',
        'price' => 20000,
        'quantity' => 1);

    $item2 = array(
        'name' => 'Test Item 2',
        'price' => 20000,
        'quantity' => 2);

    $itemDetails = array(
        $item1, $item2
    );

    $params = array(
        'merchantCode' => $merchantCode,
        'paymentAmount' => $paymentAmount,
        'merchantOrderId' => $merchantOrderId,
        'productDetails' => $productDetails,
        'additionalParam' => $additionalParam,
        'merchantUserInfo' => $merchantUserInfo,
        'email' => $email,
        'phoneNumber' => $phoneNumber,
        'itemDetails' => $itemDetails,
        'signature' => $signature
    );

    $params_string = json_encode($params);
    //echo $params_string;
    $url = 'https://sandbox.duitku.com/webapi/api/merchant/ovo/createtransaction'; // Sandbox
    // $url = 'https://passport.duitku.com/webapi/api/merchant/ovo/createtransaction'; // Production
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
    curl_setopt($ch, CURLOPT_POSTFIELDS, $params_string);                                                                  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
        'Content-Type: application/json',                                                                                
        'Content-Length: ' . strlen($params_string))                                                                       
    );   
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

    //execute post
    $request = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

    if($httpCode == 200)
    {
        $result = json_decode($request, true);
        echo "merchantCode :". $result['merchantCode'] . "<br />";
        echo "amount :". $result['amount'] . "<br />";
        echo "merchantOrderId:". $result['merchantOrderId'] . "<br />";
        echo "productDetail :". $result['productDetail'] . "<br />";
        echo "additionalParam:". $result['additionalParam'] . "<br />";
        echo "paymentCode :". $result['paymentCode'] . "<br />";
        echo "resultCode :". $result['resultCode'] . "<br />";
        echo "reference :". $result['reference'] . "<br />";
        echo "signature :". $result['signature'] . "<br />";
    }
    else
    {
        $request = json_decode($request);
        $error_message = "Server Error " . $httpCode ." ". $request->Message;
        echo $error_message;
    }
?>
{ 
   "merchantCode":"DXXXXX",
   "paymentAmount":40000,
   "merchantOrderId":"1579838431",
   "productDetails":"Payment example for OVO H2H",
   "additionalParam":"",
   "merchantUserInfo":"",
   "email":"[email protected]",
   "itemDetails":[ 
      { 
         "name":"Test Item 1",
         "price":10000,
         "quantity":1
      },
      { 
         "name":"Test Item 2",
         "price":30000,
         "quantity":3
      }
   ],
   "phoneNumber":"08123456789",
   "signature":"506XXXf1XXXdfb4aXXX1ffXXX9b8d1e6"
}
Parameter Type Required Description Example
merchantCode string(50)

Merchant Code obtained from Projects in Duitku Dashboard. DXXXX
paymentAmount integer

Transaction payment amount. 40000
merchantOrderId string(50)

Order Id/ transaction Id from merchant. 1579838431
productDetails string(255)

Description about product/service on sale. Payment example for OVO H2H
email string(255)

Your customer's email. [email protected]
additionalParam string(255)

Additional parameter for merchant purpose (optional).
merchantUserInfo string(255)

Customer's username or email on merchant site (optional). [email protected]
phoneNumber string(50)

Customer's phone number. 08123456789
itemDetails ItemDetail

Product item details (optional).
signature string(255)

Transaction security identification code. Formula: MD5(merchantcode + orderId + amount + merchantKey). 506XXXf1XXXdfb4aXXX1ffXXX9b8d1e6

Response Parameters Create Transaction

{
  "merchantCode": "DXXXX",
  "amount": 40000,
  "merchantOrderId": "1579838431",
  "productDetail": "Payment example for OVO H2H",
  "additionalParam": "",
  "paymentCode":"OV",
  "resultCode": "00",
  "reference": "DXXXXCX80TXXX5Q70QCI",
  "signature": "7f6XXXf1XXXdf23sXXX1ffXXX9b8daef"
}
Parameter Type Description Example
merchantCode string Merchant Code obtained from Projects in Duitku Dashboard. DXXXX
amount integer Transaction amount without decimal code nor decimal digits. 40000
merchantOrderId string Order Id/ transaction Id from merchant. 1579838431
productDetail string Description of merchant product. Payment example for OVO H2H
additionalParam string Additional parameter for merchant purpose.
paymentCode string Payment method code for being used. OV
resultCode string Response code refers to Response Code section. 00 - Success
reference string Reference number from duitku (need to be saved on your system). DXXXXCX80TXXX5Q70QCI
signature string Transaction security identification code. Formula: MD5(merchantcode + amount + merchantOrderId + merchantKey). 7f6XXXf1XXXdf23sXXX1ffXXX9b8daef

JSON Object

List(collection) of JSON objects that Duitku has.

Item Details

"itemDetails": [{
    "price": 40000,
    "quantity": 2,
    "name": "Item 1",
  }]
Parameter Type Required Description Example
name string(50)

Name of the item. Item 1
quantity integer

Quantity of the item bought. 2
price integer

Price of the Item Note: Don't add decimal. 40000

Status Code

Response Code Description

00

Success / Approved.

01

Failed.

08

Voucher Code Already Used.

11

Invalid Account Type.

13

Invalid Amount.

14

Invalid Mobile Number / OVO ID.

16

Invalid Card Number.

17

Transaction Decline.

18

Invalid Voucher Code.

26

Transaction Failed (Failed to push payment confirmation to OVO apps).

30

Format Error (Invalid ISO Specs).

40

Transaction Failed (Error in 3rd party, including error to deduct/topup e-money).

44

Expired Refund Code (Over the time limit to refund).

51

Insufficient Fund.

56

Card Blocked.

57

Transaction Failed (Not eligible to do refund, siloam balance = 0).

58

Transaction Not Allowed (Not valid transaction in merchant / terminal).

61

Exceed Transaction Limit (set by User).

63

Security Violation.

64

Account Blocked.

65

Transaction Failed (Limit transaction exceed on transaction count or amount).

66

Invalid Code (Wrong input withdrawal code).

67

Below Transaction Limit (Transaction amount less than minimum payment).

ER

System Failure in OVO System.

EB

Terminal Blocked (Merchant / Terminal not registered).

404

Not Found (Expired push payment / customer ignore the transaction).

Changelog

Version 1.0

Apr 2020