# Integration flows

Source: https://parasend.com/docs/flows

The integrations most of Parasend's customers build, step by step. Each box is one step, in the order it happens; the label says who acts, and every endpoint and event links to its page. Start with the first: the others build on it.

## Send and prove, in Parasend’s look

The basic integration: one document to one person, notified from Parasend’s address in Parasend’s look, and the proof back in your system.

1. **Your system: Upload the document.** Each file gets a `fil_` ID and its SHA-256. Uses [POST /v1/files](/docs/api/files/upload).
2. **Your system: Create the delivery.** To one recipient by e-mail, phone or both, with the files, a title and the identification you require. Uses [POST /v1/deliveries](/docs/api/deliveries/create).
3. **Parasend: Parasend notifies the recipient.** By e-mail, SMS or both, from Parasend’s address and in Parasend’s look. Events: [`delivery.notified`](/docs/events/delivery.notified).
4. **Recipient: The recipient opens, identifies and confirms.** With eID, an ID document check, an SMS code or the link alone, as you chose. Events: [`delivery.opened`](/docs/events/delivery.opened), [`delivery.confirmed`](/docs/events/delivery.confirmed).
5. **Webhook to you: Your endpoint hears every step.** Set up once. Signed, retried and replayable; or ask for them with List events. Uses [POST /v1/webhook_endpoints](/docs/api/webhooks/create). Events: [`delivery.notified`](/docs/events/delivery.notified), [`delivery.opened`](/docs/events/delivery.opened), [`delivery.confirmed`](/docs/events/delivery.confirmed), [`delivery.evidence_sealed`](/docs/events/delivery.evidence_sealed).
6. **Your system: Keep the proof.** The Delivery Certificate (PDF) and the sealed evidence record (XML), once `delivery.evidence_sealed` arrives. Uses [GET /v1/deliveries/{id}/evidence/document](/docs/api/evidence/certificate), [GET /v1/deliveries/{id}/evidence/record](/docs/api/evidence/record).
7. **Anyone: Anyone can check the certificate.** At parasend.com/verify, or with the API, without an account. Uses [POST /v1/public/verify](/docs/api/verify/check).

Nobody confirms? Reminders follow by your follow-up policy (`delivery.reminded`), and at the end `delivery.expired`.

## Your own look: brand, e-mail sender and link domain

The same delivery, but the notice comes From your own address, its link is on your own domain, and the notice and the page carry your logo and colours. The setup is done once, in the portal; the API reads it and uses it.

1. **In the portal: Add your e-mail sender.** Under E-mail senders: your From address, such as tilkynningar@fyrirtaeki.example. Publish the DNS records it shows; the API follows it until it is active. Uses [GET /v1/email_senders/{id}](/docs/api/email-senders/retrieve), [POST /v1/email_senders/{id}/check](/docs/api/email-senders/check).
2. **In the portal: Add your link domain.** Under My domains: such as skjol.fyrirtaeki.example, with its DNS record. Recipients’ links then use it. Uses [GET /v1/recipient_domains](/docs/api/link-domains/list).
3. **Your system: Make a brand profile.** Your logo, colours and name, with the API or in the portal. Choose its e-mail sender and link domain in the portal (that needs a fresh sign-in), and make it your default so every delivery uses it. Uses [POST /v1/brand_assets](/docs/api/brand-assets/upload), [POST /v1/brand_profiles](/docs/api/brand-profiles/create).
4. **Your system: Create the delivery.** As in the first flow. `options.brand_profile_id` picks a profile; without it, your default is used. Uses [POST /v1/deliveries](/docs/api/deliveries/create).
5. **Recipient: The recipient gets it from you.** The e-mail From your address, the link on your domain, your look in the notice and on the page. Events: [`delivery.notified`](/docs/events/delivery.notified), [`delivery.opened`](/docs/events/delivery.opened), [`delivery.confirmed`](/docs/events/delivery.confirmed).
6. **Your system: The same proof.** Events, evidence and certificate as in the first flow. Uses [GET /v1/deliveries/{id}/evidence/document](/docs/api/evidence/certificate).

While your sender cannot send, notices go from Parasend’s address under your brand’s name, or wait for it, as you chose (`on_failure`).

## Many at once: batches

For runs of hundreds or thousands: put the deliveries in a batch, check it, and send it out in one go.

