Update a fulfillment user
PUT /v2/fulfillment/users/{user_id}
Updates a fulfillment user by its user_id, which is the same value your application provided in create user or create user and validate an address. Omitted or empty fields preserve the existing values.
Security
| Name | In | Description |
|---|---|---|
Authorization | header | The Authorization header with the bearer token acquired during authentication. |
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user_id | path | string | The external ID of the user to update (as provided when the user was created). |
Request
| Field | Type | Required | Description |
|---|---|---|---|
first_name | string | New first name for the user. Omitted or empty preserves the existing value. | |
last_name | string | New last name for the user. Omitted or empty preserves the existing value. | |
phone_number | string | New phone number for the user. Omitted or empty preserves the existing value. |
Request examples
- cURL
- Java
- Python
- Go
- Node.js
curl --request PUT \
--url 'https://connect.instacart.com/v2/fulfillment/users/{user_id}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"first_name": "string",
"last_name": "string",
"phone_number": "string"
}'
HttpResponse<String> response = Unirest.put("https://connect.instacart.com/v2/fulfillment/users/{user_id}")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer <token>")
.body("{\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"phone_number\": \"string\"\n}")
.asString();
import http.client
conn = http.client.HTTPSConnection("connect.instacart.com")
payload = "{\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"phone_number\": \"string\"\n}"
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'Authorization': "Bearer <token>"
}
conn.request("PUT", "/v2/fulfillment/users/{user_id}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://connect.instacart.com/v2/fulfillment/users/{user_id}"
payload := strings.NewReader("{\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"phone_number\": \"string\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require('https');
const options = {
method: 'PUT',
hostname: 'connect.instacart.com',
port: null,
path: '/v2/fulfillment/users/{user_id}',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer <token>'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({first_name: 'string', last_name: 'string', phone_number: 'string'}));
req.end();
Response
| Field | Type | Required | Description |
|---|---|---|---|
first_name | string | The user's first name. | |
last_name | string | The user's last name. | |
phone_number | string | The user's phone number. |
Response examples
200 Success
200User updated
{
"first_name": "Jane",
"last_name": "Doe",
"phone_number": "+15551234567"
}
4XX Errors
Error responses return either a single error or multiple errors.
| HTTP Code | Cause | Error Message | Error Code | Error Meta |
|---|---|---|---|---|
400 | userNotFound | "User Not Found" | 1001 | Not applicable |
400 | invalidFirstName | "First name is invalid" | 1001 | Not applicable |
400 | invalidPhone | "Phone is invalid" | 1001 | Not applicable |
403 | userNotActive | "User Not Active" | | Not applicable |