# Add a Sender

Creates a sender record. The sender is the legal person or entity authorising disbursements through NexterPay.

### AddPayOutSender Request

Endpoint: <mark style="color:red;">`POST`</mark> `/Payouts/AddPayOutSender`

{% hint style="info" %}
&#x20;**Run this once per user** The returned `senderID` is reusable across all subsequent payouts. Do not call this endpoint on every payout. See How PayOut  → [Sender lifecycle](https://app.gitbook.com/o/IxFtW2iNx95uJW8nJNhT/s/8gv5innHSaMBGpSTwYJp/~/edit/~/changes/8/payout/payout#sender-lifecycle)
{% endhint %}

#### Headers

<table><thead><tr><th width="217.84765625">Name</th><th width="204.41015625">Type</th><th>Value</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>String</td><td><code>application/json</code></td></tr><tr><td><code>Authorization</code></td><td>String</td><td><code>Bearer &#x3C;token></code></td></tr></tbody></table>

#### Body

<table><thead><tr><th width="173.767578125">Field</th><th width="189.62890625">Type</th><th width="106.775390625">Required</th><th width="275.1572265625">Description</th></tr></thead><tbody><tr><td><code>firstName</code></td><td>string</td><td>yes</td><td>Beneficiary's first name.</td></tr><tr><td><code>lastName</code></td><td>string</td><td>yes</td><td>Beneficiary's last name.</td></tr><tr><td><code>dateOfBirth</code></td><td>string (ISO 8601)</td><td>yes</td><td>e.g., <code>1998-01-01T00:00:00Z</code>.</td></tr><tr><td><code>countryOfBirth</code></td><td>string (ISO 3166-1 alpha-2)</td><td>yes</td><td>e.g., <code>CM</code>.</td></tr><tr><td><code>address1</code></td><td>string</td><td>yes</td><td>Street address.</td></tr><tr><td><code>city</code></td><td>string</td><td>yes</td><td>City.</td></tr><tr><td><code>postalCode</code></td><td>string</td><td>yes</td><td>Postal code (see warning below).</td></tr><tr><td><code>province</code></td><td>string</td><td>yes</td><td>State, province, or region.</td></tr><tr><td><code>country</code></td><td>string (ISO 3166-1 alpha-2)</td><td>yes</td><td>Country of residence.</td></tr><tr><td><code>mobileCountryCode</code></td><td>integer</td><td>yes</td><td>Numeric dialing code.</td></tr><tr><td><code>mobileNumber</code></td><td>string</td><td>yes</td><td>Mobile number without country code.</td></tr><tr><td><code>emailAddress</code></td><td>string</td><td>yes</td><td>Sender's email address.</td></tr></tbody></table>

{% hint style="warning" %}
&#x20;**`postalCode` is required.** Even if some Swagger examples omit it, the API rejects sender creation requests that are missing this field. If you do not have a postal code for the address, use a locally valid default (for Cameroon, `00237` is commonly accepted).
{% endhint %}

#### Example request

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST "https://api-sandbox.nexterpay.io/Payouts/AddPayOutSender" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "John",
    "lastName": "Doe",
    "dateOfBirth": "1998-01-01T00:00:00Z",
    "countryOfBirth": "CM",
    "address1": "123 Street",
    "city": "Douala",
    "postalCode": "00237",
    "province": "Littoral",
    "country": "CM",
    "mobileCountryCode": 237,
    "mobileNumber": "670000000",
    "emailAddress": "test@email.com"
  }'
```

{% endtab %}

{% tab title="JSON" %}

```json
{
  "firstName": "John",
  "lastName": "Doe",
  "dateOfBirth": "1998-01-01T00:00:00Z",
  "countryOfBirth": "CM",
  "address1": "123 Street",
  "city": "Douala",
  "postalCode": "00237",
  "province": "Littoral",
  "country": "CM",
  "mobileCountryCode": 237,
  "mobileNumber": "670000000",
  "emailAddress": "test@email.com"
}
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const response = await fetch(
  "https://api-sandbox.nexterpay.io/Payouts/AddPayOutSender",
  {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${token}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      firstName: "John",
      lastName: "Doe",
      dateOfBirth: "1998-01-01T00:00:00Z",
      countryOfBirth: "CM",
      address1: "123 Street",
      city: "Douala",
      postalCode: "00237",
      province: "Littoral",
      country: "CM",
      mobileCountryCode: 237,
      mobileNumber: "670000000",
      emailAddress: "test@email.com"
    })
  }
);

const data = await response.json();
const senderID = data.senderID;
```

{% endtab %}
{% endtabs %}

### Response

Response received after creating a sender

#### Example responses

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

```json
{
    "senderID": "cf0b664c-f672-41da-9170-7c21234568f8",
    "firstName": "John",
    "lastName": "Doejao",
    "dateOfBirth": "1998-01-01T00:00:00",
    "countryOfBirth": "CM",
    "address1": "123 Street",
    "postalCode": "00237",
    "city": "Douala",
    "province": "Littoral",
    "country": "CM",
    "mobileCountryCode": 237,
    "mobileNumber": "670000000",
    "emailAddress": "test@email.com"
}
```

{% endtab %}

{% tab title="400 - Missing postalCode" %}

```json
{
  "error": "ValidationError",
  "message": "postalCode is required."
}
```

{% endtab %}

{% tab title="400 - Invalid country" %}

```json
{
  "error": "InvalidCountry",
  "message": "Country code is not supported."
}
```

{% endtab %}
{% endtabs %}

### What happens next

After a successful response, **persist the `senderID`** in your database. You'll need it for every subsequent payout from this sender.

The next step is to [Send a payout](/payout/send-a-payout.md) using this `senderID`.

### Common errors

| Error                    | Cause                                | Fix                                                                   |
| ------------------------ | ------------------------------------ | --------------------------------------------------------------------- |
| `postalCode is required` | Body missing the `postalCode` field. | Always include `postalCode`. For Cameroon, `00237` is a safe default. |
| `InvalidCountry`         | Country code not supported.          | Confirm support via Get Countries.                                    |
| `TokenExpired`           | Bearer token past its lifetime.      | Re-fetch a token via Authentication.                                  |


---

# 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://docs.nexterpay.io/payout/add-a-sender.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.
