openapi: 3.1.0 info: title: Commerce Layer addresses customer_addresses API version: 7.10.1 contact: name: API Support url: https://commercelayer.io email: support@commercelayer.io description: Headless Commerce for Global Brands. servers: - url: https://{your_organization_slug}.commercelayer.io/api description: API - url: https://core.commercelayer.io/users/sign_in description: Sign in - url: https://docs.commercelayer.io/api description: API reference security: - bearerAuth: [] tags: - name: customer_addresses description: resource type paths: /customer_addresses: get: operationId: GET/customer_addresses summary: List all customer addresses description: List all customer addresses tags: - customer_addresses responses: '200': description: A list of customer address objects content: application/vnd.api+json: schema: $ref: '#/components/schemas/customerAddressResponseList' post: operationId: POST/customer_addresses summary: Create a customer address description: Create a customer address tags: - customer_addresses requestBody: required: true content: application/vnd.api+json: schema: $ref: '#/components/schemas/customerAddressCreate' responses: '201': description: The created customer address object content: application/vnd.api+json: schema: $ref: '#/components/schemas/customerAddressResponse' /customer_addresses/{customerAddressId}: get: operationId: GET/customer_addresses/customerAddressId summary: Retrieve a customer address description: Retrieve a customer address tags: - customer_addresses parameters: - name: customerAddressId in: path schema: type: string required: true description: The resource's id responses: '200': description: The customer address object content: application/vnd.api+json: schema: $ref: '#/components/schemas/customerAddressResponse' patch: operationId: PATCH/customer_addresses/customerAddressId summary: Update a customer address description: Update a customer address tags: - customer_addresses parameters: - name: customerAddressId in: path schema: type: string required: true description: The resource's id requestBody: required: true content: application/vnd.api+json: schema: $ref: '#/components/schemas/customerAddressUpdate' responses: '200': description: The updated customer address object content: application/vnd.api+json: schema: $ref: '#/components/schemas/customerAddressResponse' delete: operationId: DELETE/customer_addresses/customerAddressId summary: Delete a customer address description: Delete a customer address tags: - customer_addresses parameters: - name: customerAddressId in: path schema: type: string required: true description: The resource's id responses: '204': description: No content /customers/{customerId}/customer_addresses: get: operationId: GET/customerId/customer_addresses summary: Retrieve the customer addresses associated to the customer description: Retrieve the customer addresses associated to the customer tags: - customer_addresses parameters: - name: customerId in: path schema: type: string required: true description: The resource's id responses: '200': description: The customer_addresses associated to the customer components: schemas: customerAddress: properties: data: properties: attributes: type: object properties: name: type: string description: Returns the associated address' name. example: John Smith, 2883 Geraldine Lane Apt.23, 10013 New York NY (US) (212) 646-338-1228 nullable: true customer_email: type: string description: The email of the customer associated to the address. example: john@example.com nullable: false created_at: type: string description: Time at which the resource was created. example: '2018-01-01T12:00:00.000Z' nullable: false updated_at: type: string description: Time at which the resource was last updated. example: '2018-01-01T12:00:00.000Z' nullable: false reference: type: string description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. example: ANY-EXTERNAL-REFEFERNCE nullable: true reference_origin: type: string description: Any identifier of the third party system that defines the reference code. example: ANY-EXTERNAL-REFEFERNCE-ORIGIN nullable: true metadata: type: object description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format. example: foo: bar nullable: true customerAddressResponseList: type: object properties: data: type: array items: $ref: '#/components/schemas/customerAddressResponse/properties/data' customerAddressResponse: type: object properties: data: type: object properties: id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN type: type: string description: The resource's type enum: - customer_addresses links: type: object properties: self: type: string description: URL attributes: $ref: '#/components/schemas/customerAddress/properties/data/properties/attributes' relationships: type: object properties: customer: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - customer id: type: string description: The resource ID address: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - address id: type: string description: The resource ID events: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - events id: type: string description: The resource ID event_stores: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - event_stores id: type: string description: The resource ID customerAddressCreate: required: - data type: object properties: data: type: object required: - type - attributes properties: type: type: string description: The resource's type enum: - customer_addresses attributes: type: object properties: customer_email: type: string description: The email of the customer associated to the address. example: john@example.com reference: type: string description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. example: ANY-EXTERNAL-REFEFERNCE reference_origin: type: string description: Any identifier of the third party system that defines the reference code. example: ANY-EXTERNAL-REFEFERNCE-ORIGIN metadata: type: object description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format. example: foo: bar required: - customer_email relationships: type: object properties: customer: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - customers id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN address: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - addresses id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN required: - customer - address customerAddressUpdate: required: - data type: object properties: data: type: object required: - type - id - attributes properties: type: type: string description: The resource's type enum: - customer_addresses id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN attributes: type: object properties: reference: type: string description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. example: ANY-EXTERNAL-REFEFERNCE nullable: true reference_origin: type: string description: Any identifier of the third party system that defines the reference code. example: ANY-EXTERNAL-REFEFERNCE-ORIGIN nullable: true metadata: type: object description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format. example: foo: bar nullable: true relationships: type: object properties: customer: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - customers id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN address: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - addresses id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT