# Stripe integration

If you do not have an existing Stripe account, you will need to create one. You can do this by visiting the Stripe website (<https://stripe.com/>) and following the sign-up process.

{% hint style="warning" %}
Ensure you are not in Test mode
{% endhint %}

Setting up a Stripe API Key:

1. Navigate to the Api Keys section(<https://dashboard.stripe.com/apikeys>)
2. In Standard keys click "Create secret key"&#x20;
3. Enter key name (e.g. "Peach secret key")
4. Click create.
5. Save the generated  key to your computer (we will need this later)

Setting up a Stripe Webhook:

1. Navigate to the Webhooks section: (<https://dashboard.stripe.com/webhooks>)\\
2. Click on the "Add endpoint" button
3. Enter the endpoint URL: In the "Endpoint URL" field, enter the following URL: [https://api.peach-in.com/v3/webhook/strip&#x65;**/**<mark style="color:blue;">**accountId**</mark>](https://api.peach-in.com/v3/webhook/stripe/%7BaccountId%7D) . Replace <mark style="color:blue;">**accountId**</mark> with the your peach account id. (you can find you peach account id by visiting your portal at [https://peach-in.com/portal](https://www.peach-in.com/portal/editSite) in the account settings page)
4. Next, click on "Select events" and search for each of the following events - charge.succeeded, charge.failed, invoice.payment\_failed, customer.subscription.deleted .Select the checkbox for each event.
5. Click Add events
6. Save your webhook: Click on the "Add endpoint" button to save your webhook.

Connecting Your stripe account to peach:

1. Login to your peach portal[ https://peach-in.com/login](< https://peach-in.com/login>)
2. Navigate to payment option page  (<https://www.peach-in.com/portal/editSite/payment-options>)
3. Click on "Add"&#x20;
4. Name you payment method (this is an internal name, it can be whatever you want)
5. Copy your stripe "Publishable Key" (from stripe Api keys section) and paste it in to "Public key" field in peach
6. Copy your "Secret key" you previously saved and paste it in "Private key" field in peach
7. &#x20;Choose which countries you want this payment method to be available in&#x20;
8. Click Save (top left corner of the page)

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://peach-organization.gitbook.io/peach/stripe-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
