Update a Customer

PATCH

/v1/customers/:id

Updates the customer with the given ID and provided attributes.


Attributes

name

The name of the customer.

email

The email of the customer.

city

The city of the customer.

region

The region of the customer.

country Optional

The ISO 3166-1 two-letter country code for the customer (e.g. US, GB, etc).

status Optional

The email marketing status of the customer. One of:

  • archived - This customer has been archived and will no longer receive marketing emails.

curl -X "PATCH" "https://api.lemonsqueezy.com/v1/customers/1" \
  -H 'Accept: application/vnd.api+json' \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Authorization: Bearer {api_key}' \
  -d $'{
    "data": {
      "type": "customers",
      "id": "1",
      "attributes": {
        "name": "John Doe",
        "email": "[email protected]",
        "status": "archived"
      }
    }
  }'

Returns

Returns the updated customer object.

{
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "self": "https://api.lemonsqueezy.com/v1/customers/1"
  },
  "data": {
    "type": "customers",
    "id": "1",
    "attributes": {
      "store_id": 1,
      "name": "John Doe",
      "email": "[email protected]",
      "status": "archived",
      "city": null,
      "region": null,
      "country": "US",
      "total_revenue_currency": 0,
      "mrr": 0,
      "status_formatted": "Archived",
      "country_formatted": "United States",
      "total_revenue_currency_formatted": "$0.00",
      "mrr_formatted": "$0.00",
      "urls": {
        "customer_portal": null
      },
      "created_at": "2022-12-01T13:01:07.000000Z",
      "updated_at": "2022-12-09T09:05:21.000000Z",
      "test_mode": false
    },
    "relationships": {
      "store": {
        "links": {
          "related": "https://api.lemonsqueezy.com/v1/customers/1/store",
          "self": "https://api.lemonsqueezy.com/v1/customers/1/relationships/store"
        }
      },
      "orders": {
        "links": {
          "related": "https://api.lemonsqueezy.com/v1/customers/1/orders",
          "self": "https://api.lemonsqueezy.com/v1/customers/1/relationships/orders"
        }
      },
      "subscriptions": {
        "links": {
          "related": "https://api.lemonsqueezy.com/v1/customers/1/subscriptions",
          "self": "https://api.lemonsqueezy.com/v1/customers/1/relationships/subscriptions"
        }
      },
      "license-keys": {
        "links": {
          "related": "https://api.lemonsqueezy.com/v1/customers/1/license-keys",
          "self": "https://api.lemonsqueezy.com/v1/customers/1/relationships/license-keys"
        }
      }
    },
    "links": {
      "self": "https://api.lemonsqueezy.com/v1/customers/1"
    }
  }
}

Was this page helpful?