# Collection South Africa

### Create a Collection to South Africa

<mark style="color:green;">`POST`</mark> `/`[`directdebit`](https://sandbox.yogupay.com/auth/payout)

**Headers**

<table><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>Token</td><td><pre><code>token
</code></pre></td></tr></tbody></table>

**Body**

<table><thead><tr><th width="233">Name</th><th width="126">Type</th><th>Description</th></tr></thead><tbody><tr><td>route_name</td><td>string</td><td>Payment route to use (e.g., <code>TRANSFER_ZA</code>)</td></tr><tr><td>debitor_name</td><td>string</td><td>Debitor/customer full name.</td></tr><tr><td>debitor_account</td><td>string</td><td>Debitor account identifier (often MSISDN or account number depending on route)</td></tr><tr><td>debitor_mobile</td><td>string</td><td>Debitor mobile number (MSISDN)</td></tr><tr><td>debitor_currency_code</td><td>string</td><td>Currency code (e.g., ZAR).</td></tr><tr><td>debitor_country_code</td><td>string</td><td>Country code (e.g., ZA).</td></tr><tr><td>reference_number</td><td>string</td><td>Unique reference for idempotency/reconciliation</td></tr><tr><td>amount</td><td>number</td><td>Amount to debit/collect.</td></tr><tr><td>callback_url</td><td>string</td><td>URL the system will call asynchronously with status updates</td></tr><tr><td>redirect_url</td><td>string</td><td>Your Webpage URL</td></tr></tbody></table>

{% hint style="info" %}
Keep `reference_number` unique to avoid duplicates.

> `callback_url` should be publicly reachable if callbacks originate outside your network.
> {% endhint %}

**Request & Response**

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

```json
{
  "route_name": "TRANSFER_ZA",
  "debitor_name": "John Doe",
  "debitor_account": "XV34387",
  "debitor_mobile": "+27112345678",
  "debitor_currency_code": "ZAR",
  "debitor_country_code": "ZA",
  "reference_number": "43434343N-ZA",
  "amount": 20,
  "callback_url":"https://sandbox.yogupay.io/webhook-example",
  "redirect_url": "yourwebpageurl"
}
```

{% endtab %}

{% tab title="Successful Response" %}

```json
{
    "success": true,
    "status_code": 100,
    "message": "Follow redirect link to complete payment",
    "transaction_id": "5de7b3f8384b305a19c9",
    "command_status": "ok",
    "remit_status": "CREDIT_IN_PROGRESS",
     "redirect_url": "https://secure.stitch.money/connect/payment-request/9b55589e-8fc2-40fd-baa5-07d359cc0880?red
}
```

{% endtab %}

{% tab title="Failed Response" %}

```json
{ "error": "Invalid request" }
```

{% endtab %}
{% endtabs %}
