Take money back from a user
Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.
Moves money from the user's wallet back to yours: at most what you sent them (minus what you already took back) and at most what they hold. Money the user topped up themselves stays theirs. The idempotency key works as for transfers.
Path parameters
- idintegerrequiredpath
The id of one of your users.
Request body
Content type: application/json · required
- amount_rialsinteger (int64)required
- idempotency_keystringrequired
Unique per movement; reuse only to retry the same one.
Responses
200Done (or done before, with already_applied).
Content type: application/json
- amount_rialsinteger (int64)
- reseller_balance_rialsinteger (int64)
- account_balance_rialsinteger (int64)
- reclaimable_rialsinteger (int64)
What you could take back from this user now.
- already_appliedboolean
This key was used before; nothing moved this time.
{
"amount_rials": 0,
"reseller_balance_rials": 0,
"account_balance_rials": 0,
"reclaimable_rials": 0,
"already_applied": true
}400amount_rials is not positive, or idempotency_key is missing or longer than 64 characters.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}401Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "invalid API key"
}403The key is read-only and this endpoint is a write. Read-only keys may
only issue GET, HEAD and OPTIONS.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}404No user with this id among yours.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "user not found"
}409More than you can take back, or the idempotency key was used for a different request.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}Example request
curl -X POST "https://api.nsin.ir/reseller/v1/users/0/wallet/reclaim" \
-H "Authorization: Bearer $NSIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount_rials": 0,
"idempotency_key": "string"
}'