PayGate

Recipients

Create and manage payout recipients.

Recipients API

Recipients represent external accounts (mobile money wallets or bank accounts) that can receive payouts.

The Recipient Object

{
  "id": "rcp_abc123def456",
  "object": "recipient",
  "name": "John Doe",
  "account": {
    "type": "mobile_money",
    "phone": "024****567",
    "provider": "mtn"
  },
  "email": "john@example.com",
  "metadata": {
    "employee_id": "123"
  },
  "created_at": "2024-01-15T10:00:00Z"
}

Attributes

AttributeTypeDescription
idstringUnique identifier
objectstringAlways "recipient"
namestringRecipient's name
accountobjectAccount details
account.typestringmobile_money or bank_account
account.phonestringPhone (mobile money)
account.providerstringProvider (mobile money)
account.bank_codestringBank code (bank account)
account.account_numberstringAccount number (bank account)
emailstringRecipient's email
metadataobjectCustom metadata
created_atstringCreation timestamp

Create a Recipient

Creates a new recipient.

POST /v1/recipients

Request Body

ParameterTypeRequiredDescription
namestringYesRecipient's name
accountobjectYesAccount details
account.typestringYesmobile_money or bank_account
account.phonestring*Phone number (mobile money)
account.providerstring*Provider code (mobile money)
account.bank_codestring*Bank code (bank account)
account.account_numberstring*Account number (bank account)
emailstringNoRecipient's email
metadataobjectNoCustom metadata

Mobile Money Recipient

curl -X POST https://api.44.200.142.19.nip.io/v1/recipients \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "account": {
      "type": "mobile_money",
      "phone": "0241234567",
      "provider": "mtn"
    },
    "email": "john@example.com",
    "metadata": {
      "employee_id": "123"
    }
  }'
const recipient = await paygate.recipients.create({
  name: 'John Doe',
  account: {
    type: 'mobile_money',
    phone: '0241234567',
    provider: 'mtn'
  },
  email: 'john@example.com',
  metadata: {
    employee_id: '123'
  }
})
recipient = client.recipients.create(
    name='John Doe',
    account={
        'type': 'mobile_money',
        'phone': '0241234567',
        'provider': 'mtn'
    },
    email='john@example.com',
    metadata={'employee_id': '123'}
)
$recipient = $paygate->recipients->create([
    'name' => 'John Doe',
    'account' => [
        'type' => 'mobile_money',
        'phone' => '0241234567',
        'provider' => 'mtn'
    ],
    'email' => 'john@example.com',
    'metadata' => ['employee_id' => '123']
]);

Bank Account Recipient

curl -X POST https://api.44.200.142.19.nip.io/v1/recipients \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "account": {
      "type": "bank_account",
      "bank_code": "GCB",
      "account_number": "1234567890"
    },
    "email": "john@example.com"
  }'
const recipient = await paygate.recipients.create({
  name: 'John Doe',
  account: {
    type: 'bank_account',
    bank_code: 'GCB',
    account_number: '1234567890'
  },
  email: 'john@example.com'
})
recipient = client.recipients.create(
    name='John Doe',
    account={
        'type': 'bank_account',
        'bank_code': 'GCB',
        'account_number': '1234567890'
    },
    email='john@example.com'
)

Supported Providers

Mobile Money

ProviderCode
MTN Mobile Moneymtn
Telecel Cashtelecel
AirtelTigo Moneyairteltigo

Banks

BankCode
Ghana Commercial BankGCB
Ecobank GhanaECO
Stanbic BankSBG
Standard CharteredSCB
Absa BankABSA
Fidelity BankFBN
CalBankCAL
Access BankABG
UBA GhanaUBA
Zenith BankZBG

Contact support for the complete list of supported banks.


Retrieve a Recipient

Retrieves a recipient by ID.

GET /v1/recipients/:id
curl https://api.44.200.142.19.nip.io/v1/recipients/rcp_abc123def456 \
  -H "Authorization: Bearer sk_test_..."
const recipient = await paygate.recipients.retrieve('rcp_abc123def456')
recipient = client.recipients.retrieve('rcp_abc123def456')

Update a Recipient

Updates a recipient.

PATCH /v1/recipients/:id

Request Body

ParameterTypeDescription
namestringRecipient's name
emailstringRecipient's email
metadataobjectCustom metadata

You cannot update the account details. To change the account, create a new recipient.

curl -X PATCH https://api.44.200.142.19.nip.io/v1/recipients/rcp_abc123def456 \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "metadata": {
      "employee_id": "456"
    }
  }'
const recipient = await paygate.recipients.update('rcp_abc123def456', {
  name: 'Jane Doe',
  metadata: {
    employee_id: '456'
  }
})
recipient = client.recipients.update('rcp_abc123def456',
    name='Jane Doe',
    metadata={'employee_id': '456'}
)

Delete a Recipient

Deletes a recipient.

DELETE /v1/recipients/:id
curl -X DELETE https://api.44.200.142.19.nip.io/v1/recipients/rcp_abc123def456 \
  -H "Authorization: Bearer sk_test_..."
await paygate.recipients.delete('rcp_abc123def456')
client.recipients.delete('rcp_abc123def456')

List Recipients

Returns a list of recipients.

GET /v1/recipients

Query Parameters

ParameterTypeDescription
limitintegerNumber of results (1-100)
starting_afterstringCursor for pagination
curl "https://api.44.200.142.19.nip.io/v1/recipients?limit=10" \
  -H "Authorization: Bearer sk_test_..."
const recipients = await paygate.recipients.list({
  limit: 10
})
recipients = client.recipients.list(limit=10)

Send a Payout to a Recipient

Once you've created a recipient, you can send payouts:

// Create recipient
const recipient = await paygate.recipients.create({
  name: 'John Doe',
  account: {
    type: 'mobile_money',
    phone: '0241234567',
    provider: 'mtn'
  }
})

// Send payout
const payout = await paygate.payouts.create({
  amount: 10000, // GHS 100.00
  recipient: recipient.id,
  description: 'Monthly salary'
})