NAV
cURL Python

Introduction

This is Toman's Swap API Reference.

Endpoints

Base URLs

The base URLs for our staging and productions API servers are:

Environment Auth URL
Production https://swap-api.toman.ir
Staging https://swap-api-staging.qcluster.org

Retrieve

Request Scope
GET /wallets/retrieve -

Sample Code

import requests

url = f"{base_url}/wallets/retrieve"

headers = {
    "Authorization": f"Bearer {token}"
}

response = requests.request("GET", url, headers=headers)
curl "$BASE_URL/wallets/retrieve" \
--header "Authorization: Bearer $TOKEN"

Request Body

Without any request body.

Response Body

Parameter Type Description Example
address String (Unique) your swap wallet address "swpirr5vgdghhhfxc6664hh52ghgst"
balance Int Total wallet balance 45600000
blocked_balance Int This balance is blocked in the user's wallet 10000000
min_balance Int The minimum amount of balance that should remain in the wallet. 25000
available_balance Int This balance is withdrawable 35600000

Response Data Example

{
"address": "swpirr5vgdghhhfxc6664hh52ghgst",
"balance": 45600000,
"blocked_balance": 10000000,
"min_balance": 25000,
"available_balance": 35600000
}

Cash_in

Request Scope
GET /system/bank-accounts/cash-in -

Sample Code

import requests

url = f"{base_url}/system/bank-accounts/cash-in"

headers = {
    "Authorization": f"Bearer {token}"
}

response = requests.request("GET", url, headers=headers)
curl "$BASE_URL/system/bank-accounts/cash-in" \
--header "Authorization: Bearer $TOKEN"

Request Body

Without any request body.

Response Body

The response of this endpoint is following pagination. The results key will be Array of each payment detail:

Parameter Type Description Example
count Int The total number of across all pages 1
next String The URL of the next page containing items after this page's items null
previous String The URL of the next page containing items after this page's items null
results Array[detail inside of list] The array containing the of this page that follows the schema of pagination

Detail of payments inside list API

Each item inside of results key is:

Parameter Type Description Example
account_number String (Unique) The account number in a specific format used by the bank. "12.3456789.10"
account_owner String The name of the owner of the bank account. "تست تستی"
bank_account_id Int A unique identifier for the specific bank account within the bank. 7
bank_id Int A unique identifier for the bank associated with the account. 8
iban String The International Bank Account Number (IBAN) used for international money transfers. "IR123456789001234567891010"

Response Data Example

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "bank_id": 11,
      "bank_account_id": 5,
      "iban": "IR123456789001234567891010",
      "account_number": "12.3456789.10",
      "account_owner": "تست تست"
    }
  ]
}

Orders

Request Scope
GET /orders -

Sample Code

import requests

url = f"{base_url}/orders"

headers = {
    "Authorization": f"Bearer {token}"
}

response = requests.request("GET", url, headers=headers)
curl "$BASE_URL/orders" \
--header "Authorization: Bearer $TOKEN"

Request Body

Without any request body.

Response Body

Parameter Type Description Example
uuid String A UUID 4 string which uniquely identifies the trade. "8pe4c334-023f-6649-8b94-844boped7069"
side String Indicates the side of the order, typically "S" for sell and "B" for buy. "S"
price Float The price at which the order is placed. 642.6084
quantity Float The amount of the asset to be traded in this order. 31200.0
total_amount Float The total monetary amount of the order calculated as price multiplied by quantity. 100000.0
order_link String A URL link to access the details of the order directly. "https://settlement.toman.ir/swap?order_encrypted_id=$"
state Int Represents the current state of the order, with each integer value representing a specific status -2
created_at String (ISO-8601 Date) The date and time when the order was created. "2024-08-26T18:28:42.269000Z"
updated_at String (ISO-8601 Date) The date and time when the order was last updated. "2024-08-26T18:28:42.269000Z"
expiration_datetime String (ISO-8601 Date) The date and time when the order expires if not filled. "2024-08-26T18:28:42.269000Z"
delivery_datetime String (ISO-8601 Date) The date and time when the delivery of the asset is scheduled. "2024-08-26T18:28:42.269000Z"

Response Data Example


