Skip to main content

Quick Start

Quick Start

You can start testing the Payout service in the sandbox in just a few seconds.

1. Create your Moyasar Account

info

If you already have an account at Moyasar, you can skip this step.

  • Create an account using the following link
  • Navigate to Settings -> API Keys and copy your secret test API key. The key should start with the following prefix: sk_test_
  • Encode your key into BASE64 value. For example, if your test key is sk_test_t_123, then the encoded value will be c2tfdGVzdF90XzEyMw==

2. Create a Payout Account (ANB Bank Example)

Verb, Path, and Headers

POST /v1/payout_accounts
Authorization: Basic {BASE64 encoded secret key}

JSON Body

{
"account_type": "bank",
"properties": {
"iban": "SA8430400108057386290038"
},
"credentials": {
"client_id": "any-id",
"client_secret": "any-secret"
}
}

Response

{
"id": "ceb461ea-3f35-4027-b20a-beb89f5ee574",
"account_type": "bank",
"currency": "SAR",
"properties": {
"iban": "SA8430400108057386290038"
},
"created_at": "2025-04-08T06:47:00.135Z"
}

3. Send The Payout

Verb, Path, and Headers

POST /v1/payouts
Authorization: Basic {BASE64 encoded secret key}
{
"source_id": "ceb461ea-3f35-4027-b20a-beb89f5ee574",
"amount": 100,
"purpose": "personal",
"destination": {
"type": "bank",
"iban": "SA5330400108057386290014",
"name": "Faisal Alghurayri",
"mobile": "0555555555",
"country": "SA",
"city": "Riyadh"
}
}

Response

{
"id": "ac2cc6d8-1ffa-48e9-a6eb-d4e98dbdb8ec",
"source_id": "ceb461ea-3f35-4027-b20a-beb89f5ee574",
"sequence_number": "6244377266243449",
"channel": "internal",
"status": "initiated",
"amount": 100,
"currency": "SAR",
"purpose": "personal",
"comment": null,
"destination": {
"type": "bank",
"mobile": "0555555555",
"iban": "SA5330400108057386290014",
"name": "Faisal Alghurayri",
"country": "SA",
"city": "Riyadh"
},
"message": "Payment was received, please check back after 5 minutes",
"failure_reason": null,
"created_at": "2025-04-08T06:52:10.868Z",
"updated_at": "2025-04-08T06:52:10.895Z",
"metadata": null
}