Skip to content

Void

Void will cancel your transaction. Void can be made for transactions that have been and have not been settled yet in the same date as the transaction.

Especially for DANA, you can void transactions that have been paid or have not been paid.

##JSON Attributes

NameData TypeRequiredDetails
transaction_idStringYesMCP Transaction ID
external_idString(64)YesUnique string from merchant, used in signature
order_idString(255)YesOnly allow '-' for special characters, not unique, may be duplicated
payment_methodStringYesFixed value: wallet
payment_channelStringYesFixed value: DANA, OVO

##Information

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

##Headers

KeyFormatRequiredValue
Content-Typeapplication/jsonM
AuthorizationStringM
x-req-signatureStringM

##Example

Body raw
json
{
    "transaction_id": "{{mcp_transaction_id}}",
    "external_id": "{{merchant_external_id}}",
    "order_id": "{{order_id}}",
    "payment_channel": "{{channel_name: OVO/DANA}}",
    "payment_method": "WALLET"
}
Example Request
shell
curl --location 'https://api-stage.ifortepay.id/ewallet/v2/void' \
--header 'Authorization: Basic {{Base64encodedKey}}' \
--header 'x-req-signature: {{x-req-signature}}' \
--header 'Content-Type: application/json' \
--data '{
    "transaction_id": "{{mcp_transaction_id}}",
    "external_id": "{{merchant_external_id}}",
    "order_id": "{{order_id}}",
    "payment_channel": "{{channel_name: OVO/DANA}}",
    "payment_method": "wallet"
}'
go
package main

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

func main() {

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

  payload := strings.NewReader(`{
    "transaction_id": "{{mcp_transaction_id}}",
    "external_id": "{{merchant_external_id}}",
    "order_id": "{{order_id}}",
    "payment_channel": "{{channel_name: OVO/DANA}}",
    "payment_method": "wallet"
}`)

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

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

  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 = JSON.stringify({
  "transaction_id": "{{mcp_transaction_id}}",
  "external_id": "{{merchant_external_id}}",
  "order_id": "{{order_id}}",
  "payment_channel": "{{channel_name: OVO/DANA}}",
  "payment_method": "wallet"
});

var config = {
  method: 'post',
maxBodyLength: Infinity,
  url: 'https://api-stage.ifortepay.id/ewallet/v2/void',
  headers: { 
    'Authorization': 'Basic {{Base64encodedKey}}', 
    'x-req-signature': '{{x-req-signature}}', 
    'Content-Type': 'application/json'
  },
  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' => 'Basic {{Base64encodedKey}}',
  'x-req-signature' => '{{x-req-signature}}',
  'Content-Type' => 'application/json'
];
$body = '{
  "transaction_id": "{{mcp_transaction_id}}",
  "external_id": "{{merchant_external_id}}",
  "order_id": "{{order_id}}",
  "payment_channel": "{{channel_name: OVO/DANA}}",
  "payment_method": "wallet"
}';

$request = new Request('POST', 'https://api-stage.ifortepay.id/ewallet/v2/void', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Example Response
json
{
  "transaction_id": "288b2cfe-de92-4008-8c42-88a7385ca984",
  "external_id": "3553318674302",
  "order_id": "86920282764339",
  "payment_method": "WALLET",
  "payment_channel": "DANA",
  "transaction_status": "VOID",
  "request_time": "2021-09-23T14:27:37.993+07:00",
  "response_code": "00"
}

iFortepay API Documentation