openapi: 3.2.0 info: version: 2.1.1 title: Metrilo tracking Customer API description: Metrilo analytics tracking API contact: name: Metrilo email: support@metrilo.com url: https://www.metrilo.com servers: - url: https://trk.mtrl.me tags: - name: Customer paths: /customer: post: tags: - Customer description: Adds a new customer or updates an existing one in Metrilo. operationId: customerOperation requestBody: required: true content: text/plain: schema: $ref: '#/components/schemas/customerOperationObject' responses: '200': $ref: '#/components/responses/success' '400': $ref: '#/components/responses/errorBadRequest' '401': $ref: '#/components/responses/errorUnauthorized' '402': $ref: '#/components/responses/errorPaymentRequired' '403': $ref: '#/components/responses/errorForbidden' '500': $ref: '#/components/responses/internalServerError' '502': $ref: '#/components/responses/badGateway' summary: Customer operation x-summary-source: derived /customer/tag: post: tags: - Customer description: Adds tags to an existing customer in Metrilo. operationId: customerTagOperation requestBody: required: true content: text/plain: schema: $ref: '#/components/schemas/customerTagOperationObject' responses: '200': $ref: '#/components/responses/success' '400': $ref: '#/components/responses/errorBadRequest' '401': $ref: '#/components/responses/errorUnauthorized' '402': $ref: '#/components/responses/errorPaymentRequired' '403': $ref: '#/components/responses/errorForbidden' '500': $ref: '#/components/responses/internalServerError' '502': $ref: '#/components/responses/badGateway' summary: Customer tag operation x-summary-source: derived /customer/untag: post: tags: - Customer description: Removes tags from an existing customer in Metrilo. operationId: customerUntagOperation requestBody: required: true content: text/plain: schema: $ref: '#/components/schemas/customerUntagOperationObject' responses: '200': $ref: '#/components/responses/success' '400': $ref: '#/components/responses/errorBadRequest' '401': $ref: '#/components/responses/errorUnauthorized' '402': $ref: '#/components/responses/errorPaymentRequired' '403': $ref: '#/components/responses/errorForbidden' '500': $ref: '#/components/responses/internalServerError' '502': $ref: '#/components/responses/badGateway' summary: Customer untag operation x-summary-source: derived /customer/batch: post: tags: - Customer description: Adds multiple customers or updates existing ones in Metrilo. operationId: customerBatchOperation requestBody: required: true content: text/plain: schema: $ref: '#/components/schemas/customerBatchOperationObject' responses: '200': $ref: '#/components/responses/success' '400': $ref: '#/components/responses/errorBadRequest' '401': $ref: '#/components/responses/errorUnauthorized' '402': $ref: '#/components/responses/errorPaymentRequired' '403': $ref: '#/components/responses/errorForbidden' '500': $ref: '#/components/responses/internalServerError' '502': $ref: '#/components/responses/badGateway' summary: Customer batch operation x-summary-source: derived components: schemas: customerTagObject: allOf: - $ref: '#/components/schemas/visitorIdentityObject' - type: object required: - createdAt - email - tags properties: email: type: string description: The email of the customer. example: johnybravo@metrilo.com tags: type: array items: type: string description: Tag labels that are assigned to the customer in Metrilo. (tags are merged, not overwritten) example: - early_subscriber - big_spender customerObject: allOf: - $ref: '#/components/schemas/visitorIdentityObject' - type: object required: - createdAt properties: createdAt: type: integer description: Integer representation of the time the customer was created (milliseconds from 1970). example: 1518004715732 firstName: type: string description: Customer's first name. example: Johny lastName: type: string description: Customer's last name. example: Bravo subscribed: type: boolean description: If the user has opted in for receiving emails. example: true tags: type: array items: type: string description: Tag labels that are assigned to the customer in Metrilo. (tags are merged, not overwritten) example: - early_subscriber - big_spender customerUntagOperationObject: allOf: - $ref: '#/components/schemas/basicBackendObject' - type: object required: - params properties: params: allOf: - $ref: '#/components/schemas/customerUntagObject' visitorIdentityObject: type: object required: - email properties: email: type: string description: Visitor's email address. example: johnybravo@metrilo.com customerUntagObject: allOf: - $ref: '#/components/schemas/visitorIdentityObject' - type: object required: - createdAt - email - tags properties: email: type: string description: The email of the customer. example: johnybravo@metrilo.com tags: type: array items: type: string description: Tag labels that are removed from the customer in Metrilo. (missing tags are omitted) example: - early_subscriber - big_spender basicBackendObject: type: object required: - time - token properties: time: type: integer description: Integer representation of the event time (milliseconds from 1970). example: 1518004715732 token: type: string description: Shop API token. example: ccc111ddddaaaaac platform: type: string description: Shop platform versioning. example: Wordpress 4.2.7 / Woocommerce 3.5 pluginVersion: type: string description: Metrilo plugin version. example: 1.1.0 customerBatchOperationObject: allOf: - $ref: '#/components/schemas/basicBackendObject' - type: object required: - batch properties: batch: type: array items: $ref: '#/components/schemas/customerObject' customerTagOperationObject: allOf: - $ref: '#/components/schemas/basicBackendObject' - type: object required: - params properties: params: allOf: - $ref: '#/components/schemas/customerTagObject' customerOperationObject: allOf: - $ref: '#/components/schemas/basicBackendObject' - type: object required: - params properties: params: allOf: - $ref: '#/components/schemas/customerObject' responses: success: description: Success response. errorBadRequest: description: Bad request from client. errorPaymentRequired: description: Project requires payment. internalServerError: description: Error from server while processing request. badGateway: description: Error from server accepting request. errorUnauthorized: description: Project token is invalid. errorForbidden: description: The IP that the request came from is ignored.