Skip to content

Get Payment Calculation

Information

This feature allows for informed installment option tenure based on the transaction amount.

Path/v1.1/bnpl/payment-calculation
HTTP MethodPOST
Service Code90
Type FormatJSON

Request Body

Details
ParameterData TypeMandatoryLengthDescription
amountObjectM
amount.valueStringM16,2Total amount of the transaction. It should match the total cost of all the <Item>s listed below. If it's IDR, the value includes 2 decimal digits. e.g., IDR 10.000 will be represented as 10000.00
amount.currencyStringM3Currency (Format: ISO 4217), fixed value: IDR
itemDetailsArray of ObjectsM
itemDetails.itemIdStringM64Can be product SKU. For item fees such as shipping fee, admin fee, etc., use one of the following: shippingfee, adminfee, taxfee, discount, additionalfee, insurancefee
itemDetails.nameStringM128Product name
itemDetails.amountArray of ObjectMProduct price
itemDetails.amount.valueStringM16,2If it's IDR, the value includes 2 decimal digits. e.g., IDR 10.000 will be represented as 10000.00
itemDetails.amount.currencyStringM3Currency (Format: ISO 4217), fixed value: IDR
itemDetails.urlStringM256URL of the product on the merchant’s website or platform
itemDetails.imageUrlStringO256URL of the product image on the merchant’s website or platform
itemDetails.categoryEnumM256Product category
itemDetails.qtyStringM8Quantity of the product
itemDetails.parentTypeStringMPossible values: SELLER
itemDetails.parentIdStringMIt corresponds to the SELLER ID if the parentType is SELLER

Example Request

Details
sh
curl --location 'https://api-stage.ifortepay.id/v1.0/bnpl/payment-calculation' \
--header 'Content-Type: application/json' \
--header 'X-TIMESTAMP: 2020-12-18T10:55:00+07:00' \
--header 'X-SIGNATURE: d7DEdWzryB5+eVn2z76ubjuwgkDjr0W8d/rOBPzIm1u/uhTju2sh5UVl3VmNGpzOZ+Y7yxLCmo48eNXxNfjq9ssqmq1t0TWn/wY/E1LvbVVW/J7pT1uXge0vwc+WgSo9Kb3JjpoRVdhvfktRR7fpQOnBaJKnF5VeCmDwYb7Dk4sGvcRXN3dDPN1d8Z/k3JW146B/sapySKkrleStlEsnqmC8kVQZUyOXAs1H4hF9lFc7hzuCH3Gbj5dJILCkK5D+TbjN+w5sUyFbMfUj8l6dTahczwApp7EX/sX7XRZVpfrRp8khbfcNp4jCCrAgkNN7e9ZCX7D/hBHYjcIgVkgTsQ==' \
--header 'X-PARTNER-ID: MC2025059906' \
--header 'X-EXTERNAL-ID: 38472481552676' \
--header 'CHANNEL-ID: PL001' \
--data '{
    "amount": {
        "value": "70000.00",
        "currency": "IDR"
    },
    "itemDetails": [
        {
            "itemId": "BRG001",
            "name": "Sepatu",
            "amount": {
                "value": "10000.00",
                "currency": "IDR"
            },
            "url": "https://www.adidas.co.id/superstar-shoes-996083.html",
            "imageUrl": "https://www.adidas.co.id/superstar-shoes-996083.html",
            "category": "0001",
            "qty": 7,
            "parentType": "SELLER",
            "parentId": "AB001"
        }
    ]
}'
go
package main

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

