Skip to content

LiqPay callback

POST
/v1/billing/webhooks/liqpay
curl --request POST \
--url https://beta-api.plune.ai/v1/billing/webhooks/liqpay \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data data=eyJ2ZXJzaW9uIjo3LCJvcmRlcl9pZCI6IjAwMDAwMDAwLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMCIsInN0YXR1cyI6InN1Y2Nlc3MifQ== \
--data signature=Zm9yZ2VkLWV4YW1wbGUtc2lnbmF0dXJlLW5vdC12YWxpZA==

Called by LiqPay, not by a person or a CI (https://www.liqpay.ua/uk/doc/api/callback). No session and no token: the form’s signature is base64(sha3-256(private_key + data + private_key)) over its data (base64 of the JSON), checked before data is read; a sha1 signature of the same string passes too, as the docs’ code samples sign. A verified callback is stored once (its order, LiqPay’s payment, its status and time) and applied to the tier by the worker; a repeat delivery answers 200 and changes nothing. While LIQPAY_PUBLIC_KEY or LIQPAY_PRIVATE_KEY is unset on the server the route answers 503 provider_not_configured and stores nothing. The body is held to 512 KiB.

Media type application/x-www-form-urlencoded
object
data
required
string
signature
required
string
Example
data=eyJ2ZXJzaW9uIjo3LCJvcmRlcl9pZCI6IjAwMDAwMDAwLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMCIsInN0YXR1cyI6InN1Y2Nlc3MifQ%3D%3D&signature=Zm9yZ2VkLWV4YW1wbGUtc2lnbmF0dXJlLW5vdC12YWxpZA%3D%3D

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 data is not a payment of this shop

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"
}

LIQPAY_PUBLIC_KEY or LIQPAY_PRIVATE_KEY is not set on this server (code: provider_not_configured)

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