Skip to content

Create Payment Request (Direct App)

Create payment request is feature to generate payment link. This endpoint will give you payment link in the response JSON to pay customer transaction. Specifically for OVO, this feature is used to make payment requests that generate push notification payments to the OVO application. All channel will be happen in Asynchronous processing.

##JSON Attributes

NameData TypeRequiredDetails
external_idString(64)YesUnique string from merchant, used in signature. Only accepts Alphabet, numeric and dash '-'
order_idString(255)YesOnly allow '-' for special characters, not unique, may be duplicated. OVO only supports 25 chars
currencyString (3)YesValue: IDR
payment_methodStringYesFixed value: wallet
payment_channelString(20)YesFixed values: SHOPEEPAY, OVO, LINKAJA, DANA, VIRGO
payment_detailsObjectYes-
1) amountnumeric(13)YesMinimum 1000 (OVO minimum amount is IDR 1), max depends on acquirer (usually 2M IDR basic KYC, 10M full KYC). OVO max IDR 20M
2) transaction_descriptionString (255)Yes-
3) expired_timeStringNoISO 8601 format YYYY-MM-DDTHH:mm:ss.SSSZ, min 15 minutes, max 1 hour. OVO and LINKAJA ignore this value (OVO default 55s, LINKAJA default 5 min)
customer_detailsObjectYes-
1) emailString(255)Yes-
2) full_nameString(100)Yes-
3) phoneString(18)No-
item_detailsObjectNo-
1) item_idString(25)OptionalMandatory if item_details is used
2) nameString(50)OptionalMandatory if item_details is used
3) amountNumeric(13)OptionalMandatory if item_details is used
4) qtyNumeric(5)OptionalMandatory if item_details is used
5) descriptionString(255)No-
wallet_detailsObjectYes-
1) idString(50)YesUser's phone number (prefix 628 or 08) or email. For OVO use phone number; payment notifications sent here
2) id_typeenumYesHP, EMAIL
payment_optionsObjectNo-_

##Information

Hostnamehttps://api-stage.ifortepay.id
Path/ewallet/v2/create-payment
HTTP MethodPOST

##Headers

KeyFormatRequiredValue
Content-Typeapplication/jsonYes
AuthorizationStringYes
x-req-signatureStringYes
x-versionStringYesv3

##Example

