Integrations and API
How to connect your shop to OneBowl: PrestaShop module, WooCommerce plugin and an API for any other platform. Modules and keys are downloaded and created from your dashboard, under Integration.
Before you start
Which key should I use?
In Integration you have two keys:
- Test key (
ob_test_…): the integration works the same and you see in your dashboard how each order would be shared out, but no donation is saved and nothing is charged. Test orders are deleted automatically after 30 days. - Live key (
ob_…): every order creates its donation.
Each key is shown only once, when it is created. Keep it only in your shop; if you think it has leaked, regenerate it and the old one stops working.
What data does the integration send?
The order reference, the amount excluding VAT and shipping, the total and, if you have rules by product or category, the product references. Never your customers' personal data.
PrestaShop
How do I install the PrestaShop module?
- Download the module from Integration (PrestaShop 8 and 9, PHP 7.2 or later).
- In your PrestaShop, go to Modules > Module Manager > Upload a module and upload it.
- Open the module's settings and paste your key (start with the test one).
- Place a test order and check that it appears in your dashboard.
- When everything works, switch to the live key.
The module shows the animal on the product page, in the cart and on the order confirmation, shows the cause selector if you let the customer choose, and cancels the donation when an order is cancelled or returned.
From version 1.2.0 it also shows your seals, banners and widgets. In its settings you choose which seal goes in the footer, which on the product page and which banner or widget appears on the home page. To place one anywhere else in your theme, use {widget name='onebowl' piece='certificate'} (replace certificate with the piece you want) or hook the module to another position from Design > Positions. If you already had the module, nothing is switched on by itself when you update it: you choose.
From version 1.3.0 it can also add the donation to the order confirmation email your shop sends: we explain it below, in "How do I add the donation to the confirmation email?".
WooCommerce
How do I install the WooCommerce plugin?
- Download the plugin from Integration (WordPress 6.5 or later, PHP 7.4 or later).
- In WordPress, go to Plugins > Add New > Upload Plugin and activate it.
- In WooCommerce > OneBowl, paste your key.
- Press "Test connection" and place a test order.
- If you use the block-based cart or checkout, add the
[onebowl]shortcode where you want the animal to appear.
The plugin is compatible with High-Performance Order Storage (HPOS) and cancels the donation when an order is cancelled, refunded or fails.
From version 1.2.0 it also shows your seals, banners and widgets. In WooCommerce > OneBowl you choose the seal for the footer and the one for the product page. Anywhere else, use the [onebowl_seal piece="certificate"] and [onebowl_widget type="animal"] shortcodes, or the "OneBowl seal" widget in Appearance > Widgets. On a new install, the horizontal seal appears in the footer from the start; if you already had the plugin, you choose.
From version 1.3.0 it can also add the donation to the email your customer receives when the order is paid: we explain it below, in "How do I add the donation to the confirmation email?".
TPVSolarium
How do I connect my TPVSolarium centre?
- When you create your account on OneBowl, choose the TPVSolarium platform.
- Under Integration, create the key (start with the test one) and copy it.
- In TPVSolarium, go to the owner portal > Marketing > OneBowl and paste the key.
- Make a test sale and check that it appears in your dashboard: sales are sent automatically a few minutes after they are paid.
- When everything works, create the live key and paste it in the same place.
There is nothing to install. TPVSolarium sends every new sale from the centre's till and online shop, and cancels the donation when a sale is voided or refunded. For category rules use c:sesion, c:bono, c:servicio or c:producto.
Shopify and other platforms
Does it work with Shopify?
The Shopify app is in preparation. In the meantime, you can connect your Shopify shop, or any other platform, through the API.
API
How do I authenticate?
API base: https://onebowl.eu/api/v1. Send your key with every call:
Authorization: Bearer ob_xxxxxxxxxxxxxxxx
Accept: application/json
The language of the texts in the response is chosen with ?locale=es|en|pt|fr|it|de or with the Accept-Language header. The limit is 300 calls per minute per shop. Amounts are always in cents (integers).
How do I record an order?
POST /commitments
{
"reference": "PS-1001",
"base_cents": 6400,
"total_cents": 7744,
"currency": "EUR",
"items": [
{ "ref": "CREMA-50", "categories": ["12", "15"], "quantity": 2, "base_cents": 4000 },
{ "ref": "TOALLA", "quantity": 1, "base_cents": 2400 }
],
"choice": { "type": "shelter", "id": 7 }
}
reference: the order's unique identifier in your shop. The call is idempotent: if you repeat it with the same reference, it returns what was already recorded (code 200 instead of 201) without duplicating anything.base_cents: the order amount excluding VAT and shipping. It is the base for percentages.items: only needed if you have rules by product or category. In the rules, a product is written asp:REFand a category asc:ID.choice: only if the customer has chosen a cause and your rule allows it (Pro or Business plan).typecan beshelter,campaignorneed; the valid options are given byGET /choices.
The response (201) includes message, the sentence ready for the confirmation page ("With your order, Tienda Sol gives €3.20 to Refugio Sol"), tracking_url, the "Follow your order’s donation" link for the thank-you page, email, the block ready for your confirmation email (see below), and lines, with each part of the donation: amount, shelter, animal (with photos) and need with its progress.
If the order does not create a donation (no active rules, plan limit reached or monthly cap used up), the response is 200 with empty lines and a null message: in that case, show nothing.
How do I add the donation to the confirmation email?
The PrestaShop module and the WooCommerce plugin do it on their own from version 1.3.0: they add to the confirmation email your shop sends a block with the donation sentence, the animal’s photo if there is one, when it reaches the shelter and the "Follow your order’s donation" link. It is on for new installs; if you already had them, updating does not switch it on: turn it on in their settings ("Add the donation to the confirmation email"). In PrestaShop it goes in the order confirmation email or, if payment is confirmed later (for example, a bank transfer), in the payment accepted email; in WooCommerce, in the processing order email, sent when the order is paid, or in the completed order email if that one is not sent or the donation was not ready yet.
If you connect your shop through the API, the response includes email with the block ready to use: email.html for HTML emails and email.plain for plain-text ones, in the language you ask for with locale, plus each text separately (title, text, note, link_text, link_url and credit) in case you prefer to lay it out yourself. If the order generates no donation, email is null: show nothing. With the test key, the block carries a test notice and has no link.
OneBowl does not send this email or receive your customers’ data: your shop adds the block to its own email.
How do I look up or cancel an order?
GET /commitments/{reference}returns the order with the current status of each line:pending(within the return period),consolidated,charged,transferred,confirmed,cancelledorunpaid.POST /commitments/{reference}/cancelcancels the lines that have not been charged yet and responds{"cancelled": 1, "not_cancellable": 0}. Lines that have already gone into a monthly closing cannot be cancelled: that donation stands.
What else can I look up?
GET /causes?country=ES&city=Valencia: verified shelters and active campaigns.GET /choices: the causes the customer can choose according to your rules. If the list is empty, do not show the selector.GET /animals/{id}: an animal's profile, its shelter and its open needs.GET /widget: an animal with an open need among the shelters in your rules. It changes every hour and returns{"animal": null}if there is none with an approved photo.GET /impact: what your shop has committed and delivered, orders, animals and shelters helped.deliveredis only what has already arrived.GET /kit?locale=es: the addresses of your seals, banners, print pieces and widgets, with their size, in the language requested, and the websites where they are authorised. If your shop has no public page it returns{"available": false}.
With the test key, responses include "test": true and do not include tracking_url.
What do the errors mean?
| Code | Meaning |
|---|---|
| 401 | Key missing or not valid |
| 403 | The shop is not active |
| 404 | Does not exist |
| 422 | Invalid data (details in errors) |
| 429 | Too many calls |
Seals, banners and widgets
Can I show my impact on any website?
Yes. In Communication you have every piece with its code ready to copy and a button to download it. They carry the OneBowl logo, show what you have already delivered (never what is on its way), update themselves and link to your public page, where anyone can check the figures. They work on any platform, even without installing the module, and in the website's six languages.
Which pieces are there?
| Piece | Size | What for |
|---|---|---|
| Horizontal seal | 240 × 80 | Footer, cart, product page |
| Round seal | 200 × 200 | Footer or an "About us" page |
| Medal | 180 × 230 | Sidebar or values page |
| Small round seal | 120 × 120 | Next to the payment logos or in the cart |
| Mini horizontal seal | 180 × 44 | Footer or next to the payment methods |
| Shield | 150 × 180 | Sidebar or values page |
| Dog and cat | 200 × 200 | "About us" page, blog or social media |
| Horizontal seal with dog and cat | 280 × 96 | Footer or cart |
| Bowl and paw prints | 160 × 160 | Footer or sidebar |
| Tag with cat | 130 × 190 | Sidebar or product page |
| Cat | 160 × 160 | Footer or sidebar |
| Dog | 160 × 160 | Footer or sidebar |
| Horizontal banner | 728 × 90 | Header or between sections |
| Billboard | 970 × 250 | Home page or landing pages |
| Medium rectangle | 300 × 250 | Blog or sidebar |
| Large rectangle | 336 × 280 | Blog or sidebar |
| Square | 250 × 250 | Sidebar |
| Half page | 300 × 600 | Tall sidebar |
| Skyscraper | 160 × 600 | Narrow sidebar |
| Mobile | 320 × 50 | Mobile version |
| Large mobile | 320 × 100 | Mobile version |
| Parcel insert card (A6) | 420 × 594 | Print and put in your parcels |
| QR code with caption | 240 × 300 | Counter, packaging or invoices |
| Impact widget | 300 × 420 | What you delivered, shelters and animals helped |
| Widget with an animal | 320 × 580 | A real animal you help, with its photo and its need |
The print pieces show no amounts, because on paper they would go out of date: their QR code leads to your public page, where they are always up to date. Download them as SVG: they print sharp at any size.
What are the seal levels?
Your seals show a level according to what has actually reached the shelters, not counting what is on its way: Bronze from the first delivery, Silver from €250, Gold from €1,000 and Platinum from €5,000. Each level has its own colour and its name in the six languages, and the seal changes automatically when you go up. In Communication you can see your level and how much is left for the next one. The banners and the print pieces do not change.
On which websites are my seals and widgets shown?
Only on the ones you authorise in Communication > Authorised websites. If you list none, your shop's domain is used. If someone copies your seal onto another website, it will show "Seal not authorised on this website", and the browser will not load your widget. That way nobody can pose as a shop that helps using your data.
Enter one domain per line: myshop.com includes www.myshop.com, and *.myshop.com includes all its subdomains. You can authorise up to 20 websites. Authorisation works per website rather than per page because browsers only say which website an image is loaded from, not which page.
Why has my seal stopped showing?
Your seals, banners and widgets announce that your shop donates with every purchase, so they are only shown while that is true: they stop showing if you have no card or a payment is outstanding, and also if you have gone 14 days without generating any donation (if you have never donated yet, the days count from your registration). They come back automatically with the next donation, without you having to change anything on your website. You can still see them in Communication, with a notice explaining why they are not shown.
Are there videos for my social media and website?
Yes. In Communication > Videos for your social media and website you have a short video, with music and no voice-over, that tells your customers your shop donates to shelters. It is available in the six languages and in three formats: vertical 9:16 (stories, reels and TikTok), 4:5 (Instagram and Facebook posts) and landscape 16:9 (your website and YouTube). The images are illustrative; only post it while your shop is donating.
How does my shop appear in Shops that help?
In Communication > Your listing in Shops that help you upload your logo, write one or two sentences about what you do and add the link to your online shop or website. Your listing appears on OneBowl’s Shops that help page and on your public page, with your level and what has already reached the shelters. It is shown while your public page is on and your shop has generated donations in the last 14 days, just like the seals. If you only write the description in your language, the others are filled in with machine translation, which you can correct.
How do I add them with the module or the plugin?
With the PrestaShop module or the WooCommerce plugin (version 1.2.0 or later) you do not need to copy any code: you choose the piece in its settings and the module shows it in each visitor's language. We explain it in the PrestaShop and WooCommerce sections. Your shop's domain must be among your authorised websites.
What does someone who clicks the seal see?
Your public page: what you have delivered, to which shelters and to which animals, and a box explaining what OneBowl is and how we verify shelters. If the shelters you help have card donations turned on, the visitor can also donate to them directly from there; those donations are theirs and are not added to what you have donated.