Payjn(IDN) - Interface doc
    Payjn(IDN) - Interface doc
    • Integration Guide
    • Signature Rules
    • Attachment Code Table
    • Collection
      • Initiate Collection (API)
        POST
      • Initiate Collection (H5 Cashier)
        POST
      • Query Collection Order
        POST
      • Query Available Payment Methods
        POST
    • Payout
      • Initiate Payout
        POST
      • Query Payout Order
        POST
    • Account
      • Query account balance
        POST
    • Callback Notification
      • Collection callback notification
      • Payout callback notification

    Signature Rules

    Signature Algorithm Description#

    Encryption MethodSHA256WithRSA
    Key FormatPKCS8
    Signature AlgorithmSHA256WithRSA, then base64 encoding
    Key Length2048

    Key Generation Instructions#

    1.
    The merchant needs to generate a pair of private and public keys, then exchange public keys with Payjn. Please keep your private key safe to prevent leakage.
    2.
    Payjn does not accept merchant private keys. Do not send your private key to Payjn.
    3.
    Use Payjn's public key to verify signatures for asynchronous notifications.
    Online key generation tool provided by this platform: https://apitest.payjn.com/rsa-key-generator

    Signature Steps#

    1.
    Convert the request payload into a JSON string.
    2.
    Concatenate the JSON string with the API endpoint (using &).
    3.
    Use the merchant's RSA private key to sign with SHA256WithRSA.
    4.
    Place the resulting signature in the HTTP header with the key sign.
    Note: The JSON string is the HTTP request body. Payjn will verify the signature using the original content.

    Example: Creating a Payout Order Signature#

    API endpoint: ${host}/api-pay/payout/order/create
    Assume the parameters sent are as follows:
    {
       "merchantCode": "258251",
       "amount": 30000.00,
       "countryCode": "IDN",
       "merchantOrderId": "P20250203850899",
       "bankCode": "DANA",
       "bankAccountNo": "081234567890",
       "merchantNotifyUrl": "http://merchant-api.com/callback",
       "customer": {
          "name": "Clinton Alisa",
          "email": "clintonAlisa@gmail.com",
          "phone": "08126788314"
       }
    }
    Signature plaintext:
    {
      "merchantCode": "258251",
      "amount": 30000.00,
      "countryCode": "IDN",
      "merchantOrderId": "P20250203850899",
      "bankCode": "DANA",
      "bankAccountNo": "081234567890",
      "merchantNotifyUrl": "http://merchant-api.com/callback",
      "customer": {
        "name": "Clinton Alisa",
        "email": "clintonAlisa@gmail.com",
        "phone": "08126788314"
      }
    }&/api-pay/payout/order/create
    Request with signature:

    Demo#

    Java#

    Python#

    Golang#

    Notes#

    1.
    The signature must use the merchant's private key, and verification must use Payjn's public key.
    2.
    The signature value must be base64 encoded.
    3.
    The signature must be placed in the HTTP header with the key sign.
    4.
    The signature plaintext must be concatenated strictly according to the rules.
    5.
    Please keep your private key safe and do not disclose it to any third party.
    Modified at 2025-06-29 16:02:24
    Previous
    Integration Guide
    Next
    Attachment Code Table