Body raw
json
{ 
    "external_id": "{{merchant_unique_id}}", 
    "order_id": "{{order_id}}", 
    "currency": "IDR", 
    "payment_method": "WALLET", 
    "payment_channel": "{{channel_name: OVO/SHOPEEPAY/DANA/LINKAJA/VIRGO}}", 
    "payment_details": { 
        "amount": {{amount}}, 
        "expired_time": "{{expired_time, e.g:2021-04-06T18:40:30.791+07:00}}", 
        "transaction_description": "{{transaction_description}}"
    }, 
    "customer_details": {
        "email": "{{customer_email}}", 
        "full_name": "{{customer_full_name}}", 
        "phone": "{{customer_phone_number}}"
    },
    "item_details": [
         {
            "item_id": "{{item_detail_id}}",
            "name": "{{item_detail_name}}",
            "amount": {{item_detail_amount = item.amount * item.qty must match with payment_details.amount}},
            "qty": {{item_detail_qty}},
            "description": "{{item_detail_description}}"
        },
        {
            ....
        }
    ],
    "wallet_details": { 
        "id": "{{idvalue: customer_registered_HP}}", 
        "id_type": "HP"
    },  
    "payment_options":{
        "token":"{{access_token}}" *only used for DANA account binding
    },
    "billing_address": {
        "full_name": "{{customer_billing_full_name}}",
        "phone": "{{customer_billing_phone_number}}",
        "address": "{{customer_billing_address}}",
        "city": "{{customer_billing_city}}",
        "postal_code": "{{customer_billing_postalcode}}",
        "country": "{{customer_billing_indonesia}}"
    },
    "shipping_address": {
        "full_name": "{{customer_shipping_full_name}}",
        "phone": "{{customer_shipping_phone_number}}",
        "address": "{{customer_shipping_address}}",
        "city": "{{customer_shipping_city}}",
        "postal_code": "{{customer_shipping_postalcode}}",
        "country": "{{customer_shipping_indonesia}}"
    },
    "additional_data": "{{free text}}",
    "callback_url": "{{merchant_callback_url}}",
    "return_url": "{{merchant_returnpage_url}}"
}
Example Request
shell
curl --location 'https://api-stage.ifortepay.id/ewallet/v2/create-payment' \
--header 'Authorization: {{Authorization}}' \
--header 'x-req-signature: {{x-req-signature}}' \
--header 'Content-Type: application/json' \
--header 'x-version: v3' \
--data-raw '{    
    "external_id": "merchant-unique-id",
    "order_id": "merchant-order-id",
    "currency": "IDR", 
    "payment_method": "wallet", 
    "payment_channel": "SHOPEEPAY", 
    "payment_details": { 
        "amount": 1000, 
        "expired_time": "2021-04-06T18:40:30.791+07:00", 
        "transaction_description": "Merchant Transaction Description"
    }, 
    "customer_details": {
        "email": "customer@email.com", 
        "full_name": "Your Customer Name", 
        "phone": "081111111111"
    },
    "item_details": [
         {
            "item_id": "item-1",
            "name": "Merchant item name",
            "amount": 200,
            "qty": 5,
            "description": "item-description"
        },
        {
            ....
        }
    ],
    "wallet_details": { 
        "id": "628111111111", 
        "id_type": "HP"
    },
    "billing_address": {
        "phone": "628888888888",
        "address": "Alamat saya",
        "city": "Jakarta",
        "postal_code": "12345",
        "country": "Indonesia",
        "full_name": "billing customer fullname"
    },
    "shipping_address": {
        "phone": "628888888888",
        "address": "Alamat saya",
        "city": "Jakarta",
        "postal_code": "12345",
        "country": "Indonesia",
        "full_name": "billing customer fullname"
    },
    "additional_data": "Your Free Text",
    "callback_url": "https://merchant.callback.url",
    "return_url": "https://merchant.return.url"
}'
go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-stage.ifortepay.id/ewallet/v2/create-payment"
  method := "POST"

  payload := strings.NewReader(`{    
    "external_id": "merchant-unique-id",
    "order_id": "merchant-order-id",
    "currency": "IDR", 
    "payment_method": "wallet", 
    "payment_channel": "SHOPEEPAY", 
    "payment_details": { 
        "amount": 1000, 
        "expired_time": "2021-04-06T18:40:30.791+07:00", 
        "transaction_description": "Merchant Transaction Description"
    }, 
    "customer_details": {
        "email": "customer@email.com", 
        "full_name": "Your Customer Name", 
        "phone": "081111111111"
    },
    "item_details": [
         {
            "item_id": "item-1",
            "name": "Merchant item name",
            "amount": 200,
            "qty": 5,
            "description": "item-description"
        },
        {
            ....
        }
    ],
    "wallet_details": { 
        "id": "628111111111", 
        "id_type": "HP"
    },
    "billing_address": {
        "phone": "628888888888",
        "address": "Alamat saya",
        "city": "Jakarta",
        "postal_code": "12345",
        "country": "Indonesia",
        "full_name": "billing customer fullname"
    },
    "shipping_address": {
        "phone": "628888888888",
        "address": "Alamat saya",
        "city": "Jakarta",
        "postal_code": "12345",
        "country": "Indonesia",
        "full_name": "billing customer fullname"
    },
    "additional_data": "Your Free Text",
    "callback_url": "https://merchant.callback.url",
    "return_url": "https://merchant.return.url"
} `)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "{{Authorization}}")
  req.Header.Add("x-req-signature", "{{x-req-signature}}")
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("x-version", "v3")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
js
var axios = require('axios');
var data = '{    \n    "external_id": "merchant-unique-id",\n    "order_id": "merchant-order-id",\n    "currency": "IDR", \n    "payment_method": "wallet", \n    "payment_channel": "SHOPEEPAY", \n    "payment_details": { \n        "amount": 1000, \n        "expired_time": "2021-04-06T18:40:30.791+07:00", \n        "transaction_description": "Merchant Transaction Description"\n    }, \n    "customer_details": {\n        "email": "customer@email.com", \n        "full_name": "Your Customer Name", \n        "phone": "081111111111"\n    },\n    "item_details": [\n         {\n            "item_id": "item-1",\n            "name": "Merchant item name",\n            "amount": 200,\n            "qty": 5,\n            "description": "item-description"\n        },\n        {\n            ....\n        }\n    ],\n    "wallet_details": { \n        "id": "628111111111", \n        "id_type": "HP"\n    },\n    "billing_address": {\n        "phone": "628888888888",\n        "address": "Alamat saya",\n        "city": "Jakarta",\n        "postal_code": "12345",\n        "country": "Indonesia",\n        "full_name": "billing customer fullname"\n    },\n    "shipping_address": {\n        "phone": "628888888888",\n        "address": "Alamat saya",\n        "city": "Jakarta",\n        "postal_code": "12345",\n        "country": "Indonesia",\n        "full_name": "billing customer fullname"\n    },\n    "additional_data": "Your Free Text",\n    "callback_url": "https://merchant.callback.url",\n    "return_url": "https://merchant.return.url"\n} ';

