# WayForPay + Krokul CRM

Yes. Krokul CRM integrates with WayForPay through the Krokul API and webhooks. A deal invoice becomes a WayForPay invoice with an invoiceUrl link. Krokul receives the WayForPay notice on serviceUrl itself, checks the signature, records the actual payment and replies with a signed accept.

**Status:** Via API and webhooks.

## What your team gets

### A WayForPay invoice from the deal document

A manager opens an invoice in Krokul and clicks «Payment link». Krokul calls WayForPay with transactionType CREATE_INVOICE and passes the orderReference, amount, currency, the document lines as productName, productPrice and productCount, the contact email and serviceUrl. The invoiceUrl link appears in the «Payments» block of the deal.

### The serviceUrl notice records the payment

After payment, WayForPay sends JSON with transactionStatus, orderReference, amount and merchantSignature to serviceUrl. Krokul checks the HMAC_MD5 signature with the merchant secret key and, for the Approved status, turns the expected payment into an actual one. The `payment.received` event follows, and full coverage of the invoice triggers `invoice.paid`.

### The accept reply stops the repeats

For every notice, Krokul returns JSON to WayForPay with orderReference, status accept, time and a signature. If WayForPay still sends a notice twice, Krokul finds the orderReference among recorded payments and creates no second one.

### A refusal is visible to the manager

A notice with the Declined status keeps the plan open, and an entry about the failed attempt appears in the deal feed. The manager knows that the client tried to pay and can send the link again.

### Reconciliation with CHECK_STATUS

Once a day, Krokul goes through open expected payments with an orderReference and requests CHECK_STATUS. If a payment went through and the notice did not arrive, Krokul records the payment from its actual state.

## What moves between WayForPay and Krokul

| WayForPay | Krokul | Direction | When |
|---|---|---|---|
| CREATE_INVOICE: orderReference, amount, currency, productName, productPrice, productCount, clientEmail, serviceUrl | Deal invoice and expected payment | Krokul → WayForPay | A manager creates a payment link |
| invoiceUrl | Link in the «Payments» block | WayForPay → Krokul | In reply to CREATE_INVOICE |
| orderReference | External key of the payment | WayForPay ↔ Krokul | When the invoice is created |
| serviceUrl notice, transactionStatus Approved | Actual payment, `payment.received` event | WayForPay → Krokul | The client has paid |
| Signed accept reply | Confirmation that the notice was received | Krokul → WayForPay | For every notice |
| transactionStatus Declined | Entry about the failed attempt in the feed | WayForPay → Krokul | The payment did not go through |
| CHECK_STATUS | Open expected payments | Krokul → WayForPay | Once a day |

## How to connect today

### Your own flow through the Krokul API and webhooks

1. In the WayForPay account, take the merchantAccount, merchantDomainName and the merchant secret key.
2. In Krokul, create an API key with scopes for deals, documents and payments, and subscribe a webhook to `document.created`. Each delivery has the `x-crm-signature` header, and your handler checks it against your secret.
3. On the event, send WayForPay a CREATE_INVOICE request with the document lines and your own serviceUrl, and attach the orderReference to the document through `externalRef/api-upsert`.
4. When transactionStatus Approved arrives on serviceUrl, check merchantSignature, return a signed accept and record the payment through `payment/api-create` with the deal `cardUuid`.

### For integrators

A WayForPay invoice can also be created through the Krokul public API. Call `payment/api-link` with a deal and an amount or with a payment plan, and put `wayforpay` in the `provider` field when several providers accept the currency. The orderReference is stored as an `externalRef` external key. Your system receives the `payment.received` event as a signed Krokul webhook with a delivery log and redelivery.

[API documentation](https://app.krokul.com/api/v1/docs)

## Questions and answers

### Do I need a separate server for the WayForPay serviceUrl?

No. serviceUrl points straight to Krokul, which checks the notice signature itself and returns a signed accept reply to WayForPay.

### Does WayForPay email the invoice to the client?

Yes, if the client email is passed in CREATE_INVOICE. Krokul takes it from the deal contact, and without an email the invoiceUrl link still appears on the deal.

### What happens if a WayForPay notice does not reach Krokul?

WayForPay repeats it until it gets accept. Krokul also reconciles open payments with a CHECK_STATUS request once a day.

### How does Krokul show the invoice lines in WayForPay?

Krokul passes each document line as productName, productPrice and productCount, so the client sees on the payment page what the payment is for.

## Limits

WayForPay repeats the serviceUrl notice until it gets a valid reply, for up to four days. WayForPay emails the invoice to the client only when the invoice contains the client email.

## Related services

- [LiqPay](https://krokul.com/en/integrations/liqpay/index.md)
- [monobank](https://krokul.com/en/integrations/monobank/index.md)
- [NovaPay](https://krokul.com/en/integrations/novapay/index.md)
- [PrivatBank](https://krokul.com/en/integrations/privatbank/index.md)
- [Checkbox](https://krokul.com/en/integrations/checkbox/index.md)

[Payments and banks (Ukraine)](https://krokul.com/en/integrations/category/payments-ua/index.md)

WayForPay is a trademark of its owner. Krokul is not affiliated with WayForPay.

Updated: 2026-10-15

---

App: https://app.krokul.com/ · API: https://app.krokul.com/api/v1/docs
