Skip to content

Reseller ​

The reseller feature lets a merchant (the reseller) create checkouts on behalf of other merchants using its own API key. When the payment is collected, the proceeds are split: the target merchant receives amount − reseller_fee − platform_fee, the reseller earns reseller_fee, and DPT retains platform_fee.

This is useful for platforms, marketplaces, and aggregators that process payments for sub-merchants.


How It Works ​

  1. Reseller creates a connection to the target merchant via POST /v1/reseller/connections, setting their commission rate and optional min_fee / max_fee
  2. The connection is immediately active — no approval needed from the target merchant
  3. Reseller creates checkouts by passing merchant_id in the request — DPT verifies the active connection
  4. When payment arrives, DPT splits the funds:
    • gross = amount × rate / 10000, clamped to [min_fee, max_fee] if set
    • platform_fee = amount × platform_rate / 10000 → DPT's direct cut of the transaction
    • reseller_fee = gross − platform_fee → what the reseller actually receives
    • merchant_net = amount − gross → credited to the target merchant
  5. A checkout.completed webhook is sent to the target merchant's registered endpoint, including reseller_fee, platform_fee, and reseller_id
  6. The target merchant can revoke the connection at any time via dashboard or API — the reseller immediately loses access

Commission Rate ​

The commission rate is expressed in basis points (bps), where 10000 bps = 100%.

rateCommission
00% (no fee)
1001%
2002%
5005%
10000100%

The rate is set on the connection and applies to all checkouts created through it. You can update it at any time via PUT /v1/reseller/connections/{id}. There is no per-checkout rate override.

Fee Caps (optional) ​

Set min_fee and/or max_fee (in 6dp units, same as all other amounts in the API) to cap the commission:

  • min_fee — fee is at least this amount (floor). e.g. always charge at least $1.00 = 1000000
  • max_fee — fee is at most this amount (ceiling). e.g. never charge more than $50.00 = 50000000

When both are set: fee = clamp(amount × rate / 10000, min_fee, max_fee)


Connection Lifecycle ​

reseller                              merchant
   |                                      |
   |-- POST /v1/reseller/connections -->  |  (status: active)
   |                                      |
   |-- PUT /v1/reseller/connections/{id}->|  (update rate / fee caps)
   |                                      |
   |-- POST /v1/checkouts (merchant_id) ->|  ✓ active connection required
   |                                      |
   |-- DELETE /v1/reseller/connections/{id}  (reseller removes)
   |                                      |
   |   DELETE ...reseller-connections/{id} --|  (merchant revokes → status: revoked)

Connection Object ​

json
{
  "id": "uuid",
  "reseller_id": "uuid",
  "merchant_id": "uuid",
  "status": "active | revoked",
  "rate": 200,
  "min_fee": null,
  "max_fee": 50000000,
  "created_at": "2026-03-26T10:00:00Z",
  "updated_at": "2026-03-26T10:00:00Z"
}

Reseller: Create or Update a Connection ​

http
POST /v1/reseller/connections
FieldTypeRequiredDescription
merchant_iduuid✓UUID of the merchant you want to resell for
rateinteger✓Commission in basis points (0–10000)
min_feeinteger—Minimum fee per transaction in 6dp (e.g. 1000000 = $1.00). Omit for no floor.
max_feeinteger—Maximum fee per transaction in 6dp (e.g. 50000000 = $50.00). Omit for no ceiling.

Idempotent — if a connection to the same merchant already exists, it is updated with the new values and reactivated.

bash
curl -X POST https://api-test.dpt.xyz/v1/reseller/connections \
  -H "Authorization: Bearer dptb_..." \
  -H "Content-Type: application/json" \
  -d '{
    "merchant_id": "TARGET_MERCHANT_UUID",
    "rate": 200,
    "min_fee": 1000000,
    "max_fee": 50000000
  }'

Reseller: Update a Connection ​

http
PUT /v1/reseller/connections/{connection_id}

Update the commission rate and/or fee caps on an existing connection by ID. Only the reseller can call this endpoint.

FieldTypeRequiredDescription
rateinteger✓New commission rate in basis points (0–10000)
min_feeinteger—New minimum fee per transaction in 6dp. Pass null to remove the floor.
max_feeinteger—New maximum fee per transaction in 6dp. Pass null to remove the ceiling.

The update takes effect immediately — the new rate applies to all checkouts created after the call. In-flight checkouts are unaffected.

bash
curl -X PUT https://api-test.dpt.xyz/v1/reseller/connections/CONN_ID \
  -H "Authorization: Bearer dptb_..." \
  -H "Content-Type: application/json" \
  -d '{
    "rate": 300,
    "min_fee": 1000000,
    "max_fee": null
  }'

Returns the updated connection object.


Reseller: List Outgoing Connections ​

http
GET /v1/reseller/connections

Returns all outgoing connections for the authenticated reseller (all statuses).


Reseller: Delete a Connection ​

http
DELETE /v1/reseller/connections/{connection_id}

Permanently removes the connection. The reseller can no longer create checkouts for that merchant.

