Developer
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

required

application/json

Responses

201 Transaction created successfully
application/json
statusstring
Example: success
messagestring
Example: Transaction created successfully
dataobject
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/json
Example:
{
  "status": "error",
  "message": "Not authenticated or insufficient permissions"
}
404 Merchant or Affiliate not found
application/json
500 Internal server error
application/json
statusstring
Example: error
messagestring
Example: Failed to create transaction
errorstring
Example: Database connection failed