---
title: API Reference
slug: jYOV-api-reference
description: Explore Butter's Data Collection API for securing dispute prevention. Learn about endpoint configuration, payload requirements, and Basic Auth setup for successful integration and optimal Order Insight performance.
docTags: 
createdAt: 2024-08-20T18:28:33.313Z
---

# Overview

The Data Collection API enables Butter to collect the necessary information for every successful checkout, to block future dispute claims via Order Insight.

## Endpoint

`https://api.disputes.services.butterpayments.com/v1/analytics`

Endpoint accepts POST requests only.

## Authorization

The Data Collection API uses Basic Auth. Your **username** and **password** for the basic auth credentials will be provided by Butter during onboarding. You will recieve two sets of credentials, one for testing (staging) and another for your production environment.

**Header**

`Authorization`: `Base64 Encoded({username}:{password})`

## Additional Headers

**Header**

`Content-Type`: `application/json`

## Payload

```json
{
  "customer_email": "string",
  "ipv4_address": "string",
  "psp": "string",
  "customer_id": "string", 
  "invoice_id": "string", 
  "charge_id": "string",
  "transaction_id": "string",
  "subscription_id": "string"
}
```

- `customer_email`
  - Required
  - Validation Rule: Must be a valid email address
- `ipv4_address`
  - Required
  - Validation Rule: Must be a valid IPV4 address
  - Format: four sets of numbers, known as octets, separated by periods
  - Examples: 127.0.0.1, 192.168.1.1
- `psp`
  - Required
  - The PSP used to process the transaction.
  - Accepted Values:
    - `stripe`
    - `braintree`
    - `adyen`
    - `worldpay`
    - `recurly`
    - `recharge`
- `customer_id`
  - Optional
  - An ID that identifies the customer in your respective PSP
- At least one of the following fields must be present, the more information provided the more accurate our matching capabilities will be:
  - `invoice_id`
    - An ID that identifies the invoice associated with the successful checkout in your respective PSP
  - `subscription_id`
    - An ID that identifies the subscriptions associated with the successful checkout in your respective PSP
  - `charge_id`
    - Specific to merchants using Stripe as a PSP
    - An ID that identifies the charge associated with the successful checkout session
  - `transaction_id`
    - An ID that identifies the transaction associated with the successful checkout session.
    - Can also be the `network_transaction_id` from the underlying card network.

## Notes

- Merchants using Stripe:
  - We encourage sending the `invoice_id` and/or `charge_id` for the best matching results.



## Responses

### 200:

```json
{
  "status": "OK"
}
```

### 401:

```json
{
  "detail": "Unauthorized"
}
```

### 403:

```json
{
  "detail": "Forbidden"
}
```





