---
title: "Online store checkout: donations with the Charitips API"
description: "An online store offers to round the order total up to the next euro at checkout."
canonical: https://www.charitips.com/docs/use-cases/round-up/online-checkout
---

# Online store checkout: donations with the Charitips API

> An online store offers to round the order total up to the next euro at checkout. The customer ticks the round-up, picks the charity, pays the difference with the order and gets the receipt in their name.

- **Use case**: [Round-up on every payment](https://www.charitips.com/docs/use-cases/round-up.md)
- **Sector**: Retail
- **Who pays**: Your users, with their own money
- **What starts the donation**: A purchase
- **Example**: The order total rounded up to the next euro
- **Calls**: [`POST /v1/charities-selections`](https://www.charitips.com/docs/api-reference/create-charities-selection.md), [`POST /v1/campaigns`](https://www.charitips.com/docs/api-reference/create-campaign.md), [`POST /v1/campaigns/{campaignId}/activate`](https://www.charitips.com/docs/api-reference/activate-campaign.md), [`POST /v1/donations`](https://www.charitips.com/docs/api-reference/create-donation.md), [`DELETE /v1/donations/{donationId}`](https://www.charitips.com/docs/api-reference/delete-donation.md)
- **Webhooks**: `donation_create`

Interactive demo on the page. The same flow as a build spec: https://www.charitips.com/docs/demos/round-up/online-checkout.md

## How it works

The screens of the demo in order, with the calls your server makes at each one.

### Once, before the first customer

- [`POST /v1/charities-selections`](https://www.charitips.com/docs/api-reference/create-charities-selection.md) Create a charities selection: once: the charities you offer, from the catalog

  ```json
  {
    "name": "Checkout round-up charities",
    "charityIds": [
      "<charityId>"
    ]
  }
  ```
- [`POST /v1/campaigns`](https://www.charitips.com/docs/api-reference/create-campaign.md) Create a campaign: once: the campaign, on an account with the B2C use case

  ```json
  {
    "name": "Checkout round-ups",
    "charitiesSelectionId": "<charitiesSelectionId>"
  }
  ```
- [`POST /v1/campaigns/{campaignId}/activate`](https://www.charitips.com/docs/api-reference/activate-campaign.md) Activate a campaign: once: the campaign starts taking donations

### 1. Round up at checkout

The customer ticks the round-up at checkout and picks a charity in the widget. Your store keeps both with the order. Nothing is sent to Charitips yet.

- The customer picks a charity from your selection.
- Button: Round my total up to 55,00 €

No call: this screen only shows the result.

### 2. Order paid with its round-up

The customer pays the order and the round-up in one payment. Your server then records the donation in the customer's name, with the order's billing name and address: the fiscal receipt goes to them, and in France 66 % of the donation comes off their income tax.

- Order total: 54,40 €
- Round-up for the charity: 0,60 €
- **Charged to the customer: 55,00 €**
- Button: Pay 55,00 €

**Your server calls:**

- [`POST /v1/donations`](https://www.charitips.com/docs/api-reference/create-donation.md) Create a donation: once the order is paid, from your payment webhook; amount in cents; hasBeenCharged puts the receipt in the customer's name, at the order's billing address

  ```json
  {
    "campaignId": "<campaignId>",
    "amount": 60,
    "uniqueExternalId": "order_20817",
    "externalId": "customer_5521",
    "charityId": "<charityId>",
    "hasBeenCharged": true,
    "withFiscalReceipt": true,
    "donor": {
      "firstName": "Camille",
      "lastName": "Martin",
      "email": "camille.martin@example.com",
      "street": "12 rue des Lilas",
      "zip": "75011",
      "city": "Paris",
      "country": "FR"
    }
  }
  ```

Charitips then sends the `donation_create` webhook to your endpoint.

### 3. Order refunded

The order is refunded: your server deletes its round-up, as long as it is not billed yet.

- Button: Simulate a refund of the order

**Your server calls:**

- [`DELETE /v1/donations/{donationId}`](https://www.charitips.com/docs/api-reference/delete-donation.md) Delete a donation: donationId kept with the order; only before the monthly bill

## Other ways to run it

- [Bank card payments](https://www.charitips.com/docs/use-cases/round-up/bank-card.md) (Banking and insurance): Each card payment rounded up to the next euro
- [Festival cashless wallet](https://www.charitips.com/docs/use-cases/round-up/festival-wallet.md) (Culture and events): Each wristband payment rounded up to the next euro
- [Mobility wallet](https://www.charitips.com/docs/use-cases/round-up/transit-wallet.md) (Travel and mobility): Each journey rounded up to the next euro
- [Restaurant self-order kiosk](https://www.charitips.com/docs/use-cases/round-up/self-order-kiosk.md) (Hotels and restaurants): The bill rounded up to the next euro at the kiosk
- [Full guide: edge cases, webhooks, receipts](https://www.charitips.com/docs/use-cases/round-up.md)
- [All use cases](https://www.charitips.com/docs/use-cases.md)
