Authentication and request signing
Every PAYJN API request is signed with your RSA private key, and every notification from PAYJN is signed with PAYJN's private key. You verify notifications with PAYJN's public key.
| Item | Value |
|---|---|
| Algorithm | SHA256withRSA, then Base64 |
| Key format | PKCS8 |
| Key length | 2048 bits |
| Header | sign |
Keys
- Generate an RSA key pair on your own server.
- Upload your public key in the merchant dashboard and download PAYJN's public key.
- Keep your private key on your server. PAYJN never asks for it.
- Register the IP addresses of the servers that call the API.
Signing a request
- Serialise the request body to a JSON string. This exact string is the HTTP body you send.
- Join the JSON string and the endpoint path with
&. - Sign the result with your private key using SHA256withRSA and Base64-encode the signature.
- Send the signature in the
signheader.
Example plaintext for /api-pay/payout/order/create:
{
"merchantCode": "100001",
"amount": 30000,
"countryCode": "IDN",
"merchantOrderId": "PAYOUT20261129001",
"bankCode": "DANA",
"bankAccountNo": "081234567890",
"merchantNotifyUrl": "https://merchant.example.com/payjn/payout-notify",
"customer": {
"name": "Recipient Name",
"email": "recipient@example.com",
"phone": "081234567890"
}
}&/api-pay/payout/order/create
curl -X POST 'https://{your-api-host}/api-pay/payout/order/create' \
-H 'Content-Type: application/json' \
-H 'sign: <base64 signature>' \
--data '<the same JSON string you signed>'
Verifying a notification
Verify the sign header of each notification against the raw request body with PAYJN's public key before you act on it. Reject notifications that fail verification.
Get API access
Full integration documentation, your API host, merchant code and keys are provided after onboarding. Review is usually completed on the same day, and a test mode is switched on for your account before launch.