> For the complete documentation index, see [llms.txt](https://docs.shoffi.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shoffi.app/the-shoffi-api/affiliate-payment-request.md).

# Affiliate Payment Request

## Issuing a payment request to the app, on behalf of the affiliate.&#x20;

<mark style="color:green;">`POST`</mark> `https://platform.shoffi.app/API/affiliate/requestPayment`

You can use this API to let affiliates request payments directly from your app/website if they have already earned more than the minimum withdrawal amount.

#### Request Body

| Name                                          | Type    | Description                               |
| --------------------------------------------- | ------- | ----------------------------------------- |
| apiKey<mark style="color:red;">\*</mark>      | String  | Your Shoffi app API Key                   |
| appId<mark style="color:red;">\*</mark>       | Integer | Your app ID                               |
| paypalEmail<mark style="color:red;">\*</mark> | String  | The PayPal email account of the affiliate |
| email<mark style="color:red;">\*</mark>       | String  | The affiliate email address               |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "affiliateNewTerms": {
        "revenueShare": 50,
        "cpi": 10,
        "limitPeriod": 24,
        "minWithdrawal": 50
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "status": 400,
    "message": "Error details"
}
```

{% endtab %}
{% endtabs %}

```
curl -X POST 'https://platform.shoffi.app/API/affiliate/requestPayment' \
-H 'Content-Type: application/json' \
-d '{
    "apiKey": "YourKey",
    "appId": 00000000,
    "affiliateDetails": {
        "email": "tobias@lutke.com",
        "paypalEmail": "tobias@lutke.com"
    }
}'
```

{% hint style="warning" %}
**Please Note!**\
Some affiliates already added their PayPal email account to Shoffi. In that case, **the PayPal account will remain the old one**, and not the one you have sent in in the request.

You can see the final PayPal email account in the response data.
{% endhint %}

## Response example

```json
200 OK
Content-Type: application/json
```

```json
{
    "affiliateDetails": {
        "email": "tobias@lutke.com",
        "firstName": "Tobias",
        "lastName": "Lütke",
        "nickName": "tobi"
    },
    "affiliatePerformance": {
        "appProfit": 39.8,
        "affiliateProfit": "7.96",
        "paidToAffiliate": 0,
        "linkViews": 3
    },
    "paypalAddress": "tobias@lutke.com"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.shoffi.app/the-shoffi-api/affiliate-payment-request.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
