---
updatedAt: 2026-05-21T10:45:06.000Z
agentTools:
  projectIndex: https://docs.qpilot.cloud/llms.txt
---

# /Sites/{siteId}/Customers/Upsert

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "QPilot API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.qpilot.cloud"
    }
  ],
  "paths": {
    "/Sites/{siteId}/Customers/Upsert": {
      "post": {
        "tags": [
          "Customers"
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/QPilot.Core.Models.Dto.Requests.CustomerUpsertDto"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QPilot.Core.Models.Dto.Requests.CustomerUpsertDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/QPilot.Core.Models.Dto.Requests.CustomerUpsertDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/QPilot.Core.Models.Dto.Requests.CustomerUpsertDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QPilot.Core.Models.Dto.Entities.CustomerDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QPilot.Core.Models.Dto.Entities.CustomerDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QPilot.Core.Models.Dto.Entities.CustomerDto"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "QPilot.Core.Models.Dto.Entities.CustomerDto": {
        "required": [
          "email",
          "id"
        ],
        "type": "object",
        "properties": {
          "created": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "isShowingNotes": {
            "type": "boolean",
            "nullable": true
          },
          "isShowCoupons": {
            "type": "boolean",
            "nullable": true
          },
          "isProcessingPaused": {
            "type": "boolean",
            "nullable": true
          },
          "paymentMethods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QPilot.Core.Models.Dto.Entities.PaymentMethodDto"
            },
            "nullable": true
          },
          "id": {
            "maxLength": 16,
            "minLength": 0,
            "type": "string"
          },
          "customerId": {
            "type": "integer",
            "format": "int64"
          },
          "siteId": {
            "type": "integer",
            "format": "int64"
          },
          "email": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string"
          },
          "firstName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingFirstName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingLastName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingStreet1": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingStreet2": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingCity": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingState": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingPostcode": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingCountry": {
            "maxLength": 2,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingFirstName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingLastName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingStreet1": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingStreet2": {
            "maxLength": 60,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCity": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingState": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingPostcode": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCountry": {
            "maxLength": 2,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "phoneNumber": {
            "maxLength": 30,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "company": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingCompany": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCompany": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "lifetimeValue": {
            "type": "number",
            "format": "double"
          },
          "createdUtc": {
            "type": "string",
            "format": "date-time"
          },
          "updatedUtc": {
            "type": "string",
            "format": "date-time"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QPilot.Core.Models.Dto.Entities.PaymentMethodDto": {
        "required": [
          "customerId",
          "description"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/QPilot.Core.Models.PaymentMethodStatus"
          },
          "createdUtc": {
            "type": "string",
            "format": "date-time"
          },
          "updatedUtc": {
            "type": "string",
            "format": "date-time"
          },
          "expirationDate": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "readOnly": true
          },
          "customerId": {
            "minLength": 1,
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/QPilot.Core.Models.PaymentMethodType"
          },
          "gatewayCustomerId": {
            "type": "string",
            "nullable": true
          },
          "gatewayPaymentId": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "minLength": 1,
            "type": "string"
          },
          "expiration": {
            "type": "string",
            "nullable": true
          },
          "lastFourDigits": {
            "type": "string",
            "nullable": true
          },
          "billingFirstName": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingLastName": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingStreet1": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingStreet2": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCity": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingState": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingPostcode": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCountry": {
            "maxLength": 2,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCompany": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean",
            "nullable": true
          },
          "gatewayPaymentType": {
            "$ref": "#/components/schemas/QPilot.Core.Models.GatewayPaymentType"
          }
        },
        "additionalProperties": false
      },
      "QPilot.Core.Models.Dto.Requests.CustomerUpsertDto": {
        "required": [
          "email",
          "id"
        ],
        "type": "object",
        "properties": {
          "applyToScheduledOrders": {
            "type": "boolean"
          },
          "id": {
            "maxLength": 16,
            "minLength": 0,
            "type": "string"
          },
          "customerId": {
            "type": "integer",
            "format": "int64"
          },
          "siteId": {
            "type": "integer",
            "format": "int64"
          },
          "email": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string"
          },
          "firstName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingFirstName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingLastName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingStreet1": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingStreet2": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingCity": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingState": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingPostcode": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingCountry": {
            "maxLength": 2,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingFirstName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingLastName": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingStreet1": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingStreet2": {
            "maxLength": 60,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCity": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingState": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingPostcode": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCountry": {
            "maxLength": 2,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "phoneNumber": {
            "maxLength": 30,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "company": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "shippingCompany": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCompany": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "paymentMethods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QPilot.Core.Models.Dto.Requests.PostPutPaymentMethodDto"
            },
            "nullable": true
          },
          "lifetimeValue": {
            "type": "number",
            "format": "double"
          },
          "createdUtc": {
            "type": "string",
            "format": "date-time"
          },
          "updatedUtc": {
            "type": "string",
            "format": "date-time"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QPilot.Core.Models.Dto.Requests.PostPutPaymentMethodDto": {
        "required": [
          "customerId",
          "description"
        ],
        "type": "object",
        "properties": {
          "customerId": {
            "minLength": 1,
            "type": "string"
          },
          "type": {
            "$ref": "#/components/schemas/QPilot.Core.Models.PaymentMethodType"
          },
          "gatewayCustomerId": {
            "type": "string",
            "nullable": true
          },
          "gatewayPaymentId": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "minLength": 1,
            "type": "string"
          },
          "expiration": {
            "type": "string",
            "nullable": true
          },
          "lastFourDigits": {
            "type": "string",
            "nullable": true
          },
          "billingFirstName": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingLastName": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingStreet1": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingStreet2": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCity": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingState": {
            "maxLength": 256,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingPostcode": {
            "maxLength": 20,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCountry": {
            "maxLength": 2,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "billingCompany": {
            "maxLength": 255,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "isDefault": {
            "type": "boolean",
            "nullable": true
          },
          "gatewayPaymentType": {
            "$ref": "#/components/schemas/QPilot.Core.Models.GatewayPaymentType"
          }
        },
        "additionalProperties": false
      },
      "QPilot.Core.Models.GatewayPaymentType": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20,
          21,
          22,
          23,
          24,
          25,
          26,
          27,
          28,
          29,
          30,
          31,
          32
        ],
        "type": "integer",
        "format": "int32"
      },
      "QPilot.Core.Models.PaymentMethodStatus": {
        "enum": [
          "Active",
          "Expired",
          "Revoked",
          "Invalid"
        ],
        "type": "string"
      },
      "QPilot.Core.Models.PaymentMethodType": {
        "enum": [
          "Stripe",
          "AuthorizeNet",
          "Test",
          "PayPal",
          "Braintree",
          "CyberSource",
          "Undefined",
          "Other",
          "Nmi",
          "PayaV1",
          "TrustCommerce",
          "Square",
          "Sage",
          "CyberSourceV2",
          "Checkout",
          "PaypalV2",
          "Shopify",
          "PayPalV3",
          "Airwallex"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "description": "Authorization header using the Bearer scheme. Example: \"Bearer {token}\"",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```