PUT /merchants/{id}/transactions/{transaction_id}

Update transaction item statuses

Merchants

Description

Update the status of items in an existing transaction for a specific merchant.

Authentication Required: User must be authenticated and have the 'merchant' feature flag.

Authorization: Merchant users can only update transactions for their own merchant account.

Important: Only the status field of basket items can be updated. You cannot add, remove, or modify other item properties (ean, name, price, quantity, commissionrate). The basketitems array must contain the same number of items as the original transaction. Commission is only calculated for items with status "accepted".

Parameters

id integer path required
Merchant ID
transaction_id integer path required
Transaction ID

Request Body

required

application/json

basket_itemsarray [object]required
Array of items with updated statuses. Must contain the same number of items as the original transaction. Only the status field will be updated - all other fields are ignored.
Example: [{"status":"accepted"},{"status":"accepted"}]
statusstringenum: pending, accepted, rejected
Updated item status. This is the only field that can be modified.
Example: accepted

Responses

200 Transaction updated successfully
application/json
statusstring
Example: success
messagestring
Example: Transaction updated successfully
dataobject
Example:
{
  "status": "success",
  "message": "Transaction updated successfully",
  "data": {
    "id": "8MIZ2XUMFV7",
    "tracking_id": "3B01WYNUGO1R4G20",
    "basket_price": 129.99,
    "affiliate_id": 42,
    "basket_items": [
      {
        "id": 1,
        "name": "Laptop Stand",
        "ean": "1234567890123",
        "price": 49.99,
        "quantity": 2,
        "commission_rate": 10.0,
        "status": "accepted"
      },
      {
        "id": 2,
        "name": "Wireless Mouse",
        "ean": "9876543210987",
        "price": 80.0,
        "quantity": 1,
        "commission_rate": 12.5,
        "status": "accepted"
      }
    ],
    "status": "accepted",
    "total_commission": 20.0,
    "reward": "pending",
    "created_at": "2024-01-15T14:30:00Z",
    "updated_at": "2024-01-15T16:45: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 Transaction not found
application/json
500 Internal server error
application/json
statusstring
Example: error
messagestring
Example: Failed to update transaction
errorstring
Example: Database connection failed