Skip to main content

Integeration Guide

Overview

This service provides a payment page to the merchant’s system after a checkout transaction. The merchant requests a payment link from Cash In, and the payment page is displayed to the merchant’s customer. After the customer completes the payment, Cash In will notify the merchant that the payment has been successfully processed. A detailed explanation of the process flow is provided in the Sequence Diagram:

process-flow-sequence-diagram
Process Flow Sequence Diagram

Backend Integration Process

To utilize the checkout page, the merchant must implement the following APIs:

  • API Request URL Checkout Page
  • API Check Status Payment
  • API Notify for Acknowledge Payment

API Request URL Checkout Page

  • The parameters provided by Cash In for This integration are:

    • clientId
    • secretKey
  • URL

    Sandbox
    https://sandbox-api.cashin.co.id/pg/fo/payment
    Production
    https://api.cashin.co.id/pg/fo/payment
    Relative path url for signature
    /payment
  • Method: POST

  • Content Type: application/json

  • Request Header:

    NoNameTypeLengthRequiredDescriptionExample
    1X-CLIENT-IDString36MandatoryIdentifier id client generated by Cash InCID12345678910
    2X-REQUEST-IDString36MandatoryUnique Identifier request must be unique each request3fa85f64-5717-4562-b3fc-2c963f66afa6
    3X-TIMESTAMPString25MandatoryTransaction date format in YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)2024-11-04T10:00:00+07:00
    4X-SIGNATUREStringVariableMandatorySignature generated using Symmetric Method
  • Request Body:

    NoNameTypeLengthRequiredDescriptionExample
    1amountNumberMandatoryIdentifier id clientCID12345678910
    2trxNoString64MandatoryUnique Identifier request must be unique each request3fa85f64-5717-4562-b3fc-2c963f66afa6
    3durationNumberMandatoryDuration expired for checkout page in minutes
    4successCallbackUrlString255MandatoryPage redirect of success payment in checkout page
    5cancelCallbackUrlString255MandatoryPage redirect of cancel or back in checkout page
    6paymentChannelString50String

    for directly select payment channel, if value not blank or null then result url checkout page direct to specific payment channel. value available :

    • QRIS
    • BANK_TRANSFER
    QRIS
    7customerJSON ObjectMandatory
    8customer.idString50MandatoryCustomer id of merchant system
    9customer.phoneNumberString16MandatoryCustomer phone of merchant system
  • Response:

    NoNameTypeLengthRequiredDescriptionExample
    1messageString20MandatoryMessage response
    2dataJSON ObjectMandatory
    3data.paymentTokenString150MandatoryToken for Checkout page access
    4data.paymentUrlString255MandatoryURL for open Checkout Page
    Example Request - API Request URL Checkout Page
    curl --location --request POST 'https://sandbox-api.cashin.co.id/pg/fo/payment' \
    --header 'X-CLIENT-ID: CID1234567890' \
    --header 'X-REQUEST-ID: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \
    --header 'X-TIMESTAMP: 2024-11-04T10:00:00+07:00' \
    --header 'X-SIGNATURE: 1iND8TUKOnGvH4TIFsQB5cCvtYyQKvJrmdpqjgQaLLLiHXdmWsVX8SAnmdq7dWWeKtfl1SKovegk9nwCmjXFHg==' \
    --header 'Content-Type: application/json' \
    --data-raw '{
    "amount": 1000,
    "trxNo": "TRX-MERCHANT-0001",
    "duration": 30,
    "successCallbackUrl": "https://tes-url-merchant.com/success",
    "cancelCallbackUrl": "https://tes-url-merchant.com/cancel",
    “paymentChannel” : “QRIS”,
    "customer": {
    "id": "CUSTOMER-1",
    "phoneNumber": "082232232231111"
    }
    }'
    Example Response - API Request URL Checkout Page
    {
    "paymentToken": "Y2ExMTRjNjAtMzBjNy00MDA5LThiYjctOWI2NTI2Yzg0OGI3XzAxOTJmNTljLWM1MTMtNzQ0Mi04MmRmLTM5ZTYzMzQ1NGE4OV8yMDI0LTExLTExVDAzOjU5OjQ2LjQ5MzY2NjQ5OVo=",
    "paymentUrl": https://dev-checkout.cashin.co.id/payment/Y2ExMTRjNjAtMzBjNy00MDA5LThiYjctOWI2NTI2Yzg0OGI3XzAxOTJmNTljLWM1MTMtNzQ0Mi04MmRmLTM5ZTYzMzQ1NGE4OV8yMDI0LTExLTExVDAzOjU5OjQ2LjQ5MzY2NjQ5OVo="
    }

