» Customer PUT API Documentation

Updating Customer by ID

Endpoint: PUT/admin/customers/{customer_id}

Purpose

This API allows administrators to update customer details, including personal information, addresses, shipping profiles, and credit settings. The /admin/customers/{id} endpoint provides flexibility to modify customer records while ensuring accurate data management.

Path Parameters

ParameterTypeDescription
customer_idIntegerUnique identifier of the customer

Query Parameters

No query parameters for this endpoint.

Use Case

This API is used when an administrator needs to update a customer's details. It enables modifications to key attributes such as name, contact information, company details, and credit settings. Additionally, the customer's address information, shipping profile, and newsletter subscription status can be updated. Businesses can use this endpoint to keep customer records up to date, ensuring smooth order processing and communication.

Request Body

KeyType
Description
first_name
String
Customer's first name
last_name
String
Customer's last name
email
String
Customer's email address
address_line
String
Customer's street address
password
String
Password for customer account login
{
    "customer": {
        "first_name": "CUSTOMER_FIRST_NAME",
        "last_name": "CUSTOMER_LAST_NAME",
        "shipping_profile": "SHIPPING_PROFILE_ID",
        "gender": "CUSTOMER_GENDER",
        "email": "CUSTOMER_EMAIL",
        "company_name": "CUSTOMER_COMPANY_NAME",
        "address_line": "ADDRESS_LINE",
        "country": "COUNTRY_NAME",
        "state": "STATE_NAME",
        "post_code": "POSTAL_CODE",
        "city": "CITY_NAME",
        "mobile": "MOBILE_PHONE",
        "phone": "PHONE_NUMBER",
        "abn": "CUSTOMER_ABN",
        "abn_branch": "ABN_BRANCH",
        "newsletter": {
            "subscribed": true
        },
        "password": "CUSTOMER_PASSWORD"
    },
    "store_credit": "STORE_CREDIT_AMOUNT",
    "credit_limit": "CREDIT_LIMIT_AMOUNT",
    "customer_password_expired": true,
    "allow_credit_limit": true
}

Response

This API response provides the updated customer information, including personal details, company affiliation, and account settings. It shows the customer’s shipping profile, store credit, credit limit, and password status. The response also includes multiple addresses (primary, shipping, and billing) with relevant contact information, ensuring the customer is fully set up for transactions and shipping. The customer's profile picture and creation timestamp are included as well.