{
  "count": 2,
  "next": "https://swap-api.toman.ir/orders/?page=2",
  "previous": null,
  "results": [
      {
        "side": "S",
        "price": 909.10742923,
        "quantity": 24444.0,
        "order_link": "https://settlement.toman.ir/swap?order_encrypted_id=$",
        "total_amount": 22222222.0,
        "state": -2,
        "expiration_datetime": "2024-08-26T18:28:42.269000Z",
        "delivery_datetime": "2024-08-26T18:28:42.269000Z",
        "uuid": "2649c0c4-vaof-8855-ab74-e45lpnn2704a",
        "created_at": "2024-08-26T10:28:54.756007Z",
        "updated_at": "2024-08-26T10:28:54.756069Z"
      },
      {
        "side": "S",
        "price": 765.01390934,
        "quantity": 24444.0,
        "order_link": "https://settlement.toman.ir/swap?order_encrypted_id=$",
        "total_amount": 18700000.0,
        "state": -2,
        "expiration_datetime": "2024-08-19T23:24:58.282000Z",
        "delivery_datetime": "2024-08-19T23:24:58.282000Z",
        "uuid": "12345f1a-2314-4fcc-yybb-07eba4188880",
        "created_at": "2024-08-19T15:25:13.660661Z",
        "updated_at": "2024-08-19T15:25:13.660706Z"
      }
  ]
}

Trades

Request Scope
GET /trades -

Sample Code

import requests

url = f"{base_url}/trades"

headers = {
    "Authorization": f"Bearer {token}"
}

response = requests.request("GET", url, headers=headers)
curl "$BASE_URL/trades" \
--header "Authorization: Bearer $TOKEN"

Request Body

Without any request body.

Response Body

Parameter Type Description Example
uuid String A UUID 4 string which uniquely identifies the trade. "8pe4c334-023f-6649-8b94-844boped7069"
quantity Float The amount or number of items involved in the transaction. 4.0
total_amount Float The total monetary value of the transaction in a specified currency. 2000000.0
must_send_usdt Boolean Indicates whether USDT (Tether cryptocurrency) must be sent as part of the transaction. ّfalse
state Int The minimum amount of balance that should remain in the wallet. Note 1
delivery_datetime String (ISO-8601 Date) The scheduled date and time for the transaction’s delivery. "2024-03-11T21:42:52.693000Z"
created_at String (ISO-8601 Date) The date and time when the transaction was created. "2024-03-11T21:42:52.693000Z"
updated_at String (ISO-8601 Date) The date and time when the transaction was last updated. "2024-03-11T21:42:52.693000Z"

Response Data Example


{
    "count": 4,
    "next": null,
    "previous": null,
    "results": [
        {
            "quantity": 88.0,
            "total_amount": 10000.0,
            "state": -3,
            "delivery_datetime": "2023-12-04T13:30:00Z",
            "must_send_usdt": false,
            "uuid": "0e724d96-p96a-4e9e-9fbd-e6822b2e7df6",
            "created_at": "2023-12-04T10:10:11.614080Z",
            "updated_at": "2023-12-04T10:10:11.614121Z"
        },
        {
            "quantity": 10.0,
            "total_amount": 20000.0,
            "state": 1,
            "delivery_datetime": "2023-11-29T20:30:00Z",
            "must_send_usdt": null,
            "uuid": "2d8a9c2a-3871-43bd-6985-4cd323ef6501",
            "created_at": "2023-11-29T10:58:27.661299Z",
            "updated_at": "2023-11-29T11:45:39.843040Z"
        },
        {
            "quantity": 20.0,
            "total_amount": 10000000.0,
            "state": 1,
            "delivery_datetime": "2023-11-29T06:30:00Z",
            "must_send_usdt": null,
            "uuid": "e24167e1-cb0f-asqr-a107-5a3b9ce7244c",
            "created_at": "2023-11-28T20:30:23.306527Z",
            "updated_at": "2023-11-28T20:33:19.149344Z"
        },
        {
            "quantity": 20.0,
            "total_amount": 10000000.0,
            "state": 1,
            "delivery_datetime": "2023-11-29T14:30:00Z",
            "must_send_usdt": null,
            "uuid": "417b7d67-lgs9-4ac6-afbd-40e05ef20b5e",
            "created_at": "2023-11-28T19:41:05.284873Z",
            "updated_at": "2023-11-28T20:25:46.019716Z"
        }
    ]
}

