> For the complete documentation index, see [llms.txt](https://startbutton.gitbook.io/startbutton-product-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://startbutton.gitbook.io/startbutton-product-api/collections/server-to-server-integration-overview/s2s-virtual-accounts.md).

# S2S — Virtual Accounts

Create a virtual account for a customer payment.

See [Authentication](/startbutton-product-api/getting-started/authentication.md) before making requests.

### Endpoint

`POST /transaction/initialize-s2s`

### Headers

| Header        | Value               |
| ------------- | ------------------- |
| Authorization | `Bearer PUBLIC_KEY` |
| Content-Type  | `application/json`  |

For NGN, also pass `provider` as `providus` or `baines`.

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

### Request

```json
{
  "amount": 300000,
  "currency": "NGN",
  "email": "test-pms@customer.com"
}
```

### Response

{% tabs %}
{% tab title="Response for baines" %}

```json
{ 
    "success": true, 
    "message": "VA initiated", 
    "data": { 
        "accountNumber": 8200244923, 
        "reference": "7d19bfxxxxxx", 
        "expiryTime": "2024-01-30T13:08:11.179Z", 
        "bankName": "BAINES CREDIT MICROFINANCE BANK", 
        "accountName": "Checkout Earth/SB" 
    }
}
```

{% endtab %}

{% tab title="Response for providus" %}

```json
{
  "success": true,
  "message": "VA initiated",
  "data": {
    "accountNumber": "9627094872",
    "expiryTime": "2024-03-25T18:50:04.329Z",
    "reference": "3b8xxxxxxxxx",
    "bankName": "PROVIDUS BANK",
    "accountName": "Start Button Limited(Checkout)"
  }
}
```

{% endtab %}
{% endtabs %}

### Mock transfer

To simulate a transfer being made by your customer on our sandbox environment; use the request body below.

Pass the PUBLIC KEY before making a call to this endpoint.

`POST /transaction/mock-va-collection`

Here's a sample request below

```json
{
  "amount": 300000,
  "accountNumber": "8200244923",
  "reference": "7d19bfxxxxxx"
}
```

The reference being passed here should be that gotten from the response.

Here's a sample response below

```json
{
    "success": true,
    "message": "success",
    "data": "Transaction processed"
}
```

Once payment has been made a webhook is sent and merchants can get the transaction status at anytime.
{% endtab %}

{% tab title="GHS" %}

### Request

```json
{
  "amount": 50000,
  "currency": "GHS",
  "email": "test-pms@customer.com",
  "reference": "ref-102ssss"
}
```

### Response

```json
{
  "success": true,
  "message": "VA initiated",
  "data": {
    "accountNumber": "900xxxxxxxxxx",
    "expiryTime": "2024-09-06T11:57:32.082Z",
    "reference": "4fxxxxxxxxx",
    "bankName": "StartButton Bank",
    "accountName": "StartButton Merchant",
    "shortCode": "shc-jqzv2ktl2f"
  }
}
```

{% endtab %}
{% endtabs %}

Amounts use fractional units. Check transaction outcomes through [Transaction Statuses](/startbutton-product-api/collections/transaction-statuses.md).
