# New sales integration

import { Link } from "zudoku/components";
import { Card, CardDescription } from "zudoku/ui/Card";

:::lead
This page is for partners building a sales integration with Entur for the first time. It explains how a sale moves through Sales v2 and which guides to follow.
:::

Before you start, make sure you meet the [access requirements for Sales v2](/docs/partner-services/sales-v2).

## Payment

Payment is optional. Take payment through Entur with the [Payment API](/apis/payment-partner), or use your own PSP.

:::info
If you choose to use your own PSP, you will need to be authorized to import payments into the Entur sales platform. Read more in the [Payment API](/apis/payment-partner) documentation.
:::

## Sales lifecycle

A Sales v2 sale moves through these phases.

1. Search for offers.
2. Prepare a package for purchase. Use `purchase-offers` for a shortcut from offer -> purchasable package, or use `select-offers`, customise the draft, and finish with `purchase-package`.
3. Take payment outside Sales v2, then call `confirm-package`.
4. Retrieve the travel documents for the confirmed package with `travel-documents`.
5. Handle later changes with cancellation, validity updates, or refunds.

Assets and ancillary products are normally assigned while the package is a draft. A mobility operator may also allow some changes after purchase.

```mermaid
flowchart TD
  A[search-offers] --> B{Customise the package?}
  B -- No --> C[purchase-offers]
  B -- Yes --> D[select-offers] --> X[assets or ancillaries] --> E[purchase-package]
  C --> F[Take payment]
  E --> F
  F --> G[confirm-package]
  G --> H[travel-documents]
  H --> I[Changes, cancellation, refunds]
```

## Guides

<div className="grid grid-cols-1 md:grid-cols-2 gap-4 not-prose my-4">
  <Card className="p-6 gap-2 rounded">
    <p className="text-xs uppercase tracking-widest text-muted-foreground font-medium">Step 1</p>
    <Link to="/guides/sales-v2/search-offers" className="text-base font-bold! underline text-foreground!">Search offers</Link>
    <CardDescription>Model who is travelling and get your first offers.</CardDescription>
  </Card>
  <Card className="p-6 gap-2 rounded">
    <p className="text-xs uppercase tracking-widest text-muted-foreground font-medium">Step 2</p>
    <Link to="/guides/sales-v2/make-first-purchase" className="text-base font-bold! underline text-foreground!">Make your first purchase</Link>
    <CardDescription>Prepare, pay for, and confirm a package.</CardDescription>
  </Card>
</div>

## Next steps

<div className="grid grid-cols-1 md:grid-cols-2 gap-4 not-prose my-4">
  <Card className="p-6 gap-2 rounded">
    <p className="text-xs uppercase tracking-widest text-muted-foreground font-medium">API reference</p>
    <Link to="/apis/sales" className="text-base font-bold! underline text-foreground!">Sales v2 API reference</Link>
    <CardDescription>The full list of processes and collections.</CardDescription>
  </Card>
  <Card className="p-6 gap-2 rounded">
    <p className="text-xs uppercase tracking-widest text-muted-foreground font-medium">Documentation</p>
    <Link to="/docs/authentication#partner-apis" className="text-base font-bold! underline text-foreground!">Authentication</Link>
    <CardDescription>Set up OAuth 2.0 client credentials for partner APIs.</CardDescription>
  </Card>
</div>