Deposits list

Request Scope
GET /deposits -

Sample Code

import requests

url = f"{base_url}/deposits"

headers = {
    "Authorization": f"Bearer {token}"
}

response = requests.request("GET", url, headers=headers)
curl "$BASE_URL/deposits" \
--header "Authorization: Bearer $TOKEN"

Request Body

Without any request body.

Response Body

Parameter Type Description Example
uuid String A UUID 4 string which uniquely identifies the withdraw. "8pe4c334-023f-6649-8b94-844boped7069"
amount Int The total monetary amount of the transaction. 12345
autodeposit Object Contains details about an automatic deposit, which may be null if not applicable to this transaction. "S"
description String A description or note associated with the transaction. "تست"
fee Float The transaction fee for this specific transaction. 31200.0
created_at String (ISO-8601 Date) The date and time when the transaction was created. "2024-10-12T20:41:56.617896Z"
paid_at String (ISO-8601 Date) The date and time when the payment was made. "2024-08-26T18:28:42.269000Z"
applied_at String (ISO-8601 Date) The date and time when the transaction was applied. "2024-08-26T18:28:42.269000Z"
systemdeposit Object Contains details about the system deposit associated with this transaction, which may be null if not applicable. -
trace_number String A unique tracking number for the transaction, used for identification and reference. "1122334455"
type Int Represents the type of transaction, with each integer value corresponding to a specific transaction category. 2
updated_at String (ISO-8601 Date) The date and time when the transaction was last updated. "2024-08-26T18:28:42.269000Z"
piddeposit Object Contains details about the specific type of deposit related to the transaction. -
payment_identifier Object An object containing identifiers related to the payment, including a unique identifier and a profile UUID. -
identifier String A unique identifier for the payment. "302000041854826"
pid_profile_uuid String A UUID that identifies the payment profile associated with this transaction. "f0692226-sp90-40bc-ase2-c78674cd0f5c"
state Int Represents the current state of the PID deposit, with each integer value representing a specific state. 2
source String The source of the PID deposit, which may be null if not applicable. "IR123456789101234567891001"

Auto Deposit States

State Code
Created 0
Approved 1
Verified 2
Expired 3
Disapproved 4

PID Deposit States

State Code
Created 0
Applied 1
Verified 2

Response Data Example


{
    "count": 3,
    "next": "https://swap-api.toman.ir/deposits/?page=2",
    "previous": null,
    "results": [
        {
            "amount": 12345,
            "description": "جهت تست",
            "type": 2,
            "paid_at": "2024-10-12T20:40:50Z",
            "applied_at": "2024-10-12T20:42:56.807144Z",
            "trace_number": "1122334455",
            "systemdeposit": null,
            "piddeposit": {
                "payment_identifier": {
                    "identifier": "300000041754926",
                    "pid_profile_uuid": "f06924b6-sp90-40bc-9173-c785f0cd0f5c"
                },
                "state": 2,
                "source": null
            },
            "autodeposit": null,
            "fee": 0.0,
            "uuid": "d22f938a-8g9m-4bd2-aa29-72a66d2dcca0",
            "created_at": "2024-10-12T20:41:56.617896Z",
            "updated_at": "2024-10-12T20:41:56.617932Z"
        },
        {
            "amount": 100000,
            "description": null,
            "type": 1,
            "paid_at": "2024-10-12T17:35:44.515000Z",
            "applied_at": "2024-10-12T17:52:31.050832Z",
            "trace_number": "123456789",
            "systemdeposit": {
                "state": 2
            },
            "piddeposit": null,
            "autodeposit": null,
            "fee": 0.0,
            "uuid": "70f3cc5a-eb59-16y5-b095-3bf48f4dba00",
            "created_at": "2024-10-12T17:36:16.655755Z",
            "updated_at": "2024-10-12T17:36:16.655803Z"
        },
        {
            "amount": 446600000,
            "description": "DRPA-",
            "type": 3,
            "paid_at": "2024-10-08T15:49:59Z",
            "applied_at": null,
            "trace_number": "20241008_154959_0218621659444_403071er6722894_fe873f638e5c5c4obnmc86cd702d81da_0",
            "systemdeposit": null,
            "piddeposit": null,
            "autodeposit": {
                "uuid": "fa304cae-5252-437d-aeab-b8829e7186f4",
                "source": "IR250690271701000059449001",
                "state": 0
            },
            "fee": 0.0,
            "uuid": "1810ac22-89yy-458f-2346-9ba3005d48da",
            "created_at": "2024-10-08T16:20:36.549764Z",
            "updated_at": "2024-10-08T16:20:36.549825Z"
            }
        ]
}

