{ "parameters": { "customerID": { "name": "customerID", "in": "query", "description": "Unique ID for the record. This or userName is required.", "required": false, "type": "integer" }, "customerIDRequired": { "name": "customerID", "in": "query", "description": "Unique ID for the record.", "required": true, "type": "integer" }, "userNameForViewAndEdit": { "name": "userName", "in": "query", "description": "Unique userName for the customer. This or the ID is required.", "required": false, "type": "string" } }, "paths": { "/customer": { "get": { "summary": "Customer View", "description": "View the details of a Customer record.", "tags": [ "Administrative/CRUD Operations" ], "parameters": [ { "$ref": "#/parameters/customerID" }, { "$ref": "#/parameters/userNameForViewAndEdit" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Customer object", "schema": { "$ref": "#/definitions/WrappedCustomer" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "delete": { "summary": "Customer Delete", "description": "Delete a Customer record.", "tags": [ "Administrative/CRUD Operations" ], "parameters": [ { "$ref": "#/parameters/customerIDRequired" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/WrappedCustomer" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "patch": { "summary": "Customer Edit", "description": "Edits a Customer record.", "tags": [ "Administrative/CRUD Operations" ], "parameters": [ { "name": "customer", "in": "body", "description": "The customer to be edited. Either the customerID or code must be provided.", "required": true, "schema": { "$ref": "#/definitions/Customer" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Customer object", "schema": { "$ref": "#/definitions/WrappedCustomer" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } }, "post": { "summary": "Customer Add", "description": "Adds a Customer record.", "tags": [ "Administrative/CRUD Operations" ], "parameters": [ { "name": "customer", "in": "body", "description": "The customer to be added.", "required": true, "schema": { "$ref": "#/definitions/NewCustomer" } }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Customer object", "schema": { "$ref": "#/definitions/WrappedCustomer" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } }, "/customer/list": { "get": { "summary": "Customer List", "description": "View a list of customers.", "tags": [ "Administrative/CRUD Operations" ], "parameters": [ { "$ref": "../swagger-spec.json#/parameters/itemsPerPage" }, { "$ref": "../swagger-spec.json#/parameters/firstRow" }, { "$ref": "../swagger-spec.json#/parameters/sortByString" }, { "$ref": "../swagger-spec.json#/parameters/sortAscOrDesc" }, { "$ref": "../swagger-spec.json#/parameters/searchString" }, { "$ref": "../swagger-spec.json#/parameters/apiLoginIDParam" }, { "$ref": "../swagger-spec.json#/parameters/apiAuthenticationTokenParam" } ], "responses": { "200": { "description": "Customer List", "schema": { "$ref": "#/definitions/WrappedCustomerList" } }, "default": { "description": "Error", "schema": { "$ref": "../swagger-spec.json#/definitions/Error" } } } } } }, "definitions": { "BaseCustomer": { "type": "object", "properties": { "decryptedPassword": { "description": "The password the customer uses to log in. You must have Superuser or 'Customer Password Editor' permissions to view or edit the password.", "type": "string", "maxLength": 255 }, "autoLoginToken": { "description": "The value of the sscaltoken cookie that will automatically log this customer in after the initial login session expires.", "type": "string", "maxLength": 255 }, "firstName": { "description": "The first name of this customer. Defaults to 'Registered'.", "type": "string", "maxLength": 255 }, "lastName": { "description": "The last name of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 100 }, "organization": { "description": "The organization of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 100 }, "address1": { "description": "The first address line of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 255 }, "address2": { "description": "The second address line of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 255 }, "city": { "description": "The city of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 100 }, "state": { "description": "The state of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 100 }, "postalCode": { "description": "The postal code of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 100 }, "country": { "description": "The country of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 100 }, "phone1": { "description": "The primary phone number of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 100 }, "phone2": { "description": "The secondary phone number of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 100 }, "email1": { "description": "The primary email address of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 100 }, "email2": { "description": "The secondary email address of this customer. Corresponds to the customer's billing address.", "type": "string", "maxLength": 100 }, "extra1": { "description": "Any extra, or custom information associated with this customer.", "type": "string", "maxLength": 255 }, "extra2": { "description": "Any extra, or custom information associated with this customer.", "type": "string", "maxLength": 255 }, "extra3": { "description": "Any extra, or custom information associated with this customer.", "type": "string", "maxLength": 255 }, "extra4": { "description": "Any extra, or custom information associated with this customer.", "type": "string", "maxLength": 255 }, "extra5": { "description": "Any extra, or custom information associated with this customer.", "type": "string", "maxLength": 255 }, "cimProfileID": { "description": "The profile ID of this customer's record in the Authorize.net CIM system (if CIM is enabled globally for the store).", "type": "string", "maxLength": 100 }, "passwordToken": { "description": "The token sent to the customer to authenticate him when resetting the password.", "type": "string", "maxLength": 100 }, "passwordTokenDate": { "description": "The date/time the passwordToken expires, after which it can't be used to reset the password.", "type": "string", "maxLength": 100 }, "passwordExpires": { "description": "The date/time the password expires, after which the customer must update it before logging in. If empty, it never expires.", "type": "string", "maxLength": 255 }, "lockedOutUntil": { "description": "The date/time the customer is no longer locked out of the account due to too many failed login attempts.", "type": "string", "maxLength": 255 }, "previousPasswords": { "description": "The list of (encrypted) previous passwords for the customer. The list is used if the security check to prevent previous passwords from being used is enabled.", "type": "string" }, "canUsePO": { "description": "If true, this customer may use the Purchase Order payment method (if enabled globally for the store).", "type": "boolean", "default": false }, "notes": { "description": "Any notes corresponding to this customer.", "type": "string" } } }, "NewCustomer": { "type": "object", "allOf": [ { "required": [ "userName" ], "properties": { "userName": { "type": "string", "description": "Unique userName for the customer." } } }, { "$ref": "#/definitions/BaseCustomer" } ] }, "Customer": { "type": "object", "allOf": [ { "properties": { "customerID": { "type": "integer", "description": "Unique identifier representing a specific customer. This or the userName is required." }, "userName": { "type": "string", "description": "Unique userName for the customer. This or the customerID is required." } } }, { "$ref": "#/definitions/BaseCustomer" } ] }, "WrappedCustomer": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "$ref": "#/definitions/Customer" } } }, "WrappedCustomerList": { "type": "object", "properties": { "success": { "type": "boolean" }, "errors": { "type": "array", "items": { "type": "string" } }, "messages": { "type": "array", "items": { "type": "string" } }, "jsonResult": { "type": "object", "properties": { "itemCollection": { "type": "array", "description": "The list of items being requested that match the criteria, limited to the number of itemsPerPage.", "items": { "$ref": "#/definitions/Customer" } }, "itemCount": { "description": "The total number of items matching the criteria. This value may used to compose paging parameters.", "type": "integer" } } } } } } }