Skip to content

Monopay webhook

POST
/v1/billing/webhooks/monopay
curl --request POST \
--url https://beta-api.plune.ai/v1/billing/webhooks/monopay \
--header 'Content-Type: application/json' \
--header 'X-Sign: example' \
--data '{ "invoiceId": "p2_9ZgpZVsl3", "status": "success", "amount": 4200, "ccy": 980, "modifiedDate": "2026-11-13T10:00:00Z" }'

Called by Monopay, not by a person or a CI. No session and no token: X-Sign is the base64 of a DER ECDSA signature over SHA-256 of the raw body, checked with the merchant’s public key (GET /api/merchant/pubkey, cached), checked on the raw bytes of the body before any JSON is read. A verified event is stored once (provider + its own key) and applied to the tier by the worker; a repeat delivery answers 200 and changes nothing. While MONOPAY_TOKEN is unset on the server the route answers 503 provider_not_configured and stores nothing. The body is held to 512 KiB.

X-Sign
required
string

The base64 of a DER ECDSA signature over SHA-256 of the raw body, checked with the merchant’s public key (GET /api/merchant/pubkey, cached)

Media type application/json
object
Example
{
"invoiceId": "p2_9ZgpZVsl3",
"status": "success",
"amount": 4200,
"ccy": 980,
"modifiedDate": "2026-11-13T10:00:00Z"
}

The event is stored (stored), or the same delivery was already (duplicate). Sent only after the write committed.

Media type application/json
object
outcome
required
string
Allowed values: stored duplicate
Example
{
"outcome": "stored"
}

The signature is right but the body is not an event of this provider

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

The signature is missing or does not match; the body is empty

The body is over 512 KiB

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

MONOPAY_TOKEN is not set on this server (code: provider_not_configured), or the key to check with could not be fetched from monobank (code: provider_unreachable) - the provider sends again

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}