Withdraws list

Request Scope
GET /withdraws -
GET /withdraws/tracking/<tracker_id> -

Sample Code

import requests

url = f"{base_url}/withdraws"

headers = {
    "Authorization": f"Bearer {token}"
}

response = requests.request("GET", url, headers=headers)
curl "$BASE_URL/withdraws" \
--header "Authorization: Bearer $TOKEN"

Request Body

Without any request body.

Response Body

Parameter Type Description Example
uuid String A UUID 4 string which uniquely identifies the withdraw. "8pe4c334-023f-6649-8b94-844boped7069"
amount Int The amount involved in the transaction in a specific currency. 100000
target String The account number or destination for the transaction, shown here as an IBAN. "IR123456789101234567891001"
description String A note or description for the transaction. "test"
is_cancelable Boolean Indicates whether the transaction can be canceled. ّfalse
created_at String (ISO-8601 Date) The date and time when the transaction was created. "2024-03-11T21:42:52.693000Z"
withdraw_method Int Specifies the method used for the withdrawal.method 1
tracker_id String A unique identifier for each withdrawal, intended for reference and internal follow-up purposes. Note "20241120113005678910"

Response Data Example


{
        "count": 3,
        "next": "https://swap-api.toman.ir/withdraws/?page=2",
        "previous": null,
        "results": [
            {
                "amount": 100000,
                "created_at": "2024-10-12T17:27:21.144877Z",
                "uuid": "d5c2edc3-0000-46a9-kkbb-96e442555069",
                "target": "IR89012123456008585157486",
                "description": "test test",
                "is_cancelable": false,
                "withdraw_method": 1,
                "tracker_id": "20241023074540240076"
            },
            {
                "amount": 123456,
                "created_at": "2024-09-25T08:58:35.761109Z",
                "uuid": "eb6fee0f-erty-90ov-8855-5d09b8826fb8",
                "target": "IR740560012341206891011015",
                "description": "",
                "is_cancelable": false,
                "withdraw_method": 1,
                "tracker_id": "20240923074540240076"
            },
            {
                "amount": 123456,
                "created_at": "2024-09-25T08:57:16.404123Z",
                "uuid": "2dc8064c-6ff8-47a6-824e-35d10a593b89",
                "target": "IR940712341569126862734232",
                "description": "تست تست",
                "is_cancelable": false,
                "withdraw_method": 1,
                "tracker_id": "20240925074540240076"
            }
        ]
}

Transactions

Request Scope
GET /transactions -

Sample Code

import requests

url = f"{base_url}/transactions"

headers = {
    "Authorization": f"Bearer {token}"
}

response = requests.request("GET", url, headers=headers)
curl "$BASE_URL/transactions" \
--header "Authorization: Bearer $TOKEN"

Request Body

Without any request body.

Response Body

Parameter Type Description Example
uuid String A UUID 4 string which uniquely identifies the withdraw. "8pe4c334-023f-6649-8b94-844boped7069"
amount Int The amount involved in the transaction in a specific currency. 100000
action String Specifies the action type of the transaction, such as deposit or withdrawal. "deposit"
type Int An integer representing a specific category or classification of the transaction. 0
wallet_balance_after_change Long The wallet’s total balance immediately after this transaction is completed. 50489986
transaction_type String Indicates the nature of the transaction, for instance, transfer or payment. "transfer"
created_at String (ISO-8601 Date) The date and time when the transaction was created. "2024-03-11T21:42:52.693000Z"
updated_at String (ISO-8601 Date) The date and time when the transaction was last updated. "2024-03-11T21:42:52.693000Z"

Response Data Example


