Gameball Developers Guide
v4.0
v4.0
  • Introduction
  • Installing Gameball
    • Web
      • Initialize Gameball Customer Widget
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Go-Live Checklist
    • iOS
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Push Notifications
      • Track Referrals
      • Go-Live Checklist
    • Android
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Push Notifications
      • Go-Live Checklist
    • React Native
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
      • Go-Live Checklist
    • Flutter
      • Getting Started
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Go-Live Checklist
    • Generic Mobile App
      • Initialize Gameball Customer Profile
      • Track Customer Events
      • Track Orders & Cashback Reward
      • Integrate Redemption
      • Track Referrals
      • Push Notifications
  • REST API
    • Overview
      • What's New in V4.0
      • Authentication
      • Rate Limiting
      • Status and Error Codes
    • Customers
      • Customer Management
      • Customer Progress
      • Customer Tags
      • Customer Notifications
    • Events
    • Order
      • Order Tracking
      • Order Rewards & History
    • Payment
      • Payment Tracking
    • Transactions
      • Cashback & Redemptions
      • Hold Management
      • Transaction Management
      • Transaction Validation
    • Coupons
    • Configurations
      • Reward Configurations
      • Program Configurations
      • Widget Configuration
    • Leaderboard
    • Batches
      • Batch Creation
      • Batch Management
  • Webhooks
    • Overview
    • Subscribing to Webhooks
    • Webhook Topics
      • Customer's Notifications
      • Customer's Profile Updates
  • Tutorials
    • Tracking Customer Events
    • Redemption Integration
      • Direct debit redemption
      • Coupons Redemption
        • Use Your Own Couponing Engine
        • Gameball Couponing Engine
    • Checkout Integration
    • Build Custom UI Elements
      • Reward Campaigns
      • VIP Tiers
      • Customer Balance
      • Widget Configurations
      • Coupons Customer Experience
      • Customer Notifications
      • Customer Leaderboard
    • Build your Own Notification System
    • Channel Merging Guide
    • Previewing Potential Points Before Purchase
    • Refund
    • Retail & POS Integration with Gameball Loyalty Program
    • Referrals
    • Widget Deep Links
    • Batch APIs usage example
  • Branch.io Integration
  • Adjust Integration
Powered by GitBook
On this page
  • Batch Customer API Tutorial
  • Overview
  • 1. Create a Job request
  • Endpoint URL
  • Authentication
  • Request Structure
  • 2. Get the Job status
  • Endpoint URL
  • Authentication
  • 3. Stop the running Job
  • Endpoint URL
  • Authentication
  1. Tutorials

Batch APIs usage example

The Batch Customer API allows you to create or update multiple customer profiles in a single request, optimizing performance and reducing network overhead. This is particularly useful for bulk user imports, mass profile updates, and large-scale customer data synchronization.​

Batch Customer API Tutorial

Overview

The Batch Customer API enables bulk creation or updates of customer profiles in a single request, optimizing performance and reducing API calls. This is useful for mass data synchronization, bulk user imports, and automated customer profile management.

Not

This example applies to all types of batch processes, ensuring consistency in handling bulk operations across different endpoints.

1. Create a Job request

Endpoint URL

POSThttps://api.gameball.co/api/v4/integrations/batch/customers

This endpoint processes multiple customer records in one request.

Authentication

Include your API key in the request headers:

ApiKey: YOUR_API_KEY
SecretKey: YOUR_SECRET_KEY
Content-Type: application/json  

Request Structure

The request body must contain an array of customer objects, each with relevant attributes.

Example Request

{
    "body": [
        {
            "customerId": "12345",
            "email": "john.doe@example.com",
            "name": "John Doe",
            "gender": "M",
            "dateOfBirth": "1990-01-01",
            "joinDate": "2022-01-01",
            "tags": [
                "vip",
                "newsletter_subscriber"
            ],
            "custom": {
                "favorite_color": "blue",
                "loyalty_points": 1500
            }
        },
        {
            "customerId": "67890",
            "email": "jane.smith@example.com",
            "name": "Jane Smith",
            "gender": "F",
            "dateOfBirth": "1985-05-15",
            "joinDate": "2023-03-10",
            "tags": [
                "premium_member"
            ],
            "custom": {
                "favorite_color": "green",
                "loyalty_points": 2000
            }
        }
    ]
}

Response Structure

The response contains the JobId of the created job to check the status for, get the response, or terminate the job.

Example Response

{
    "jobId": 123456
}

2. Get the Job status

Endpoint URL

GEThttps://api.gameball.co/api/v4/integrations/batch/{jobId}

Authentication

Include your API key in the request headers:

ApiKey: YOUR_API_KEY
SecretKey: YOUR_SECRET_KEY
Content-Type: application/json 

Response Structure

Queued
{
  "operation": "Customer Creation Batch Job",
  "errorCount": 0,
  "totalCount": 0,
  "finishedCount": 0,
  "startedAt": null,
  "createdAt": "2025-03-14T10:00:00Z",
  "status": "queued",
  "response": null
}
Running
{
  "operation": "Customer Creation Batch Job",
  "errorCount": 0,
  "totalCount": 1,
  "finishedCount": 1,
  "startedAt": "2025-03-14T10:30:00Z",
  "createdAt": "2025-03-14T10:00:00Z",
  "status": "running",
  "response": {
    "successful": [
      {
        "customerId": "12345",
        "message": "Customer created successfully"
      }
    ],
    "failed": []
  }
}
Completed
{
  "operation": "Customer Creation Batch Job",
  "errorCount": 1,
  "totalCount": 2,
  "finishedCount": 1,
  "startedAt": "2025-03-14T10:00:00Z",
  "createdAt": "2025-03-14T10:00:00Z",
  "status": "completed",
  "response": {
    "successful": [
      {
        "customerId": "12345",
        "message": "Customer created successfully"
      }
    ],
    "failed": [
      {
        "customerId": "67890",
        "error": "Failed to create customer"
      }
    ]
  }
}
Failed
{
  "operation": "Customer Creation Batch Job",
  "errorCount": 2,
  "totalCount": 2,
  "finishedCount": 0,
  "startedAt": null,
  "createdAt": "2025-03-14T10:00:00Z",
  "status": "failed",
  "response": {
    "successful": [],
    "failed": [
    {
        "customerId": "12345",
        "message": "Failed to create customer"
      },
      {
        "customerId": "67890",
        "error": "Failed to create customer"
      }
    ]
  }
}
Stopped
{
  "operation": "Customer Creation Batch Job",
  "errorCount": 0,
  "totalCount": 0,
  "finishedCount": 0,
  "startedAt": null,
  "createdAt": "2025-03-14T10:00:00Z",
  "status": "stopped",
  "response": null
}

3. Stop the running Job

Endpoint URL

DELETEhttps://api.gameball.co/api/v4/integrations/batch/{jobId}

Authentication

Include your API key in the request headers:

ApiKey: YOUR_API_KEY
SecretKey: YOUR_SECRET_KEY
Content-Type: application/json 

Response

200 - Ok: Job stopped successfully

If we go back to step 2 and check the job status, we'd get the following result

{
  "operation": "Customer Creation Batch Job",
  "errorCount": 0,
  "totalCount": 0,
  "finishedCount": 0,
  "startedAt": null,
  "createdAt": "2025-03-14T10:00:00Z",
  "status": "stopped",
  "response": null
}
PreviousWidget Deep LinksNextBranch.io Integration

Last updated 1 month ago