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
- Once you have created the test account, navigate to
Settings -> API Keys:- If you have not generated any of your secret keys previously, or if you lose a generated one, you have to regenerate it and store it in a safe spot; as you will not be able to view it again -- only its ID (which starts wih
sk_test_). - The secret test key should start with the prefix:
sk_test_.
- If you have not generated any of your secret keys previously, or if you lose a generated one, you have to regenerate it and store it in a safe spot; as you will not be able to view it again -- only its ID (which starts wih
2. Create a Payout Account (ANB Bank Example)
info
Creating payout accounts through the API works in the sandbox only. Live payout accounts are set up by the Moyasar team, see Payout Account Details.
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
}