{
        "count": 3,
        "next": "https://swap-api.toman.ir/transactions/?page=2",
        "previous": null,
        "results": [
            {
                "amount": 1000,
                "action": "deposit",
                "type": 0,
                "wallet_balance_after_change": 44450489986,
                "transaction_type": "transfer",
                "uuid": "91da65c3-e92d-40e5-adf9-78d474817aa4",
                "created_at": "2024-10-19T09:24:53.630600Z",
                "updated_at": "2024-10-19T09:24:53.630632Z"
            },
            {
                "amount": 12345,
                "action": "withdraw",
                "type": 0,
                "wallet_balance_after_change": 44450488986,
                "transaction_type": "transfer",
                "uuid": "2281440e-a16a-499f-8679-87e037144bdf",
                "created_at": "2024-10-15T12:06:34.194240Z",
                "updated_at": "2024-10-15T12:06:34.194277Z"
            },
            {
                "amount": 1000,
                "action": "deposit",
                "type": 0,
                "wallet_balance_after_change": 44450501331,
                "transaction_type": "transfer",
                "uuid": "5802cfd5-29d0-48ae-8d17-b84725512192",
                "created_at": "2024-10-15T11:54:12.219100Z",
                "updated_at": "2024-10-15T11:54:12.219182Z"
            }
        ]
}

Profiles

Request Scope
GET /payment-identifiers/profiles -

Sample Code

import requests

url = f"{base_url}/payment-identifiers/profiles"

headers = {
    "Authorization": f"Bearer {token}"
}

response = requests.request("GET", url, headers=headers)
curl "$BASE_URL/payment-identifiers/profiles" \
--header "Authorization: Bearer $TOKEN"

Request Body

Without any request body.

Response Body

Parameter Type Description Example
uuid String A UUID 4 string which uniquely identifies the withdraw. "8pe4c334-023f-6649-8b94-844boped7069"
account_holder_name String The full name of the account holder. "تست"
account_holder_national_id String The national identification number of the account holder. "2346576139"
account_holder_phone_number String The phone number associated with the account holder. "09123456789"
account_holder_birthdate String The birthdate of the account holder, formatted as YYYY-MM-DD. ّ"1365-03-17"

Response Data Example


{
        "count": 10,
        "next": null,
        "previous": null,
        "results": [
            {
                "uuid": "9d528ed7-lp2w-6974-bf70-5f63d4080634",
                "account_holder_name": "تست",
                "account_holder_national_id": "2346576139",
                "account_holder_phone_number": "09123456789",
                "account_holder_birthdate": "1365-03-17"
            },
            {
                "uuid": "8af0e042-po56-we08-lo67-7d29d9c69fb6",
                "account_holder_name": "تست تستی",
                "account_holder_national_id": "3000893600",
                "account_holder_phone_number": "09123456789",
                "account_holder_birthdate": "1403-04-04"
            }
        ]
}

Calculate fee

Request Scope
POST /fees/calculate -

Sample Code

import json

import requests

url = f"{base_url}/fees/calculate"

payload = json.dumps(
    {
        "amount": 12345,
        "cash_flow_type": 0,
        "target":"IR840000000000000321234295"
    }
)

headers = {
    "Authorization": f"Bearer {token}",
    "Content-Type": "application/json"
}

requests.request("POST", url, headers=headers, data=payload)
curl "$BASE_URL/fees/calculate" \
--header "Authorization: Bearer $TOKEN"\
--header "Content-Type: application/json" \
--data-raw '{
  "amount": 12345,
  "cash_flow_type": 0,
  "target":"IR840000000000000321234295"
}'

Request Body

Parameter Type Description Example
amount Int The monetary value involved in the transaction. "8pe4c334-023f-6649-8b94-844boped7069"
cash_flow_type Int Indicates the type of cash flow for the transaction. Different integer values represent various cash flow categories, such as income or expense. 0
target String The destination account or IBAN to which the funds are directed. "IR123456789101234567891001"

Response Body

Parameter Type Description Example
fee Int The transaction fee amount that will be applied, typically in the same currency as the transaction. "8pe4c334-023f-6649-8b94-844boped7069"

Response Data Example

{"fee":5000}

withdraws

