Buy Product

This method involves a POST request that initiates a transaction to purchase a product from Klikoo's B2B inventory.

A. Request Header

FieldFormatMandatoryLengthExample
Content-TypestringYapplication/json
Open-Api-Timestampyyyy-mm-dd'T'hh:mm:ss+07:00Y2024-02-07T10:28:35.000+07:0
Open-Api-SignatureDigital SignatureY88vNMoAmiDRV+paVyD5FaidgI5kRy2p
Co8oEoQN/GBpIPuO3eicY63b7xY0W
DffScvkOZsZ1442ewabI7Wzd22pw==

B. Request Body

FieldTypeDescriptionRequiredExample
amountstringThe buy price from the partner to Klikoo.
The amount will deduct the partner’s balance on
Klikoo when the transaction status is success
true"1"
product_codestringUnique identifier for the producttrue"DNOPEN"
selling_pricestringThe selling price of the product from the partner. This value is required to calculate the margin value to be shown on the dashboard. It can be set as same as amount if you wouldn’t like to show the margin on the dashboardtrue"2"
valuestringRepresents the destination number, customer phone number, customer ID, or driver IDtrue"08996647676"
msidnstringIn most cases, the msisdn field should be populated with the value. However, for postpaid BPJS products, this field must specifically contain the customer's phone number. true"08996647676"
partner_reference_idstringThe unique reference identifier provided by the partner or service invoking the transaction, recommended value is UUID v4true“6d654219-d9b7-4e1a-8b51-99a5cafb11cb”

C. Sample Request

{
"amount": "1",
"msidn": "08996647676",
"product_code": "DNOPEN",
"selling_price": "2",
"value": "089966476766",
"partner_reference_id": "d654219-d9b7-4e1a-8b51-99a5cafb11cb" //This is just an example, please use your UUID v4 for this part.
}

D. Response Body

FieldTypeDescriptionExample
response_codestringContains the OpenAPI response code“201022001”
response_messagestringContains the value of OpenAPI response message“Berhasil dibuat”
dataobjectThe object containing transaction info
transaction_idstringThe value of transaction’s id"14429004"
statusstringThe value of transaction’s status. Possible value for Status:
"WAITING"
"SUCCESS"
"FAILED"
"WAITING"
snstringThe value of transaction’s serial number“223731”

E. Sample Response Success

{
    "response_code": "201022001",
    "response_message": "Berhasil dibuat",
    "data": {
        "transaction_id": "14429004",
        "status": "WAITING",
        "sn": "223731"
    }
}

F. Sample Response Failed

{
  "data": null,
  "response_code": "422026558",
  "response_message": "Dompet tidak cukup"
}

Try It Here (Form)

To try the following endpoint, enter the example request data you want to use in the following form


Body Params
string
string
string
string
string
string
Headers
date-time
string
Responses

Language
Credentials
OAuth2
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json