API Status Payment (Checkout Page)

  • The parameters provided by Cash In for This integration are:

    • clientId
    • publicKey
  • URL :

    Sandbox
    https://sandbox-api.cashin.co.id/pg/fo/payment/status
    Production
    https://api.cashin.co.id/pg/fo/payment/status
    Relative path url for signature
    /payment/status
  • Method: POST

  • Content Type: application/json

  • Request Header:

    NoNameTypeLengthRequiredDescriptionExample
    1X-CLIENT-IDString36MandatoryIdentifier id client generated by Cash InCID12345678910
    2X-REQUEST-IDString36MandatoryUnique Identifier request must be unique each request3fa85f64-5717-4562-b3fc-2c963f66afa6
    3X-TIMESTAMP25MandatoryTransaction date format in YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
    4X-SIGNATUREStringMandatorySignature generated using Symmetric Method
  • Request Body:

    NoNameTypeLengthRequiredDescriptionExample
    1trxNo String20MandatoryTransaction number of merchantTRX001
  • Response:

    NoNameTypeLengthRequiredDescriptionExample
    1messageString20MandatoryMessage responseSucessfull
    2dataJSON ObjectMandatory
    3data.trxNoJSON Object150MandatoryTransaction Number identifier of MerchantTRX001
    4data.statusJSON Object30Mandatory
    Status payment :
    1. SUCCESS (Success)
    2. OPEN (Ready to be paid)
    3. FAILED (Failed)
    SUCCESS
    5data.paymentMethodString30MandatoryPayment methodQRIS
    6data.referenceNoString40MandatoryTransaction Number identifier of Cash InPAY123
    7data.amountNumberMandatoryAmount transaction4000.00
    Example Request - Status Payment
    curl --location --request POST 'https://sandbox-api.cashin.co.id/pg/fo/payment/status' \
    --header 'X-CLIENT-ID: CID173701069947375062' \
    --header 'X-REQUEST-ID: 123' \
    --header 'X-TIMESTAMP: 2025-04-11T10:42:53.352+07:00' \
    --header 'X-SIGNATURE: 2LxrHCEHWj/j7rE2ZNMEs7sq7Nsd0KPkH8J6ZucPTlM=' \
    --header 'Content-Type: application/json' \
    --data-raw '{
    "trxNo": " TRX001"
    }'
    Example Response - Status Payment
    {
    "message": "Successful",
    "data": {
    "trxNo": "TRX001",
    "status": "SUCCESS",
    "paymentMethod": "QRIS ",
    "referenceNo": "PAY123",
    "amount": 4000.00
    }
    }

API Acknowledge Payment (Notify Callback)

QRIS & Direct Debit (Snap Api Version)

  • The parameters provided by Cash In for This integration are:

    • clientId
    • publicKey
  • URL :

    https://{your_domain}/v1.0/debit/notify
    Relative path url for signature
    https://{your_domain}/v1.0/debit/notify
  • Method: POST

  • Content Type: application/json

  • Request Header:

    NoNameTypeLengthRequiredDescriptionExample
    1X-PARTNER-IDString36MandatoryIdentifier id client generated by Cash InCID12345678910
    2X-EXTERNAL-IDString36MandatoryUnique Identifier request must be unique each request3fa85f64-5717-4562-b3fc-2c963f66afa6
    3X-TIMESTAMP25MandatoryTransaction date format in YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
    4X-SIGNATUREStringMandatorySignature generated using Asymmetric Method
    5CHANNEL -IDStringMandatory
  • Request Body:

    NoNameTypeLengthRequiredDescriptionExample
    1originalPartnerReferenceNoString64MandatoryTransaction identifier on Cash In SystemCID12345678910
    2originalReferenceNoString64MandatoryTransaction identifier on partner (merchant) system3fa85f64-5717-4562-b3fc-2c963f66afa6
    3originalExternalIdNumber36OptionalUnique Identifier request must be unique each request
    4latestTransactionStatusString2MandatoryCategory code for the status of the payment. The values include:
    • 00 = Success, the payment has been paid
    • 05 = Cancelled, the payment has been closed because it is expired
    5transactionStatusDescString50Mandatorydescription of transaction status
    6amountJSON ObjectMandatory
    7amount.valueStringMandatoryAmount Value
    8amount.currencyString25MandatoryAmount Currency
    9createdTimeString25MandatoryTransaction created time format in YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
    10finishedTimeString25MandatoryTransaction finished time format in YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
  • Response:

    NoNameTypeLengthRequiredDescriptionExample
    1responseCodeString7MandatoryResponse Code
    2responseMessageString150MandatoryResponse Message
    Example Request - API Notify for Acknowledge Payment
    curl --location --request POST 'https://{your_domain}/v1.0/debit/notify \
    --header 'X-PARTNER-ID: CID17304190397339244f' \
    --header 'X-EXTERNAL-ID: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \
    --header 'X-TIMESTAMP: 2024-11-04T10:00:00+07:00' \
    --header 'X-SIGNATURE: 1iND8TUKOnGvH4TIFsQB5cCvtYyQKvJrmdpqjgQaLLLiHXdmWsVX8SAnmdq7dWWeKtfl1SKovegk9nwCmjXFHg==' \
    --header 'CHANNEL-ID: 9552'\
    --header 'Content-Type: application/json' \
    --data-raw '{
    "originalPartnerReferenceNo": "PAY12345678910",
    "originalReferenceNo": "TRX-MERCHANT-0001",
    “orgiginalExternalId” : “123232144”,
    "latestTransactionStatus": “00”,
    “latestTransactionStatusDec”: “Success”,
    "amount": {
    “value”: 1000,
    “currency”: “IDR”
    },
    "createdTime": "2024-11-04T10:00:00+07:00”,
    "finishedTime": "2024-11-04T10:00:00+07:00"
    }'
    Example Response - API Notify for Acknowledge Payment
    {
    "responseCode": “2005600”,
    "responseMessage": "Successful”
    }