PUT
https://{your_site_domain}/api/v4/admin/customers/{customer_id}
Try It Out
{
    "customer": {
        "id": "CUSTOMER_ID",
        "display_id": "DISPLAY_ID",
        "status": "STATUS",
        "first_name": "FIRST_NAME",
        "last_name": "LAST_NAME",
        "email": "EMAIL_ADDRESS",
        "sex": "GENDER",
        "parent": {
            "id": "PARENT_ID",
            "name": "PARENT_NAME"
        },
        "company": FALSE,
        "company_name": "COMPANY_NAME",
        "timezone": "TIMEZONE",
        "abn": "ABN_NUMBER",
        "abn_branch": "ABN_BRANCH",
        "shipping_profile": {
            "shippingRules": [
                {
                    "zoneList": ["ZONE_ID"],
                    "name": "SHIPPING_RULE_NAME",
                    "description": "DESCRIPTION",
                    "id": "SHIPPING_RULE_ID",
                    "shippingClass": "SHIPPING_CLASS",
                    "shippingPolicy": "SHIPPING_POLICY_ID"
                }
            ],
            "created": "CREATED_TIMESTAMP",
            "name": "SHIPPING_PROFILE_NAME",
            "description": "DESCRIPTION",
            "id": "SHIPPING_PROFILE_ID",
            "updated": "UPDATED_TIMESTAMP",
            "version": "VERSION_NUMBER",
            "rulePrecedence": "RULE_PRECEDENCE"
        },
        "transaction_number": "TRANSACTION_NUMBER",
        "referral_code": "REFERRAL_CODE",
        "used_referral_code": "USED_REFERRAL_CODE",
        "count_referral_code_used": "COUNT_REFERRAL_CODE_USED",
        "allow_credit_limit": TRUE,
        "store_credit": "STORE_CREDIT_AMOUNT",
        "credit_limit": "CREDIT_LIMIT_AMOUNT",
        "how_do_you_know": "HOW_DID_YOU_HEAR",
        "customer_password_expired": TRUE,
        "hide_price": TRUE,
        "default_tax_code": "DEFAULT_TAX_CODE",
        "source": "SOURCE",
        "base_url": "BASE_URL",
        "background_image": "BACKGROUND_IMAGE_URL",
        "profile_picture": "PROFILE_PICTURE_URL",
        "created_at": "CREATED_AT_TIMESTAMP",
        "version": "VERSION_NUMBER",
        "addresses": [
            {
                "id": "ADDRESS_ID_PRIMARY",
                "type": "PRIMARY",
                "first_name": "FIRST_NAME",
                "last_name": "LAST_NAME",
                "email": "EMAIL_ADDRESS",
                "company_name": "COMPANY_NAME",
                "address_line_1": "ADDRESS_LINE_1",
                "address_line_2": "ADDRESS_LINE_2",
                "country": {
                    "id": "COUNTRY_ID",
                    "name": "COUNTRY_NAME",
                    "code": "COUNTRY_CODE"
                },
                "state": {
                    "id": "STATE_ID",
                    "name": "STATE_NAME",
                    "code": "STATE_CODE"
                },
                "city": "CITY_NAME",
                "post_code": "POST_CODE",
                "mobile": "MOBILE_NUMBER",
                "phone": "PHONE_NUMBER",
                "fax": "FAX_NUMBER"
            },
            {
                "id": "ADDRESS_ID_SHIPPING",
                "type": "SHIPPING",
                "first_name": "FIRST_NAME",
                "last_name": "LAST_NAME",
                "email": "EMAIL_ADDRESS",
                "company_name": "COMPANY_NAME",
                "address_line_1": "ADDRESS_LINE_1",
                "address_line_2": "ADDRESS_LINE_2",
                "country": {
                    "id": "COUNTRY_ID",
                    "name": "COUNTRY_NAME",
                    "code": "COUNTRY_CODE"
                },
                "state": {
                    "id": "STATE_ID",
                    "name": "STATE_NAME",
                    "code": "STATE_CODE"
                },
                "city": "CITY_NAME",
                "post_code": "POST_CODE",
                "mobile": "MOBILE_NUMBER",
                "phone": "PHONE_NUMBER",
                "fax": "FAX_NUMBER"
            },
            {
                "id": "ADDRESS_ID_BILLING",
                "type": "BILLING",
                "first_name": "FIRST_NAME",
                "last_name": "LAST_NAME",
                "email": "EMAIL_ADDRESS",
                "company_name": "COMPANY_NAME",
                "address_line_1": "ADDRESS_LINE_1",
                "address_line_2": "ADDRESS_LINE_2",
                "country": {
                    "id": "COUNTRY_ID",
                    "name": "COUNTRY_NAME",
                    "code": "COUNTRY_CODE"
                },
                "state": {
                    "id": "STATE_ID",
                    "name": "STATE_NAME",
                    "code": "STATE_CODE"
                },
                "city": "CITY_NAME",
                "post_code": "POST_CODE",
                "mobile": "MOBILE_NUMBER",
                "phone": "PHONE_NUMBER",
                "fax": "FAX_NUMBER"
            }
        ],
        "active_billing_address": "ACTIVE_BILLING_ADDRESS_ID",
        "active_shipping_address": "ACTIVE_SHIPPING_ADDRESS_ID",
        "is_in_trash": TRUE
    }
}