var config = {
  method: 'post',
maxBodyLength: Infinity,
  url: 'https://api-stage.ifortepay.id/ewallet/v2/create-payment',
  headers: { 
    'Authorization': '{{Authorization}}', 
    'x-req-signature': '{{x-req-signature}}', 
    'Content-Type': 'application/json', 
    'x-version': 'v3'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
php
use GuzzleHttp\Client;

$client = new Client();
$headers = [
  'Authorization' => '{{Authorization}}',
  'x-req-signature' => '{{x-req-signature}}',
  'Content-Type' => 'application/json',
  'x-version' => 'v3'
];
$body = '{    
    "external_id": "merchant-unique-id",
    "order_id": "merchant-order-id",
    "currency": "IDR", 
    "payment_method": "wallet", 
    "payment_channel": "SHOPEEPAY", 
    "payment_details": { 
        "amount": 1000, 
        "expired_time": "2021-04-06T18:40:30.791+07:00", 
        "transaction_description": "Merchant Transaction Description"
    }, 
    "customer_details": {
        "email": "customer@email.com", 
        "full_name": "Your Customer Name", 
        "phone": "081111111111"
    },
    "item_details": [
         {
            "item_id": "item-1",
            "name": "Merchant item name",
            "amount": 200,
            "qty": 5,
            "description": "item-description"
        },
        {
            ....
        }
    ],
    "wallet_details": { 
        "id": "628111111111", 
        "id_type": "HP"
    },
    "billing_address": {
        "phone": "628888888888",
        "address": "Alamat saya",
        "city": "Jakarta",
        "postal_code": "12345",
        "country": "Indonesia",
        "full_name": "billing customer fullname"
    },
    "shipping_address": {
        "phone": "628888888888",
        "address": "Alamat saya",
        "city": "Jakarta",
        "postal_code": "12345",
        "country": "Indonesia",
        "full_name": "billing customer fullname"
    },
    "additional_data": "Your Free Text",
    "callback_url": "https://merchant.callback.url",
    "return_url": "https://merchant.return.url"
} ';
$request = new Request('POST', 'https://api-stage.ifortepay.id/ewallet/v2/create-payment', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Example Response
json
{
  "transaction_id": "123456789",
  "external_id": "merchant-unique-id",
  "order_id": "merchant-order-id",
  "reference_id": "TEST-123456",
  "currency": "IDR",
  "item_details": [
    {
      "item_id": "123456",
      "name": "item",
      "amount": 100,
      "qty": 1,
      "description": "belanja"
    }
  ],
  "payment_details": {
    "amount": 1000,
    "total_amount": 1000,
    "expired_time": "2021-04-06T18:40:30.791+07:00",
    "transaction_description": "Merchant Transaction Description"
  },
  "wallet_response": {
    "redirect_url_http": "https:/shopee.url.redirect/to/shopee",
    "redirect_url_app": "shopee://redirecttoapps..."
  },
  "payment_method": "WALLET",
  "payment_channel": "SHOPEEPAY",
  "transaction_status": "ACTIVE",
  "customer_details": {
    "email": "customer@email.com",
    "full_name": "Your Customer Name",
    "phone": "081111111111"
  },
  "payment_options": {
    "token": "J3qkWB4GnVRJVAIw70Bj1Zcv0aYTlRLifbxj8900"
  },
  "response_code": "00",
  "wallet_details": {
    "id": "628111111111",
    "id_type": "HP"
  },
  "billing_address": {
    "phone": "628888888888",
    "address": "Alamat saya",
    "city": "Jakarta",
    "postal_code": "12345",
    "country": "Indonesia",
    "full_name": "billing customer fullname"
  },
  "shipping_address": {
    "phone": "628888888888",
    "address": "Alamat saya",
    "city": "Jakarta",
    "postal_code": "12345",
    "country": "Indonesia",
    "full_name": "billing customer fullname"
  },
  "additional_data": "shopeepay jumpapp",
  "callback_url": "https://merchant.callback.url",
  "return_url": "https://merchant.return.url"
}

iFortepay API Documentation