Appearance
Get Payment Calculation
Information
This feature allows for informed installment option tenure based on the transaction amount.
Path | /v1.1/bnpl/payment-calculation |
---|---|
HTTP Method | POST |
Service Code | 90 |
Type Format | JSON |
Request Body
Details
Parameter | Data Type | Mandatory | Length | Description |
---|---|---|---|---|
amount | Object | M | ||
amount.value | String | M | 16,2 | Total 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.currency | String | M | 3 | Currency (Format: ISO 4217), fixed value: IDR |
itemDetails | Array of Objects | M | ||
itemDetails.itemId | String | M | 64 | Can 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.name | String | M | 128 | Product name |
itemDetails.amount | Array of Object | M | Product price | |
itemDetails.amount.value | String | M | 16,2 | If it's IDR, the value includes 2 decimal digits. e.g., IDR 10.000 will be represented as 10000.00 |
itemDetails.amount.currency | String | M | 3 | Currency (Format: ISO 4217), fixed value: IDR |
itemDetails.url | String | M | 256 | URL of the product on the merchant’s website or platform |
itemDetails.imageUrl | String | O | 256 | URL of the product image on the merchant’s website or platform |
itemDetails.category | Enum | M | 256 | Product category |
itemDetails.qty | String | M | 8 | Quantity of the product |
itemDetails.parentType | String | M | Possible values: SELLER | |
itemDetails.parentId | String | M | It 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
Parameter | Data Type | Mandatory | Length | Description |
---|---|---|---|---|
responseCode | String | M | 7 | Response code |
responseMessage | String | M | 150 | Response description |
payments | Array of Objects | |||
amount | Object | M | Total transaction + provision | |
amount.value | String | M | The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00 | |
amount.currency | String | M | Currency (Format: ISO4217), fixed value: IDR | |
installmentAmount | Object | M | Total Installment amount | |
installmentAmount.value | String | M | 16,2 | The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00 |
installmentAmount.currency | String | M | 3 | Currency (Format: ISO4217), fixed value: IDR |
monthlyInstallment | Object | Total installment per month | ||
monthlyInstallment.value | String | M | 16,2 | The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00 |
monthlyInstallment.currency | String | M | 3 | Currency (Format: ISO4217), fixed value: IDR |
tenure | Integer | Installment tenure | ||
tenureTimeUnit | String | Unit of tenure | ||
totalInterest | Object | Total interest | ||
totalInterest.value | String | M | 16,2 | The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00 |
totalInterest.currency | String | M | 3 | Currency (Format: ISO4217), fixed value: IDR |
provision | Object | Provision | ||
provision.value | String | M | 16,2 | The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00 |
provision.currency | String | M | 3 | Currency (Format: ISO4217), fixed value: IDR |
paymentType | String | Description installment tenure | ||
rate | Integer | Interest | ||
id | String | Tenure | ||
totalTransactionAmount | Object | M | Total amount of transaction | |
totalTransactionAmount.value | String | M | 16,2 | The value includes 2 decimal digits. e.g. IDR 10.000,- → 10000.00 |
totalTransactionAmount.currency | String | M | 3 | Currency (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"
}
}
]
}