1. **Your system: Upload the files.** One per document, or one shared by every delivery. Uses [POST /v1/files](/docs/api/files/upload).
2. **Your system: Create a batch.** Its name, the defaults every delivery takes, and a follow-up policy. Uses [POST /v1/batches](/docs/api/batches/create).
3. **Your system: Add the deliveries.** In as many calls as you need; each delivery is checked as it is added. Uses [POST /v1/batches/{id}/deliveries](/docs/api/batches/add-deliveries).
4. **Your system: Check it before sending.** What would go, what would not and why, before anything is sent. Uses [GET /v1/batches/{id}/preflight](/docs/api/batches/preflight).
5. **Your system: Send it out.** Every delivery goes its own way from here, with its own events. Uses [POST /v1/batches/{id}/finalize](/docs/api/batches/send-out). Events: [`batch.finalized`](/docs/events/batch.finalized).
6. **Webhook to you: Follow the batch.** The report counts where every delivery stands. Uses [GET /v1/batches/{id}/report](/docs/api/batches/report), [GET /v1/batches/{id}/deliveries](/docs/api/batches/deliveries). Events: [`batch.completed`](/docs/events/batch.completed).
7. **Your system: What it cost.** `batch_id` adds up the whole batch. Uses [GET /v1/deliveries/costs](/docs/api/deliveries/costs).

## Debt collection, with the cost passed on

A notice to a debtor, reminders until they confirm, and Parasend’s cost for each delivery, to pass on at cost.

1. **Your system: Set up a follow-up policy.** Reminders by e-mail and SMS after the days you choose, until the recipient confirms. Uses [POST /v1/reminder_policies](/docs/api/follow-up-policies/create).
2. **Your system: Send the notice.** To the debtor, with `recipient.personal_code` and `options.reminder_policy`; `metadata` holds your claim reference. Uses [POST /v1/deliveries](/docs/api/deliveries/create).
3. **Parasend: Parasend reminds.** Automatically, by the policy; Send a reminder sends one now. Uses [POST /v1/deliveries/{id}/remind](/docs/api/deliveries/remind). Events: [`delivery.reminded`](/docs/events/delivery.reminded).
4. **Recipient: The debtor confirms.** Reminders stop. Events: [`delivery.confirmed`](/docs/events/delivery.confirmed).
5. **Your system: Find a debtor’s deliveries.** `pin` finds every delivery to one kennitala. Uses [GET /v1/deliveries](/docs/api/deliveries/list).
6. **Your system: Pass the cost on.** Every billable item with `amount`, `vat` and `total_amount`; `from` and `to` give a month, so each cost is counted once. Uses [GET /v1/deliveries/{id}/cost](/docs/api/deliveries/cost), [GET /v1/deliveries/costs](/docs/api/deliveries/costs).
7. **Your system: Proof for the file.** The Delivery Certificate for the claim. Uses [GET /v1/deliveries/{id}/evidence/document](/docs/api/evidence/certificate).

## Only this person may open it

For documents only one named person may see: the delivery opens only for that person’s own eID or ID document.

1. **Your system: Create the delivery for one person.** `recipient.conditional_authentication: true` with their `personal_code` and `verification_level: high` (eID), or their `id_document_number` with `substantial` (ID document check). Uses [POST /v1/deliveries](/docs/api/deliveries/create).
2. **Recipient: The recipient proves who they are.** Only that person’s eID, or ID document, opens it. Events: [`delivery.opened`](/docs/events/delivery.opened).
3. **Webhook to you: Someone else is turned away.** With the reason `personal_code_mismatch` or `id_document_mismatch`. The delivery stays closed. Events: [`delivery.auth_failed`](/docs/events/delivery.auth_failed).
4. **Recipient: The right person confirms.** The verified identity is recorded. Events: [`delivery.confirmed`](/docs/events/delivery.confirmed).
5. **Your system: Proof of who opened it.** The certificate names the verified identity and its level. Uses [GET /v1/deliveries/{id}/evidence/document](/docs/api/evidence/certificate).

## Next

- [Quickstart](/docs/quickstart): the first flow, in five minutes, with a test key.
- [Receiving webhooks](/docs/webhooks): the events every flow sends, signed.
- [Test and live mode](/docs/test-mode): try every flow in test mode first; nothing is sent and nothing is billed.
