MCP is live.Set upAsk the community
OmniDimension
Reseller credits

Calculate credit operation

Preview the cost of a transfer or revert without moving any credits. Use this to confirm amounts before calling the transfer or revert endpoints. The response shape differs between forward transfers and reverts. See the examples.

Reseller accounts only. Request access.

POST/reseller/credits/calculate
Body
4 fields
·

Number of minutes to calculate for.

Rate per minute for a forward transfer (e.g. 0.20). Not required when is_revert is true.

Set to true to calculate a revert instead of a forward transfer.

curl -X POST 'https://backend.omnidim.io/api/v1/reseller/credits/calculate' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "minutes": 100,
  "cost_per_min": 0.2
}'
Example response
synthetic
{
  "success": false,
  "my_cost": 0,
  "user_credit": 0,
  "profit": 0,
  "margin": 0,
  "reseller_balance": 0,
  "reseller_available_minutes": 0,
  "new_reseller_balance": 0,
  "refund_amount": 0,
  "deduction_amount": 0,
  "child_balance": 0,
  "child_available_minutes": 0,
  "new_child_balance": 0,
  "reseller_rate": 0,
  "currency_symbol": "string"
}

Authorization

BearerAuth
headerAuthorizationBearer <token>

Bearer token authentication. Obtain your API key from the OmniDimension dashboard.

Request Body

application/json
minutes*integer

Number of minutes to calculate for.

cost_per_min?number

Rate per minute for a forward transfer (e.g. 0.20). Not required when is_revert is true.

is_revert?boolean

Set to true to calculate a revert instead of a forward transfer.

Defaultfalse
child_organization_id?integer

ID of the child organization to revert credits from. Required when is_revert is true.

Response body

application/json

Response Body

Calculated outcome.

application/json
success?boolean
my_cost?number

Forward only. Amount deducted from the reseller balance.

user_credit?number

Forward only. Credit value the child receives at cost_per_min.

profit?number

Forward only. user_credit - my_cost.

margin?number

Forward only. Per-minute margin.

reseller_balance?number

Forward only. Current reseller balance before the transfer.

reseller_available_minutes?integer

Forward only. Minutes the reseller could still transfer at its own rate.

new_reseller_balance?number

Forward only. Reseller balance after the proposed transfer.

refund_amount?number

Revert only. Credits added back to the reseller.

deduction_amount?number

Revert only. Credits removed from the child at its current rate.

child_balance?number

Revert only. Child balance before the revert.

child_available_minutes?integer

Revert only. Minutes available in the child's balance.

new_child_balance?number

Revert only. Child balance after the proposed revert.

reseller_rate?number

Reseller's wholesale rate (cost per minute).

currency_symbol?string