Skip to content

Winners

Endpoints for querying prizes and draws.

List Winners

GET /api/awardeds

Returns a paginated list of winners with filtering options by date range and specific prizes. This endpoint provides access to loyalty program prizes and winning records with company and client information.

Use cases:

  • Check promotion winners
  • Export winners list
  • Integrate with prize delivery system

Query Parameters

ParameterTypeRequiredDescription
date_startstringYesStart date to filter records (YYYY-MM-DD)
date_endstringYesEnd date to filter records (YYYY-MM-DD)
limitintegerYesNumber of records per request
offsetintegerYesNumber of records to skip (min 0)
awardeds_idarrayNoSpecific prize IDs to filter (UUIDs)

Request Example

bash
curl -X GET "https://api-b2s.experienciab2s.com/api/awardeds?date_start=2024-01-01&date_end=2024-12-31&limit=50&offset=0" \
     -H "Authorization: Bearer YOUR_TOKEN"

Success Response (200)

json
{
  "total": 125,
  "limit": 50,
  "offset": 0,
  "data": [
    {
      "id": "abc123e4-56f7-89ab-cdef-123456789abc",
      "created_at": "2024-04-15T10:30:00.000Z",
      "awarded": {
        "id": "def456g7-89hi-01jk-lmno-456789012def",
        "name": "Monthly Premium Draw"
      },
      "client": {
        "id": "ghi789j0-12kl-34mn-opqr-789012345ghi",
        "name": "Maria Silva",
        "email": "maria.silva@example.com",
        "phone": "(11) 99999-9999",
        "born_date": "1985-03-15T00:00:00.000Z"
      },
      "company": {
        "id": "jkl012m3-45no-67pq-rstu-012345678jkl",
        "name": "Good Flavor Restaurant"
      }
    },
    {
      "id": "mno345p6-78qr-90st-uvwx-345678901mno",
      "created_at": "2024-04-14T14:20:00.000Z",
      "awarded": {
        "id": "pqr678s9-01tu-23vw-xyza-678901234pqr",
        "name": "Weekly Cashback"
      },
      "client": {
        "id": "stu901v2-34wx-56yz-abcd-901234567stu",
        "name": "John Santos",
        "email": "john.santos@example.com",
        "phone": null,
        "born_date": null
      },
      "company": {
        "id": "vwx234y5-67za-89bc-defg-234567890vwx",
        "name": "Tech Electronics Store"
      }
    }
  ]
}

Response Structure

FieldTypeDescription
totalintegerTotal available records
limitintegerLimit per page
offsetintegerCurrent offset
dataarrayList of winners

Winner Structure

FieldTypeDescription
idstringUnique record ID
created_atstringCreation date
awarded.idstringPrize ID
awarded.namestringPrize name
client.idstringClient ID
client.namestringClient name
client.emailstringClient email
client.phonestringClient phone
client.born_datestringBirth date
company.idstringCompany ID
company.namestringCompany name

Response Codes

CodeDescription
200Winners found
403Invalid token or unauthorized user
404Integration token not found

Integration Documentation