func main() {

  url := "https://api-stage.ifortepay.id/v1.0/bnpl/payment-calculation"
  method := "POST"

  payload := strings.NewReader(`{
    "amount": {
        "value": "70000.00",
        "currency": "IDR"
    },
    "itemDetails": [
        {
            "itemId": "BRG001",
            "name": "Sepatu",
            "amount": {
                "value": "10000.00",
                "currency": "IDR"
            },
            "url": "https://www.adidas.co.id/superstar-shoes-996083.html",
            "imageUrl": "https://www.adidas.co.id/superstar-shoes-996083.html",
            "category": "0001",
            "qty": 7,
            "parentType": "SELLER",
            "parentId": "AB001"
        }
    ]
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-TIMESTAMP", "2020-12-18T10:55:00+07:00")
  req.Header.Add("X-SIGNATURE", "d7DEdWzryB5+eVn2z76ubjuwgkDjr0W8d/rOBPzIm1u/uhTju2sh5UVl3VmNGpzOZ+Y7yxLCmo48eNXxNfjq9ssqmq1t0TWn/wY/E1LvbVVW/J7pT1uXge0vwc+WgSo9Kb3JjpoRVdhvfktRR7fpQOnBaJKnF5VeCmDwYb7Dk4sGvcRXN3dDPN1d8Z/k3JW146B/sapySKkrleStlEsnqmC8kVQZUyOXAs1H4hF9lFc7hzuCH3Gbj5dJILCkK5D+TbjN+w5sUyFbMfUj8l6dTahczwApp7EX/sX7XRZVpfrRp8khbfcNp4jCCrAgkNN7e9ZCX7D/hBHYjcIgVkgTsQ==")
  req.Header.Add("X-PARTNER-ID", "MC2025059906")
  req.Header.Add("X-EXTERNAL-ID", "38472481552676")
  req.Header.Add("CHANNEL-ID", "PL001")

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

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
js
const axios = require('axios');
let data = JSON.stringify({
  "amount": {
    "value": "70000.00",
    "currency": "IDR"
  },
  "itemDetails": [
    {
      "itemId": "BRG001",
      "name": "Sepatu",
      "amount": {
        "value": "10000.00",
        "currency": "IDR"
      },
      "url": "https://www.adidas.co.id/superstar-shoes-996083.html",
      "imageUrl": "https://www.adidas.co.id/superstar-shoes-996083.html",
      "category": "0001",
      "qty": 7,
      "parentType": "SELLER",
      "parentId": "AB001"
    }
  ]
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api-stage.ifortepay.id/v1.0/bnpl/payment-calculation',
  headers: { 
    'Content-Type': 'application/json', 
    'X-TIMESTAMP': '2020-12-18T10:55:00+07:00', 
    'X-SIGNATURE': 'd7DEdWzryB5+eVn2z76ubjuwgkDjr0W8d/rOBPzIm1u/uhTju2sh5UVl3VmNGpzOZ+Y7yxLCmo48eNXxNfjq9ssqmq1t0TWn/wY/E1LvbVVW/J7pT1uXge0vwc+WgSo9Kb3JjpoRVdhvfktRR7fpQOnBaJKnF5VeCmDwYb7Dk4sGvcRXN3dDPN1d8Z/k3JW146B/sapySKkrleStlEsnqmC8kVQZUyOXAs1H4hF9lFc7hzuCH3Gbj5dJILCkK5D+TbjN+w5sUyFbMfUj8l6dTahczwApp7EX/sX7XRZVpfrRp8khbfcNp4jCCrAgkNN7e9ZCX7D/hBHYjcIgVkgTsQ==', 
    'X-PARTNER-ID': 'MC2025059906', 
    'X-EXTERNAL-ID': '38472481552676', 
    'CHANNEL-ID': 'PL001'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api-stage.ifortepay.id/v1.0/bnpl/payment-calculation',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "amount": {
        "value": "70000.00",
        "currency": "IDR"
    },
    "itemDetails": [
        {
            "itemId": "BRG001",
            "name": "Sepatu",
            "amount": {
                "value": "10000.00",
                "currency": "IDR"
            },
            "url": "https://www.adidas.co.id/superstar-shoes-996083.html",
            "imageUrl": "https://www.adidas.co.id/superstar-shoes-996083.html",
            "category": "0001",
            "qty": 7,
            "parentType": "SELLER",
            "parentId": "AB001"
        }
    ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'X-TIMESTAMP: 2020-12-18T10:55:00+07:00',
    'X-SIGNATURE: d7DEdWzryB5+eVn2z76ubjuwgkDjr0W8d/rOBPzIm1u/uhTju2sh5UVl3VmNGpzOZ+Y7yxLCmo48eNXxNfjq9ssqmq1t0TWn/wY/E1LvbVVW/J7pT1uXge0vwc+WgSo9Kb3JjpoRVdhvfktRR7fpQOnBaJKnF5VeCmDwYb7Dk4sGvcRXN3dDPN1d8Z/k3JW146B/sapySKkrleStlEsnqmC8kVQZUyOXAs1H4hF9lFc7hzuCH3Gbj5dJILCkK5D+TbjN+w5sUyFbMfUj8l6dTahczwApp7EX/sX7XRZVpfrRp8khbfcNp4jCCrAgkNN7e9ZCX7D/hBHYjcIgVkgTsQ==',
    'X-PARTNER-ID: MC2025059906',
    'X-EXTERNAL-ID: 38472481552676',
    'CHANNEL-ID: PL001'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Response

Details
ParameterData TypeMandatoryLengthDescription
responseCodeStringM7Response code
responseMessageStringM150Response description
paymentsArray of Objects
amountObjectMTotal transaction + provision
amount.valueStringMThe value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00
amount.currencyStringMCurrency (Format: ISO4217), fixed value: IDR
installmentAmountObjectMTotal Installment amount
installmentAmount.valueStringM16,2The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00
installmentAmount.currencyStringM3Currency (Format: ISO4217), fixed value: IDR
monthlyInstallmentObjectTotal installment per month
monthlyInstallment.valueStringM16,2The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00
monthlyInstallment.currencyStringM3Currency (Format: ISO4217), fixed value: IDR
tenureIntegerInstallment tenure
tenureTimeUnitStringUnit of tenure
totalInterestObjectTotal interest
totalInterest.valueStringM16,2The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00
totalInterest.currencyStringM3Currency (Format: ISO4217), fixed value: IDR
provisionObjectProvision
provision.valueStringM16,2The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00
provision.currencyStringM3Currency (Format: ISO4217), fixed value: IDR
paymentTypeStringDescription installment tenure
rateIntegerInterest
idStringTenure
totalTransactionAmountObjectMTotal amount of transaction
totalTransactionAmount.valueStringM16,2The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00
totalTransactionAmount.currencyStringM3Currency (Format: ISO4217), fixed value: IDR

Example Response

Details
{
    "responseCode": "2009000",
    "responseMessage": "Successful",
    "payments": [
        {
            "amount": {
                "value": "71000.00",
                "currency": "IDR"
            },
            "installmentAmount": {
                "value": "71000.00",
                "currency": "IDR"
            },
            "monthlyInstallment": {
                "value": "71000.00",
                "currency": "IDR"
            },
            "tenure": 1,
            "tenureTimeUnit": "MONTH",
            "totalInterest": {
                "value": "0.00",
                "currency": "IDR"
            },
            "provision": {
                "value": "1000.00",
                "currency": "IDR"
            },
            "paymentType": "Bayar dalam 30 hari",
            "rate": 0,
            "id": "1_months",
            "totalTransactionAmount": {
                "value": "70000.00",
                "currency": "IDR"
            }
        }
    ]
}

iFortepay API Documentation