Skip to Content
Payrudder

Contracts: agreements and their evidence

Preview

Put agreements in front of your customers, require them before payment, record acceptances as evidence, and handle withdrawals.

You can put agreements in front of your own customers: a distance sales contract, a pre-information form, terms of service and a privacy notice. Payrudder keeps the texts, shows them where the customer pays, records that a specific text was accepted, and mails the customer a copy.

Payrudder supplies templates and evidence, not legal guarantees. Nothing here says that a text is sufficient in any country, and the starter texts must be reviewed by a lawyer before use. See What was checked, and what was not.

The model

A business customer (customer_type = business) gets the business series when you published one, else the consumer text. A customer of unknown type is treated as a consumer: the consumer's text gives rights a business does not have, never the other way round.

Where it applies

PUT /v1/contracts/settings sets required_kinds. While it is not empty:

PathWhat happens
POST /v1/subscriptionsrefused with plans.contract.not_accepted until the customer has accepted the current version of each required kind. Record it with POST /v1/customers/{external_id}/contract-acceptances; GET /v1/customers/{external_id}/contract-requirements returns the texts to show
Hosted invoice page, payment link and portal invoice (POST /i/{token}/pay, POST /c/{token}/invoices/{invoice_id}/pay)the page shows each text the customer has not accepted with an unticked box and a button that says it is an order with an obligation to pay. The server checks the boxes (the page needs no script) and starts nothing without them, or for a text replaced since the page was shown
Credit pack purchase, ad-hoc payment linkthey end on the same invoice page, so they are covered there; the link's "continue" step takes no money
A payment link that names its own agreements (required_contracts on POST /v1/payment-links)see below
Renewals, dunning chargesnever held back: nobody is present to accept

A guest payment (a payment link with no customer) is covered by the invoice it was accepted for.

The hosted pages fail closed: if your agreements cannot be read, or a kind you require has no published version, the page offers no way to pay and a pay request is refused.

List acceptances

GET /v1/customers/{external_id}/contract-acceptances is paged (page_size, default 100, at most 200; next_page_token), newest first. Narrow it by kind, source (api or hosted), version_id and the time of acceptance (from inclusive, to exclusive, RFC 3339).

After the acceptance

The customer is mailed the page they accepted, in their language. It is a system mail that your mail switch does not hold back; a guest has no address and gets none. The mail is sent only when the page fetched has the hash the acceptance holds.

Your webhook endpoints get contract.accepted (one event for the group), contract.version_published and contract.withdrawal_requested. See Webhooks.

Withdrawals

A withdrawal request records a customer's statement: when it reached you, who decided, the outcome. You decide it; Payrudder never refunds from the statement. contract.withdrawal_decided is sent for every decision.

Record the statement

The customer uses the hosted withdrawal function, or your server calls POST /v1/customers/{external_id}/contract-withdrawals and names the invoice with invoice_id.

Decide it

PUT /v1/contract-withdrawals/{id}/status accepts or rejects it, or marks an accepted one refunded. When accepting, refund_amount_minor can ask for less than what is left of the invoice.

Follow the refund

When you accept a withdrawal that names an invoice and the setting withdrawal_refund is full (the default), billing is asked for a credit note that returns the invoice to the card. none leaves the refund to you. POST /v1/contract-withdrawals/{id}/refund asks later, or again after a failure (amount_minor for less than what is left).

The withdrawal's refund_state says what became of the refund:

refund_stateMeaning
requestedasked for; credit_note_id names the credit note
refundedthe provider confirmed the refund. Final
refund_failedthe provider refused it. refund_note says why
outsidethe payment cannot go back through Payrudder (a bank transfer): refund it by hand
failedbilling refused or did not answer: ask again

refunded and refund_failed are copied from the credit note's own credit_note.refunded / credit_note.refund_failed events. A repeated or reordered event changes nothing, and the withdrawal's status stays yours to set.

A refund_failed withdrawal is not asked for again: its credit note exists, so the card refund is retried on the credit note, never by a second credit note. The refund is asked for once per withdrawal.

Key permissions

ActionPermission
Record a withdrawal, decide itcustomers:write, so a checkout's server can do both
POST /v1/contract-withdrawals/{id}/refundinvoices:write: the refund is a credit note that returns money to a card
Accept a withdrawal while withdrawal_refund is fullinvoices:write too. A key with customers:write only gets 403 gateway.auth.permission_denied and nothing is decided

The portal, the withdrawal function and the renewal notice

Keeping the evidence

retention_months (12 to 120, default 36) is how long the IP address and user agent of an acceptance are kept. A daily job blanks them afterwards and changes nothing else; it is the only thing that ever changes an acceptance. The rest of the record, including the snapshot, stays.

  • A sandbox reset deletes the sandbox's acceptances (they name its customers). Live evidence is never deleted.
  • Promoting a sandbox to live copies the agreement texts as live's own first versions, and never an acceptance.

What was checked, and what was not

The Turkish Mesafeli Sözleşmeler Yönetmeliği (consolidated text of mevzuat.gov.tr) and the EU Consumer Rights Directive 2011/83/EU with Directive (EU) 2023/2673 (Publications Office) were read, with article numbers and dates, for the structure of the pages and the starter texts.

Not checked: that any text is legally sufficient anywhere, whether Payrudder is an intermediary service provider under the Turkish rules, national transpositions of the EU texts, how long an IP address may be kept under KVKK or the GDPR, auto-renewal rules, and the wording of the box sentences in German, French, Spanish and Arabic.

Next steps