Skip to main content
POST
/
api
/
v1
/
events
/
purchase
curl --request POST \
  --url https://app.mlm-platform.com/api/v1/events/purchase \
  --header 'Content-Type: application/json' \
  --header 'x-tenant-api-key: <api-key>' \
  --data '
{
  "user_id": "550e8400-e29b-41d4-a716-446655440000",
  "amount": 99.99,
  "currency": "USD"
}
'
{
"message": "<string>",
"ledgerPayload": {
"tenantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"originalAmount": 123,
"originalCurrency": "<string>",
"baseCurrency": "<string>",
"convertedAmount": 123,
"fxRate": 123,
"metadata": {},
"commissionsGenerated": 1
},
"idempotency_key": "<string>"
}

Authorizations

x-tenant-api-key
string
header
required

Tenant API key for authentication. Keys are scoped to specific environments (LIVE or SANDBOX). Obtain keys from the admin dashboard.

Headers

Idempotency-Key
string

Optional idempotency key to safely retry the same purchase event. Use a stable identifier (for example an order ID) to prevent duplicate commission creation.

Maximum string length: 255

Body

application/json
user_id
string<uuid>
required

The buyer's user ID

amount
number<double>
required

Purchase amount in the specified currency

Required range: x >= 0.01
currency
string

ISO 4217 currency code. If omitted, the tenant base currency is used.

provider_transaction_id
string

Optional upstream payment provider transaction identifier (for audit/reconciliation)

metadata
object

Additional metadata to store with the event and downstream commission ledger entries

Response

Purchase event accepted

Response returned when a purchase event is accepted for processing.

message
string
required

Human-readable status message

ledgerPayload
object
required
idempotency_key
string | null

Echoed idempotency key if one was provided via the Idempotency-Key header