@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Ecommerce API
@base https://unify.apideck.com
@version 10.24.12
@auth ApiKey Authorization in header
@common_fields {x-apideck-consumer-id: str # ID of the consumer which you want to get or push data from, x-apideck-app-id: str # The ID of your Unify application, raw: bool=false # Include raw response. Mostly used for debugging purposes, x-apideck-service-id: str # Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API., fields: str # The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city`In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.}
@endpoints 7
@toc ecommerce(7)

@endpoint GET /ecommerce/orders
@desc List Orders
@optional {cursor: str # Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response., limit: int=20 # Number of results to return. Minimum 1, Maximum 200, Default 20, filter: map # Apply filters, sort: map # Apply sorting, pass_through: map # Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads}
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: [map], _raw: map?, meta: map{items_on_page: int, cursors: map{previous: str?, current: str?, next: str?}}, links: map{previous: str?, current: str, next: str?}} # Orders
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@endpoint GET /ecommerce/orders/{id}
@desc Get Order
@required {id: str # ID of the record you are acting upon.}
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: map{id: str, order_number: str?, currency: str?, discounts: [map], sub_total: str?, shipping_cost: str?, coupon_discount: str?, total_discount: str?, total_tax: str?, total_amount: str?, refunded_amount: str?, status: str?, payment_status: str?, fulfillment_status: str?, payment_method: str?, customer: map{id: str?, name: str?, first_name: str?, last_name: str?, company_name: str?, phone_numbers: [map]?, emails: [map]?}, billing_address: map{line1: str?, line2: str?, company_name: str?, city: str?, state: str?, postal_code: str?, country: str?}, shipping_address: map{line1: str?, line2: str?, company_name: str?, city: str?, state: str?, postal_code: str?, country: str?}, tracking: [map], line_items: [map], note: str?, refunds: [map], custom_mappings: map?, created_at: str(date-time)?, updated_at: str(date-time)?}, _raw: map?} # Orders
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@endpoint GET /ecommerce/products
@desc List Products
@optional {cursor: str # Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response., limit: int=20 # Number of results to return. Minimum 1, Maximum 200, Default 20, pass_through: map # Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads, filter: map # Apply filters}
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: [map], _raw: map?, meta: map{items_on_page: int, cursors: map{previous: str?, current: str?, next: str?}}, links: map{previous: str?, current: str, next: str?}} # Products
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@endpoint GET /ecommerce/products/{id}
@desc Get Product
@required {id: str # ID of the record you are acting upon.}
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: map{id: str, name: str?, description: str?, status: str?, price: str?, sku: str?, inventory_quantity: str?, images: [map]?, weight: str?, weight_unit: str?, options: [map], variants: [map], tags: [str], categories: [map], custom_mappings: map?, created_at: str(date-time)?, updated_at: str(date-time)?}, _raw: map?} # Products
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@endpoint GET /ecommerce/customers
@desc List Customers
@optional {cursor: str # Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response., limit: int=20 # Number of results to return. Minimum 1, Maximum 200, Default 20, filter: map # Apply filters, pass_through: map # Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads}
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: [map], _raw: map?, meta: map{items_on_page: int, cursors: map{previous: str?, current: str?, next: str?}}, links: map{previous: str?, current: str, next: str?}} # Customers
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@endpoint GET /ecommerce/customers/{id}
@desc Get Customer
@required {id: str # ID of the record you are acting upon.}
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: map{id: str, name: str?, first_name: str?, last_name: str?, company_name: str?, status: str?, currency: str?, emails: [map]?, phone_numbers: [map]?, addresses: [map], orders: [map], custom_mappings: map?, created_at: str(date-time)?, updated_at: str(date-time)?}, _raw: map?} # Customers
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@endpoint GET /ecommerce/store
@desc Get Store
@returns(200) {status_code: int, status: str, service: str, resource: str, operation: str, data: map{id: str, name: str?, store_url: str(uri)?, admin_url: str(uri)?, custom_mappings: map?, created_at: str(date-time)?, updated_at: str(date-time)?}, _raw: map?} # Stores
@errors {400: Bad Request, 401: Unauthorized, 402: Payment Required, 404: The specified resource was not found, 422: Unprocessable}

@end