Request Scope
POST /withdraws -

Sample Code

import json

import requests

url = f"{base_url}/withdraws/"

payload = json.dumps(
    {
        "amount":12345,
        "description":"تست",
        "target":"IR840000000000000321234295",
        "target_bank_id":6,
        "target_owner":"test",
        "tracker_id": "20241125072020674737",
        "withdraw_method":0
    }
)

headers = {
    "Authorization": f"Bearer {token}",
    "Content-Type": "application/x-www-form-urlencoded"
}

requests.request("POST", url, headers=headers, data=payload)
curl "$BASE_URL/withdraws/" \
--header "Authorization: Bearer $TOKEN"\
--header "Content-Type: application/x-www-form-urlencoded" \
--data-raw '{
    "amount":12345,
    "description":"تست",
    "target":"IR840000000000000321234295",
    "target_bank_id":6,
    "withdraw_method":1,
    "target_owner":"test",
    "tracker_id": "20241125072020674737",
    "withdraw_method":0
}'

Request Body

Parameter Type Description Example
amount Int The monetary amount to be transferred in the transaction. "8pe4c334-023f-6649-8b94-844boped7069"
description String A note or label for the transaction, providing additional context or purpose. 100000
target String The destination account’s IBAN to which the funds are directed. "IR123456789101234567891001"
target_bank_id Int An identifier for the target bank, typically represented by a unique numeric code. 6
target_owner String The name of the account owner for the target account. "test"
withdraw_method Int Specifies the method used for the withdrawal. 0
tracker_id String A unique identifier for each withdrawal, intended for reference and internal follow-up purposes.Note "20241120113005678910"

Response Body

Parameter Type Description Example
uuid String A UUID 4 string which uniquely identifies the withdraw. "8pe4c334-023f-6649-8b94-844boped7069"
amount Int The total monetary amount of the transaction. 100000
target String The IBAN of the destination account for the funds transfer. "IR123456789101234567891001"
target_owner String The name of the owner of the target account. "test"
target_bank_id Int A unique numeric code identifying the target bank. 7
description String A description or note associated with the transaction. "test"
created_at String (ISO-8601 Date) The date and time when the transaction was created. "2024-03-11T21:42:52.693000Z"
receipt_link String A URL link to the receipt or confirmation document for this transaction. "https://settlement.toman.ir/receipt/swap/withdraws/:"
withdraws List A list of withdrawal transactions related to this main transaction. Each item in the list includes detailed information about the withdrawal. -
state Int Represents the current status of the withdrawal. 1
uuid String A UUID that uniquely identifies the withdrawal transaction. "ff06d268-9llb-1234-8456-clkjfprec18"
withdraw_method Int Specifies the method used for the withdrawal. 0
tracker_id String A unique identifier for each withdrawal, intended for reference and internal follow-up purposes. Note "20241123074540240076"
settlement_bank_followup_code String A code used by the settlement bank to follow up on this withdrawal. May be null if not yet available.
settlement_receipt_link String A URL link to the settlement receipt for the withdrawal. May be null if not yet available.
settled_at String (ISO-8601 Date) The date and time when the withdrawal was settled. May be null if settlement is pending.
fee Int The transaction fee for this specific withdrawal. 10000
is_cancelable Boolean Indicates whether this transaction can be canceled. If true, the transaction is cancelable false
created_by String (ISO-8601 Date) Indicates who created the transaction. "تست تستی"

Withdraw States

State Code
Disapproved -4
Requires_Admin_Approval -3
Cancelled -2
Reverted -1
Created 0
On_Progress 1
Done 2

Withdraw Method

Method Code
PAYA 0
A2A 1
SATNA 2

Response Data Example

