EN
See the demo

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.

  • Via API and webhooksYou connect it with the Krokul app in an automation platform, the public API and signed webhooks. The page lists the steps for this service.

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

WayForPayDirectionKrokulWhen
CREATE_INVOICE: orderReference, amount, currency, productName, productPrice, productCount, clientEmail, serviceUrlKrokul → WayForPayDeal invoice and expected paymentA manager creates a payment link
invoiceUrlWayForPay → KrokulLink in the «Payments» blockIn reply to CREATE_INVOICE
orderReferenceWayForPay ↔ KrokulExternal key of the paymentWhen the invoice is created
serviceUrl notice, transactionStatus ApprovedWayForPay → KrokulActual payment, payment.received eventThe client has paid
Signed accept replyKrokul → WayForPayConfirmation that the notice was receivedFor every notice
transactionStatus DeclinedWayForPay → KrokulEntry about the failed attempt in the feedThe payment did not go through
CHECK_STATUSKrokul → WayForPayOpen expected paymentsOnce 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.

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.

Missing something?

Tell us which service you use and what should move between it and Krokul. We reply with the way to do it and when it will be ready.

Request received. We reply to your email.

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

See the demo