Edit customer
Put
bash
https://api.bunce.so/v1/customers/bulk-update
Update multipe customer records.
Request
Route Parameters email
Body Parameters required
email string<email> not required | Customer's email address. Will only be updated if existing customer's email is invalid |
customer_id string not required | Customer's email address |
first_name string not required | Customer's first name |
last_name string not required | Customer's last name |
phone_no string not required | Customer's phone number |
devices array<{ device_type: string; device_token: string; }> nullable | Customer's devices |
Devices Field
The devices
field is an optional array of device objects. Each device object should contain the following fields:
device_type
(string): The type of device (e.g.,ios
,android
).device_token
(string): The token associated with the device.
Example:
json
{
"devices": [
{
"device_type": "ios",
"device_token": "128867234876234772343456"
},
{
"device_type": "android",
"device_token": "654982938462938423984297321"
}
]
}
bash
curl --request PUT \
--url https://api.bunce.so/v1/customers/bulk-update \
--header 'Content-Type: application/json' \
--header 'X-Authorization: sk_live_************************' \
--data '{
"customers" : [
{
"first_name": "Richard-Updated",
"last_name": "Mophy-Edited",
"phone_no": "+2348106420637",
"email" : "new-email@bunce.so",
"customer_id": "01JMKK8N0CJ0TTCX292P3JJCWT",
"devices": [
{
"device_type": "ios",
"device_token": "123456"
},
{
"device_type": "android",
"device_token": "654321"
}
]
},
{
"first_name": "Ekpo Edited",
"last_name": "Mica Updated",
"phone_no": "+2348106420637",
"email": "fake-email@gmail",
"customer_id": "01JMKK8N0CJ0TTCX292P3JJCW890"
},
{
"customer_id": "01JMJ38J3DY08M2FQ6HTCX1BX4",
"first_name": "john Edited",
"last_name": "luke Edited",
"email": "john.3@gmail.com",
"phone_no": "+2348106420633"
}
]
}'
go
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
url := "https://api.bunce.so/v1/customers/bulk-update"
payload := strings.NewReader("{\n \"customers\": [\n {\n \"first_name\": \"Richard-Updated\",\n \"last_name\": \"Mophy-Edited\",\n \"phone_no\": \"+2348106420637\",\n \"email\": \"new-email@bunce.so\",\n \"customer_id\": \"01JMKK8N0CJ0TTCX292P3JJCWT\"\n },\n {\n \"first_name\": \"Ekpo Edited\",\n \"last_name\": \"Mica Updated\",\n \"phone_no\": \"+2348106420637\",\n \"email\": \"fake-email@gmail\",\n \"customer_id\": \"01JMKK8N0CJ0TTCX292P3JJCW890\"\n },\n {\n \"customer_id\": \"01JMJ38J3DY08M2FQ6HTCX1BX4\",\n \"first_name\": \"john Edited\",\n \"last_name\": \"luke Edited\",\n \"email\": \"john.3@gmail.com\",\n \"phone_no\": \"+2348106420633\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Authorization", "sk_live_************************")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
js
import from 'node-fetch'
let = `https://api.bunce.so/v1/customers/bulk-update`
let = {
: 'PUT',
: {
'X-Authorization': 'sk_live_************************',
'Content-Type': 'application/json',
},
: '{"first_name":"John","last_name":"Doe","email":"johndoe@example.com","phone_no":"+23481999999999"}',
}
(, )
.then(() => .json())
.then(() => .())
.catch(() => .('error:' + ))
php
<?php
$client = new http\Client;
$request = new http\Client\Request;
$body = new http\Message\Body;
$body->append('{
"customers" : [
{
"first_name": "Richard-Updated",
"last_name": "Mophy-Edited",
"phone_no": "+2348106420637",
"email" : "new-email@bunce.so",
"customer_id": "01JMKK8N0CJ0TTCX292P3JJCWT",
"devices": [
{
"device_type": "ios",
"device_token": "123456"
},
{
"device_type": "android",
"device_token": "654321"
}
]
},
{
"first_name": "Ekpo Edited",
"last_name": "Mica Updated",
"phone_no": "+2348106420637",
"email": "fake-email@gmail",
"customer_id": "01JMKK8N0CJ0TTCX292P3JJCW890"
},
{
"customer_id": "01JMJ38J3DY08M2FQ6HTCX1BX4",
"first_name": "john Edited",
"last_name": "luke Edited",
"email": "john.3@gmail.com",
"phone_no": "+2348106420633"
}
]
}');
$request->setRequestUrl('https://api.bunce.so/v1/customers/bulk-update');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'X-Authorization' => 'sk_live_************************',
'Content-Type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
java
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.bunce.so/v1/customers/bulk-update"))
.header("X-Authorization", "sk_live_************************")
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"customers\": [\n {\n \"first_name\": \"Richard-Updated\",\n \"last_name\": \"Mophy-Edited\",\n \"phone_no\": \"+2348106420637\",\n \"email\": \"new-email@bunce.so\",\n \"customer_id\": \"01JMKK8N0CJ0TTCX292P3JJCWT\"\n },\n {\n \"first_name\": \"Ekpo Edited\",\n \"last_name\": \"Mica Updated\",\n \"phone_no\": \"+2348106420637\",\n \"email\": \"fake-email@gmail\",\n \"customer_id\": \"01JMKK8N0CJ0TTCX292P3JJCW890\"\n },\n {\n \"customer_id\": \"01JMJ38J3DY08M2FQ6HTCX1BX4\",\n \"first_name\": \"john Edited\",\n \"last_name\": \"luke Edited\",\n \"email\": \"john.3@gmail.com\",\n \"phone_no\": \"+2348106420633\"\n }\n ]\n}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Response
json
{
"success": true,
"data": [
{
"customer_id": "ABDUL",
"first_name": null,
"last_name": null,
"email": "validemail@gmail.com",
"phone_no": "+2347067039293",
"customer_created_at": "2025-07-25T11:38:13.000000Z"
},
{
"customer_id": "BUN-01K10NEEMBBEG5CWAH46G6ZZT6",
"first_name": null,
"last_name": null,
"email": "new-messaging-email@gmail.com",
"phone_no": "+2349099558795",
"customer_created_at": "2025-07-25T11:28:12.000000Z"
}
],
"message": "Customers updated successfully"
}