{
        "uuid": "51497258-8c97-ddl6-9608-a2b15d8672bb",
        "amount": 12345,
        "target": "IR800000100000000321234295",
        "target_owner": "test",
        "target_bank_id": 6,
        "created_at": "2024-10-27T08:19:32.251742Z",
        "description": "تست",
        "receipt_link": "https://settlement.toman.ir/receipt/swap/withdraws/51497f73-8c97-4c76-9608-a2b15d8672bb:4c7b6c829fe40e3c1e6ef6d08d74923706e85995ae91ec2b55237f31d94afd53",
        "withdraws": [
            {
                "uuid": "ff06d268-9afb-1234-83ef-clkjfec5c18",
                "amount": 12345,
                "target": "IR840000000000000321234295",
                "description": "تست ",
                "state": 0,
                "withdraw_method": 0,
                "tracker_id": "202410270819320992375481",
                "created_at": "2024-10-27T08:19:32.331771Z",
                "settlement_bank_followup_code": null,
                "settlement_receipt_link": null,
                "settled_at": null,
                "fee": 5000.0
            }
        ],
        "created_by": "USER",
        "withdraw_method": 0,
        "fee": 5000.0,
        "is_cancelable": true
}

Errors

Code Description
too_many_withdrawal_requests You cannot create more than one withdraw request with the same tracker_id.
invalid_withdraw_request_tracker_id You are submitting a withdraw request with an invalid tracker_id.

Deposits

Request Scope
POST /deposits/ -

Sample Code

import json

import requests

url = f"{base_url}/deposits/"

payload = json.dumps(
    {
        "amount":12345,
        "paid_at":"2024-10-27T07:55:23.064Z",
        "destination_bank_account":7,
        "trace_number":"12345"
    }
)

headers = {
    "Authorization": f"Bearer {token}",
    "Content-Type": "application/json"
}

requests.request("POST", url, headers=headers, data=payload)
curl "$BASE_URL/withdraws/" \
--header "Authorization: Bearer $TOKEN"\
--header "Content-Type: application/json" \
--data-raw '{
    "amount":12345,
    "paid_at":"2024-10-27T07:55:23.064Z",
    "destination_bank_account":7,
    "trace_number":"12345"
}'

Request Body

Parameter Type Description Example
amount Int The monetary amount to be transferred in the transaction. 12345
destination_bank_account Int An identifier for the destination bank account, typically represented by a unique numeric code associated with the bank. 7
paid_at String (ISO-8601 Date) The date and time when the payment was made. "2024-10-27T07:55:23.064Z"
trace_number String A tracking number for the transaction, used for identification and reference purposes. "12345"

Response Body

Parameter Type Description Example
uuid String A UUID 4 string which uniquely identifies the withdraw. "8pe4c334-023f-6649-8b94-844boped7069"
amount Int The amount involved in the transaction in a specific currency. 100000
description String A note or description for the transaction. "IR123456789101234567891001"
type String Represents the type of transaction, with each integer value corresponding to a specific transaction category. "test"
paid_at String (ISO-8601 Date) The date and time when the payment was made "2024-10-27T07:55:23.064000Z"
applied_at String (ISO-8601 Date) The date and time when the transaction was applied, which may be null if not yet applied. "2024-10-27T07:55:23.064000Z"
trace_number String A unique tracking number for the transaction, used for identification and reference. "12345"
state Int Indicates the current state of the system deposit, with each integer value representing a specific state. 0
systemdeposit Object An object containing details about the system deposit associated with this transaction. -
piddeposit Object Contains details about a specific type of deposit, which may be null if not applicable to this transaction. -
autodeposit Object Contains details about an automatic deposit, which may be null if not applicable to this transaction. -
fee Int The transaction fee amount, applied to this transaction. 10000
created_at String (ISO-8601 Date) The date and time when the transaction was created "2024-10-27T08:53:13.559877Z"
updated_at String (ISO-8601 Date) The date and time when the transaction was last updated "2024-10-27T08:53:13.559877Z"

Deposite States

State Code
Canceled -2
Rejected -1
Created 0
Submitted 1
Applied 2

Deposite Type

Type Code
System 1
PID 2
Auto-Deposit 3

Response Data Example

{
    "amount": 12345,
    "description": null,
    "type": 1,
    "paid_at": "2024-10-27T07:55:23.064000Z",
    "applied_at": null,
    "trace_number": "12345",
    "systemdeposit": {
          "state": 0
    },
    "piddeposit": null,
    "autodeposit": null,
    "fee": 10000.0,
    "uuid": "dcb04210-lall-4b37-2569-91ca80d5985f",
    "created_at": "2024-10-27T08:53:13.559772Z",
    "updated_at": "2024-10-27T08:53:13.559877Z"
}