POST
/merchants/{id}/transactions
Create a new transaction
Merchants
Description
Create a new transaction for a specific merchant.
Authentication Required: User must be authenticated and have the 'merchant' feature flag.
Authorization: Merchant users can only create transactions for their own merchant account.
Parameters
id
integer
path
required
Merchant ID
Request Body
requiredapplication/json
Responses
201
Transaction created successfully
application/jsonstatusstring
Example:
successmessagestring
Example:
Transaction created successfullydataobject
Example:
{
"status": "success",
"message": "Transaction created successfully",
"data": {
"id": 45,
"redirect_id": 1,
"basket_price": 129.99,
"affiliate": {
"id": 42,
"name": "Partner Corp"
},
"status": "pending",
"total_commission": 15.0,
"reward": "pending",
"created_at": "2024-12-01T10:00:00Z",
"updated_at": "2024-12-01T10:00:00Z"
}
}
400
Bad request - missing or invalid parameters
application/json
401
Authentication required
application/jsonExample:
{
"status": "error",
"message": "Not authenticated or insufficient permissions"
}
404
Merchant or Affiliate not found
application/json
500
Internal server error
application/jsonstatusstring
Example:
errormessagestring
Example:
Failed to create transactionerrorstring
Example:
Database connection failed