bash
curl -X DELETE https://api-test.dpt.xyz/v1/reseller/connections/CONN_ID \
  -H "Authorization: Bearer dptb_..."

Merchant: List Incoming Connections ​

http
GET /v1/merchants/{id}/reseller-connections/incoming

Returns all connections where this merchant is the target. Includes both active and revoked connections.

bash
curl https://api-test.dpt.xyz/v1/merchants/YOUR_ID/reseller-connections/incoming \
  -H "Authorization: Bearer dptb_..."

Also available in the dashboard at Settings → Resellers.


Merchant: Revoke a Connection ​

http
DELETE /v1/merchants/{id}/reseller-connections/{connection_id}

Sets status to revoked. The reseller immediately loses the ability to create checkouts for your account. The record is retained for audit purposes.

bash
curl -X DELETE https://api-test.dpt.xyz/v1/merchants/YOUR_ID/reseller-connections/CONN_ID \
  -H "Authorization: Bearer dptb_..."

Note: Both the reseller (DELETE /v1/reseller/connections/{id}) and the merchant (DELETE /v1/merchants/{id}/reseller-connections/{id}) can remove a connection. The reseller's delete permanently removes the record; the merchant's delete sets it to revoked for audit purposes.


Creating a Checkout as a Reseller ​

Add merchant_id (target merchant) to the standard Create Checkout request. The commission rate is taken from the connection.

bash
curl -X POST https://api-test.dpt.xyz/v1/checkouts \
  -H "Authorization: Bearer dptb_YOUR_RESELLER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "merchant_id": "TARGET_MERCHANT_UUID",
    "title": "Order #5678",
    "amount": 50000000,
    "currency": "USDC"
  }'

The checkout is created under the target merchant. The reseller earns their connection rate when this checkout is paid.


Provision a Merchant (Reseller) ​

http
POST /v1/reseller/provision

Create a DPT user account, a merchant, and a reseller connection in a single call. Use this when your platform is onboarding a new sub-merchant and you want to handle the entire signup flow server-side without requiring the end user to go through the standard registration.

Production only. User accounts are shared across test and production — there is no separate test registry. Calling this endpoint creates a real Firebase account and a real DPT user. Always use https://api.dpt.xyz for this endpoint; api-test.dpt.xyz is not supported.

KYB required. The reseller merchant calling this endpoint must have a kyb_status of approved. Calls from merchants that have not completed KYB verification will be rejected with 403.

Request body ​

User fields

FieldTypeRequiredDescription
emailstring✓Email address for the new user account
passwordstring✓Initial password (min 6 characters)
full_namestring—User's display name

Merchant fields

FieldTypeRequiredDescription
merchant_namestring✓Public-facing merchant / brand name
legal_namestring✓Legal entity name
countrystring✓ISO 3166-1 alpha-2 country code (e.g. "US")
btypestring—"company" (default) or "individual"
websitestring—Merchant website URL

Reseller connection fields

FieldTypeRequiredDescription
rateinteger✓Commission in basis points (0–10000). See Commission Rate
min_feeinteger—Minimum fee per transaction in 6dp. Omit for no floor
max_feeinteger—Maximum fee per transaction in 6dp. Omit for no ceiling

Response ​

json
{
  "user_id": "uuid",
  "merchant": {
    "id": "uuid",
    "name": "Acme Corp",
    "legal_name": "Acme Corporation Ltd",
    "country": "US",
    "btype": "company",
    "kyb_status": "draft",
    "created_at": "2026-04-28T10:00:00Z"
  },
  "connection_id": "uuid"
}
FieldDescription
user_idUUID of the newly created DPT user
merchantFull merchant object for the newly created merchant
connection_idUUID of the reseller connection (active immediately)

Example ​

bash
curl -X POST https://api.dpt.xyz/v1/reseller/provision \
  -H "Authorization: Bearer dptb_YOUR_RESELLER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "s3cr3tPass",
    "full_name": "Alice Smith",
    "merchant_name": "Acme Corp",
    "legal_name": "Acme Corporation Ltd",
    "country": "US",
    "btype": "company",
    "rate": 200,
    "min_fee": 1000000,
    "max_fee": 50000000
  }'

Error cases ​

HTTPReason
400Missing required fields, invalid country code, password too short
409Email already registered
403Reseller KYB not approved

Finding Your Merchant ID ​

Your merchant ID is available in:

  • Dashboard → Overview — shown in the top-right of the page header (click to copy)
  • Dashboard → Settings → General — shown in the General section (click to copy)

Webhook Fields ​

When a reseller checkout is settled, the checkout.completed webhook includes additional fields:

FieldDescription
reseller_feeAmount credited to the reseller (gross − platform_fee)
platform_feeDPT's direct cut (amount × platform_rate / 10000). 0 if platform rate is not set
reseller_idUUID of the reseller merchant

Merchant net = amount − gross (= amount − reseller_fee − platform_fee).

See Webhooks — checkout.completed for the full payload example.

DPT Merchant API