Webhook and error codes

Webhook

After every completed payment, Finik sends a POST request to the callback endpoint you specified with the payment’s JSON body. The payment status arrives in the status field: SUCCEEDED or FAILED.

Verifying authenticity

Every request is signed with Finik’s private key, and the signature is sent in the signature header. You must verify the signature with Finik’s public key using the same algorithm as when signing requests (see Authentication).

Prod — public-key.pem
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuF/PUmhMPPidcMxhZBPb
BSGJoSphmCI+h6ru8fG8guAlcPMVlhs+ThTjw2LHABvciwtpj51ebJ4EqhlySPyT
hqSfXI6Jp5dPGJNDguxfocohaz98wvT+WAF86DEglZ8dEsfoumojFUy5sTOBdHEu
g94B4BbrJvjmBa1YIx9Azse4HFlWhzZoYPgyQpArhokeHOHIN2QFzJqeriANO+wV
aUMta2AhRVZHbfyJ36XPhGO6A5FYQWgjzkI65cxZs5LaNFmRx6pjnhjIeVKKgF99
4OoYCzhuR9QmWkPl7tL4Kd68qa/xHLz0Psnuhm0CStWOYUu3J7ZpzRK8GoEXRcr8
tQIDAQAB
-----END PUBLIC KEY-----
Beta — public-key.pem
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwlrlKz/8gLWd1ARWGA/8
o3a3Qy8G+hPifyqiPosiTY6nCHovANMIJXk6DH4qAqqZeLu8pLGxudkPbv8dSyG7
F9PZEAryMPzjoB/9P/F6g0W46K/FHDtwTM3YIVvstbEbL19m8yddv/xCT9JPPJTb
LsSTVZq5zCqvKzpupwlGS3Q3oPyLAYe+ZUn4Bx2J1WQrBu3b08fNaR3E8pAkCK27
JqFnP0eFfa817VCtyVKcFHb5ij/D0eUP519Qr/pgn+gsoG63W4pPHN/pKwQUUiAy
uLSHqL5S2yu1dffyMcMVi9E/Q2HCTcez5OvOllgOtkNYHSv9pnrMRuws3u87+hNT
ZwIDAQAB
-----END PUBLIC KEY-----

Example webhook request

Finik sends a POST to your callback URL. The signature is sent in the signature header — verify it with Finik’s public key.

POST to your callback URL
POST /your/callback/path HTTP/1.1
Host: merchant.example.com
Content-Type: application/json
signature: <Finik signature>

{
  "id": "transaction-id-15423_CREDIT",
  "accountId": "your account id",
  "amount": 100,
  "fields": {
    "amount": 100,
    "fieldId1": "value1",
    "fieldId2": "value2"
  },
  "item": { "id": "generated-item-id" },
  "net": 100,
  "receiptNumber": "some-number",
  "requestDate": 1737369012345,
  "service": { "id": "averspay-items" },
  "status": "SUCCEEDED",
  "transactionDate": 1737369012345,
  "transactionId": "transaction-id-241234",
  "transactionType": "DEBIT",
  "data": {
    "amount": 100,
    "fieldId1": "value1"
  }
}

The data field is present only for WEB integrations and contains the data you passed.

Error codes

statusCodeMeaningExample errorMessageRetriable
200SuccessPayment status SUCCEEDED, FAILED or PROCESSINGYes
201Accepted for asynchronous processingNo
400Bad requestTransaction ID is required. · A valid service is required. · Fields must be an object and include all required fields. · An invalid amount is provided. Amount must be greater than 0. · User is disabled. · Source and destination accounts must be different.No — fix the request
401Authorization errorAn invalid or missing Authorization header is provided. · An invalid client ID is provided.No — check the signature, key and timestamp
402Insufficient fundsInsufficient funds.After topping up the account
403No permissionUser has no permissions to access this account. · Client has no permissions to access this payment.No
404Resource not foundUser does not exist.No
409Duplicate transactionTransaction with the same ID already exists.No — use a new transactionId or request the status of the existing payment
500Internal server errorAn unexpected error has occurred.Yes
502Service provider unavailableService "XXX" is temporarily unavailable.Yes, later
503Server overloaded or under maintenanceYes, later