@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Jumpseller API
@base https://api.jumpseller.com/v1
@version 1.0.0
@auth Bearer basic | ApiKey login in query | ApiKey authtoken in query | ApiKey auth_token in query | OAuth2
@endpoints 179
@hint download_for_search
@toc store(3), hooks.json(2), hooks(3), jsapps.json(2), jsapps(2), apps(5), products.json(2), products(51), categories.json(2), categories(4), orders.json(2), orders(12), fulfillments(5), fulfillments.json(2), order(1), pages.json(2), pages(10), customers.json(2), customers(13), customer_categories.json(2), customer_categories(6), promotions.json(2), promotions(3), payment_methods.json(2), payment_methods(1), shipping_methods.json(2), shipping_methods(3), locations.json(2), locations(3), custom_fields.json(2), custom_fields(8), checkout_custom_fields.json(2), checkout_custom_fields(3), countries.json(1), countries(4), taxes.json(2), taxes(1), carts(1), documents.json(1), transaction_ledger(1), products_locations(2)

@group store
@endpoint GET /store/info.json
@desc Retrieve Store Information.
@returns(200) {name: str, code: str, currency: str, country: str, timezone: str, email: str, hooks_token: str, url: str, logo: str, weight_unit: str, subscription_status: str, subscription_plan: str, fb_pixel_id: str, address: map{address: str, city: str, postal: str, region: str, country: str, region_code: str, country_code: str}, whatsapp_phone: str} # OK

@endpoint GET /store/languages.json
@desc Retrieve Store Languages.
@returns(200) OK

@endgroup

@group hooks.json
@endpoint GET /hooks.json
@desc Retrieve all Hooks.
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of Hooks

@endpoint POST /hooks.json
@desc Create a new Hook.
@optional {hook: map{event!: str, url!: str}}
@returns(200) {hook: map{id: int(int32), name: str, event: str, url: str, created_at: str}} # OK
@errors {404: Hook Not Found.}

@endgroup

@group hooks
@endpoint GET /hooks/{id}.json
@desc Retrieve a single Hook.
@required {id: int(int32) # Id of the Hook}
@returns(200) {hook: map{id: int(int32), name: str, event: str, url: str, created_at: str}} # OK
@errors {404: Hook Not Found.}

@endpoint PUT /hooks/{id}.json
@desc Update a Hook.
@required {id: int(int32) # Id of the Hook}
@optional {hook: map{event!: str, url!: str}}
@returns(200) {hook: map{id: int(int32), name: str, event: str, url: str, created_at: str}} # OK
@errors {404: Hook Not Found.}

@endpoint DELETE /hooks/{id}.json
@desc Delete an existing Hook.
@required {id: int(int32) # Id of the Hook}
@returns(200) OK
@errors {404: Hook Not Found.}

@endgroup

@group jsapps.json
@endpoint GET /jsapps.json
@desc Retrieve all the Store's JsApps.
@returns(200) OK
@errors {404: No JsApps found for the store (or for the app when using an OAuth token).}

@endpoint POST /jsapps.json
@desc Create a Store JsApp.
@required {app: map{url!: str, template!: str, element!: str}}
@returns(200) {js_app: map{id: int(int32), url: str, template: str, element: str, application_id: int(int32)}} # OK
@errors {400: Bad request, check your parameters.}
@example_request {"app":{"url":"https://test.url.com/","template":"layout","element":"body"}}

@endgroup

@group jsapps
@endpoint GET /jsapps/{code}.json
@desc Retrieve the JsApps of a given app.
@required {code: str # Code of the app}
@returns(200) OK
@errors {403: Not authorized to access JsApps for this app., 404: App not found or no JsApps for this app.}

@endpoint DELETE /jsapps/{id}.json
@desc Delete an existing JsApp.
@required {id: int(int32) # Id of the JsApp}
@returns(200) {message: str} # OK
@errors {403: Not authorized to delete this JsApp., 404: JsApp not found.}

@endgroup

@group apps
@endpoint GET /apps/{code}/install_status.json
@desc Retrieve an OauthApplication installation status.
@required {code: str # Code of the app}
@returns(200) {app_code: str, store_id: int, installed: bool, subscription_plan: str, subscription_status: str, code: str} # OK

@endpoint GET /apps/{code}/install_status_by_store_id.json
@desc Retrieve an OauthApplication installation status for a specific Store.
@required {code: str # Code of the app, store_id: int # ID of the store}
@returns(200) {app_code: str, store_id: int, installed: bool, subscription_plan: str, subscription_status: str, code: str} # OK

@endpoint GET /apps/{code}/billing_cycle_dates.json
@desc Retrieve billing cycle start and billing cycle end for an OauthApplication.
@required {code: str # Code of the app}
@optional {date: str # A date to search a specific billing cycle}
@returns(200) {billing_start: str, billing_end: str} # OK

@endpoint GET /apps/{code}/billing_cycle_orders.json
@desc Retrieve billing cycle orders for an OauthApplication.
@required {code: str # Code of the app}
@optional {date: str # A date to search for a specific billing cycle}
@returns(200) {billable_orders: [map], free_orders: [map]} # OK

@endpoint GET /apps/{code}/check_billing_cycle_order.json
@desc Retrieve a billing cycle order information for an OauthApplication.
@required {code: str # Code of the app}
@optional {date: str # A date to search for a specific billing cycle}
@returns(200) {billing_start: str, billing_end: str, paid: bool} # OK

@endgroup

@group products.json
@endpoint GET /products.json
@desc Retrieve all Products.
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page, locale: str(string) # Locale code of the translation}
@returns(200) OK

@endpoint POST /products.json
@desc Create a new Product.
@optional {locale: str(string) # Locale code of the translation, product: map{name!: str, description: str, page_title: str, meta_description: str, type: str, days_to_expire: int(int32), price!: num(float), weight: num(float), stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, back_in_stock_enabled: bool, cost_per_item: num, compare_at_price: num, minimum_quantity: num, maximum_quantity: num, sku: str, barcode: str, google_product_category_text: str, quotable: bool, featured: bool, shipping_required: bool, status: str, package_format: str, length: num(float), width: num(float), height: num(float), diameter: num(float), categories: [map], variants: [map]}}
@returns(200) {product: map{id: int(int32), name: str, page_title: str, description: str, type: str, days_to_expire: int(int32), price: num(float), discount: num(float), weight: num(float), stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, back_in_stock_enabled: bool, cost_per_item: num, compare_at_price: num, sku: str, brand: str, barcode: str, google_product_category_text: str, quotable: bool, featured: bool, reviews_enabled: bool, status: str, created_at: str, updated_at: str, package_format: str, length: num(float), width: num(float), height: num(float), diameter: num(float), permalink: str, categories: [map], images: [map], variants: [map], digital_products: [map]}} # OK

@endgroup

@group products
@endpoint GET /products/count.json
@desc Count all Products.
@returns(200) {count: int(int32)} # OK

@endpoint GET /products/after/{id}.json
@desc Retrieves Products after the given id.
@required {id: int(int32) # Id of the Product}
@optional {locale: str(string) # Locale code of the translation}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint GET /products/status/{status}.json
@desc Retrieve Products filtered by status.
@required {status: str(available/not-available/disabled) # Status of the Product used as filter}
@optional {locale: str(string) # Locale code of the translation}
@returns(200) OK
@errors {404: Status Invalid.}

@endpoint GET /products/category/{category_id}.json
@desc Retrieve Products filtered by category.
@required {category_id: int(int32) # Category ID of the Product used as filter}
@optional {locale: str(string) # Locale code of the translation}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint GET /products/status/{status}/count.json
@desc Count Products filtered by status.
@required {status: str(available/not-available/disabled) # Status of the Product used as filter}
@optional {locale: str(string) # Locale code of the translation}
@returns(200) {count: int(int32)} # OK
@errors {404: Status Invalid.}

@endpoint GET /products/category/{category_id}/count.json
@desc Count Products filtered by category.
@required {category_id: int(int32) # Category ID of the Product used as filter}
@optional {locale: str(string) # Locale code of the translation}
@returns(200) {count: int(int32)} # OK
@errors {404: Category Not Found.}

@endpoint GET /products/{id}/reviews.json
@desc Retrieve all reviews for a specific Product.
@required {id: int(int32) # Id of the Product}
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint GET /products/reviews/{review_id}.json
@desc Retrieve a single Product Review.
@required {review_id: int}
@returns(200) {review: map{id: int, status: str, rating: int, review: str, date: str, product_id: int, product_name: str, order_id: int, customer_email: str(email)}} # OK
@errors {404: Review Not Found.}

@endpoint GET /products/reviews.json
@desc Retrieve all Product Reviews.
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) OK

@endpoint GET /products/{id}.json
@desc Retrieve a single Product.
@required {id: int(int32) # Id of the Product}
@optional {locale: str(string) # Locale code of the translation}
@returns(200) {product: map{id: int(int32), name: str, page_title: str, description: str, type: str, days_to_expire: int(int32), price: num(float), discount: num(float), weight: num(float), stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, back_in_stock_enabled: bool, cost_per_item: num, compare_at_price: num, sku: str, brand: str, barcode: str, google_product_category_text: str, quotable: bool, featured: bool, reviews_enabled: bool, status: str, created_at: str, updated_at: str, package_format: str, length: num(float), width: num(float), height: num(float), diameter: num(float), permalink: str, categories: [map], images: [map], variants: [map], digital_products: [map]}} # OK
@errors {404: Product Not Found.}

@endpoint PUT /products/{id}.json
@desc Modify an existing Product.
@required {id: int(int32) # Id of the Product}
@optional {locale: str(string) # Locale code of the translation, product: map{name!: str, description: str, page_title: str, meta_description: str, type: str, days_to_expire: int(int32), price!: num(float), weight: num(float), stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, back_in_stock_enabled: bool, cost_per_item: num, compare_at_price: num, minimum_quantity: num, maximum_quantity: num, sku: str, barcode: str, google_product_category_text: str, quotable: bool, featured: bool, shipping_required: bool, status: str, package_format: str, length: num(float), width: num(float), height: num(float), diameter: num(float), permalink: str, categories: [map], variants: [map]}}
@returns(200) {product: map{id: int(int32), name: str, page_title: str, description: str, type: str, days_to_expire: int(int32), price: num(float), discount: num(float), weight: num(float), stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, back_in_stock_enabled: bool, cost_per_item: num, compare_at_price: num, sku: str, brand: str, barcode: str, google_product_category_text: str, quotable: bool, featured: bool, reviews_enabled: bool, status: str, created_at: str, updated_at: str, package_format: str, length: num(float), width: num(float), height: num(float), diameter: num(float), permalink: str, categories: [map], images: [map], variants: [map], digital_products: [map]}} # OK
@errors {404: Product Not Found.}

@endpoint DELETE /products/{id}.json
@desc Delete an existing Product.
@required {id: int(int32) # Id of the Product}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint GET /products/search.json
@desc Retrieve a Product List from a query.
@required {query: str(string) # Text to query for the Product}
@optional {locale: str(string) # Locale code of the translation, fields: str(string)(sku/barcode/brand/name/description/variants/option_name/custom_fields/custom_fields_selects) # Comma separated values of the fields to query for the Product, status: str(string)(available/not-available/disabled/featured) # Product Status to query for the Product, categories: str(string) # Comma separated values of the Category IDs to query for the Product}
@returns(200) An array of products
@errors {404: Invalid query.}

@endpoint GET /products/{id}/options.json
@desc Retrieve all Product Options.
@required {id: int(int32) # Id of the Product}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint POST /products/{id}/options.json
@desc Create a new Product Option.
@required {id: int(int32) # Id of the Product}
@optional {option: map{name: str, position: int(int32), option_type: str, addon_price: num(float)}}
@returns(200) {option: map{id: int(int32), name: str, position: int(int32), option_type: str, addon_price: num(float)?, values: [map]}} # OK

@endpoint GET /products/{id}/options/count.json
@desc Count all Product Options.
@required {id: int(int32) # Id of the Product}
@returns(200) {count: int(int32)} # OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/options/{option_id}.json
@desc Retrieve a single Product Option.
@required {id: int(int32) # Id of the Product, option_id: int(int32) # Id of the Product Option}
@returns(200) {option: map{id: int(int32), name: str, position: int(int32), option_type: str, addon_price: num(float)?, values: [map]}} # OK
@errors {404: Product Not Found.}

@endpoint PUT /products/{id}/options/{option_id}.json
@desc Modify an existing Product Option.
@required {id: int(int32) # Id of the Product, option_id: int(int32) # Id of the Product Option}
@optional {option: map{name: str, position: int(int32), option_type: str, addon_price: num(float)}}
@returns(200) {option: map{id: int(int32), name: str, position: int(int32), option_type: str, addon_price: num(float)?, values: [map]}} # OK
@errors {404: Product Not Found.}

@endpoint DELETE /products/{id}/options/{option_id}.json
@desc Delete a Product Option.
@required {id: int(int32) # Id of the Product, option_id: int(int32) # Id of the Product Option}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/options/{option_id}/values.json
@desc Retrieve all Product Option Values.
@required {id: int(int32) # Id of the Product, option_id: int(int32) # ID of the Product Option}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint POST /products/{id}/options/{option_id}/values.json
@desc Create a new Product Option Value.
@required {id: int(int32) # Id of the Product, option_id: int(int32) # Id of the Product Option}
@optional {value: map{name: str, position: int(int32), custom: str}}
@returns(200) {value: map{id: int(int32), name: str, custom: str, position: int(int32), product_option: map{option: map{id: int(int32), name: str, position: int(int32), option_type: str, addon_price: num(float)?, values: [map]}}, variants: [map]}} # OK

@endpoint GET /products/{id}/options/{option_id}/values/count.json
@desc Count all Product Option Values.
@required {id: int(int32) # Id of the Product, option_id: int(int32) # ID of the Product Option}
@returns(200) {count: int(int32)} # OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/options/{option_id}/values/{value_id}.json
@desc Retrieve a single Product Option Value.
@required {id: int(int32) # Id of the Product, option_id: int(int32) # Id of the Product Option, value_id: int(int32) # ID of the Product Option Value}
@returns(200) {value: map{id: int(int32), name: str, custom: str, position: int(int32), product_option: map{option: map{id: int(int32), name: str, position: int(int32), option_type: str, addon_price: num(float)?, values: [map]}}, variants: [map]}} # OK
@errors {404: Product Not Found.}

@endpoint PUT /products/{id}/options/{option_id}/values/{value_id}.json
@desc Modify an existing Product Option Value.
@required {id: int(int32) # Id of the Product, option_id: int(int32) # Id of the Product Option, value_id: int(int32) # Id of the Product Option Value}
@optional {value: map{name: str, position: int(int32), custom: str}}
@returns(200) {value: map{id: int(int32), name: str, custom: str, position: int(int32), product_option: map{option: map{id: int(int32), name: str, position: int(int32), option_type: str, addon_price: num(float)?, values: [map]}}, variants: [map]}} # OK
@errors {404: Product Not Found.}

@endpoint DELETE /products/{id}/options/{option_id}/values/{value_id}.json
@desc Delete a Product Option Value.
@required {id: int(int32) # Id of the Product, option_id: int(int32) # Id of the Product Option, value_id: int(int32) # ID of the Product Option Value}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/variants/{variant_id}.json
@desc Retrieve a single Product Variant.
@required {id: int(int32) # Id of the Product, variant_id: int(int32) # Id of the Product Variant}
@returns(200) {variant: map{id: int(int32), price: num(float), sku: str, barcode: str, stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, cost_per_item: num, compare_at_price: num, options: [map], image: map{id: int(int32), position: int(int32), url: str}}} # OK
@errors {404: Product Not Found.}

@endpoint PUT /products/{id}/variants/{variant_id}.json
@desc Modify an existing Product Variant.
@required {id: int(int32) # Id of the Product, variant_id: int(int32) # Id of the Product Variant}
@optional {variant: map{price: num(float), sku: str, barcode: str, stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, cost_per_item: num, compare_at_price: num, image_id: int(int32), options: [map]}}
@returns(200) {variant: map{id: int(int32), price: num(float), sku: str, barcode: str, stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, cost_per_item: num, compare_at_price: num, options: [map], image: map{id: int(int32), position: int(int32), url: str}}} # OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/variants.json
@desc Retrieve all Product Variants.
@required {id: int(int32) # Id of the Product}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint POST /products/{id}/variants.json
@desc Create a new Product Variant.
@required {id: int(int32) # Id of the Product}
@optional {variant: map{price: num(float), sku: str, barcode: str, stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, cost_per_item: num, compare_at_price: num, image_id: int(int32), options: [map]}}
@returns(200) {variant: map{id: int(int32), price: num(float), sku: str, barcode: str, stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, cost_per_item: num, compare_at_price: num, options: [map], image: map{id: int(int32), position: int(int32), url: str}}} # OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/variants/count.json
@desc Count all Product Variants.
@required {id: int(int32) # Id of the Product}
@returns(200) {count: int(int32)} # OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/images.json
@desc Retrieve all Product Images.
@required {id: int(int32) # Id of the Product}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint POST /products/{id}/images.json
@desc Create a new Product Image.
@required {id: int(int32) # Id of the Product}
@optional {image: map{url: str, position: int(int32)}}
@returns(200) {image: map{id: int(int32), position: int(int32), url: str}} # OK

@endpoint PUT /products/{product_id}/images/{image_id}.json
@desc Update a Product Image position.
@required {id: int(int32) # Id of the Product, image_id: int(int32) # Id of the Product Image, position: int(int32) # Desired position of the Product Image}
@returns(200) {image: map{id: int(int32), position: int(int32), url: str}} # OK
@errors {404: Product or Image Not Found.}

@endpoint GET /products/{id}/images/count.json
@desc Count all Product Images.
@required {id: int(int32) # Id of the Product}
@returns(200) {count: int(int32)} # OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/images/{image_id}.json
@desc Retrieve a single Product Image.
@required {id: int(int32) # Id of the Product, image_id: int(int32) # Id of the Product Image}
@returns(200) {image: map{id: int(int32), position: int(int32), url: str}} # OK
@errors {404: Product Not Found.}

@endpoint DELETE /products/{id}/images/{image_id}.json
@desc Delete a Product Image.
@required {id: int(int32) # Id of the Product, image_id: int(int32) # Id of the Product Image}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/attachments.json
@desc Retrieve all Product Attachments.
@required {id: int(int32) # Id of the Product}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint POST /products/{id}/attachments.json
@desc Create a new Product Attachment.
@required {id: int(int32) # Id of the Product}
@optional {attachment: map{filename: str, url: str}}
@returns(200) {attachment: map{id: int(int32), url: str}} # OK

@endpoint GET /products/{id}/attachments/count.json
@desc Count all Product Attachments.
@required {id: int(int32) # Id of the Product}
@returns(200) {count: int(int32)} # OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/attachments/{attachment_id}.json
@desc Retrieve a single Product Attachment.
@required {id: int(int32) # Id of the Product, attachment_id: int(int32) # Id of the Product Attachment}
@returns(200) {attachment: map{id: int(int32), url: str}} # OK
@errors {404: Product Not Found.}

@endpoint DELETE /products/{id}/attachments/{attachment_id}.json
@desc Delete a Product Attachment.
@required {id: int(int32) # Id of the Product, attachment_id: int(int32) # Id of the Product Attachment}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/digital_products.json
@desc Retrieve all Product DigitalProducts.
@required {id: int(int32) # Id of the Product}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint POST /products/{id}/digital_products.json
@desc Create a new Product DigitalProduct.
@required {id: int(int32) # Id of the Product}
@optional {digital_product: map{filename: str, url: str, external: bool}}
@returns(200) {digital_product: map{id: int(int32), url: str, expiration_seconds: int(int32), external: bool}} # OK

@endpoint GET /products/{id}/digital_products/count.json
@desc Count all Product DigitalProducts.
@required {id: int(int32) # Id of the Product}
@returns(200) {count: int(int32)} # OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/digital_products/{digital_product_id}.json
@desc Retrieve a single Product DigitalProduct.
@required {id: int(int32) # Id of the Product, digital_product_id: int(int32) # Id of the Product DigitalProduct}
@optional {external: str # true if searching for an external link}
@returns(200) {digital_product: map{id: int(int32), url: str, expiration_seconds: int(int32), external: bool}} # OK
@errors {404: Product Not Found.}

@endpoint DELETE /products/{id}/digital_products/{digital_product_id}.json
@desc Delete a Product DigitalProduct.
@required {id: int(int32) # Id of the Product, digital_product_id: int(int32) # Id of the Product DigitalProduct}
@optional {external: bool=false # true if it's an external link. If not present or false, it's a file}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/fields.json
@desc Retrieve all Product Custom Fields
@required {id: int(int32) # Id of the Product}
@returns(200) OK
@errors {404: Product Not Found.}

@endpoint POST /products/{id}/fields.json
@desc Add an existing Custom Field to a Product.
@required {id: int(int32) # Id of the Product}
@optional {field: map{id: int(int32), value: str, variants: [int]}}
@returns(200) {product: map{id: int(int32), name: str, page_title: str, description: str, type: str, days_to_expire: int(int32), price: num(float), discount: num(float), weight: num(float), stock: int(int32), stock_unlimited: bool, stock_threshold: int(int32), stock_notification: bool, back_in_stock_enabled: bool, cost_per_item: num, compare_at_price: num, sku: str, brand: str, barcode: str, google_product_category_text: str, quotable: bool, featured: bool, reviews_enabled: bool, status: str, created_at: str, updated_at: str, package_format: str, length: num(float), width: num(float), height: num(float), diameter: num(float), permalink: str, categories: [map], images: [map], variants: [map], digital_products: [map]}} # OK
@errors {404: Product Not Found.}

@endpoint GET /products/{id}/fields/count.json
@desc Count all Product Custom Fields.
@required {id: int(int32) # Id of the Product}
@returns(200) {count: int(int32)} # OK
@errors {404: Product Not Found.}

@endpoint PUT /products/{product_id}/fields/{field_id}.json
@desc Update value of Product Custom Field
@required {product_id: int(int32) # Id of the Product., field_id: int(int32) # Id of the Custom Field Value., field: map{value!: str}}
@returns(200) {field: map{id: int(int32), custom_field_id: int(int32), type: str, label: str, value: str, value_id: str, variant_id: int(int32)}} # OK
@errors {404: Product or Custom Field Value Not Found.}

@endpoint DELETE /products/{product_id}/fields/{field_id}.json
@desc Delete value of Product Custom Field
@required {product_id: int(int32) # Id of the Product., field_id: int(int32) # Id of the Custom Field Value.}
@returns(200) {message: str} # OK
@errors {404: Product or Custom Field Value Not Found.}

@endgroup

@group categories.json
@endpoint GET /categories.json
@desc Retrieve all Categories.
@optional {fields: str(string) # Comma separated values of the fields to query for the Category. Allowed values: id, name, description, parent_id, permalink, images, products.}
@returns(200) {category: map{id: int(int32), name: str, parent_id: int(int32), permalink: str}} # OK

@endpoint POST /categories.json
@desc Create a new Category.
@optional {category: map{name: str, parent_id: int(int32)}}
@returns(200) {category: map{id: int(int32), name: str, parent_id: int(int32), permalink: str}} # OK

@endgroup

@group categories
@endpoint GET /categories/count.json
@desc Count all Categories.
@returns(200) {count: int(int32)} # OK

@endpoint GET /categories/{id}.json
@desc Retrieve a single Category.
@required {id: int(int32) # Id of the Category}
@optional {fields: str(string) # Comma separated values of the fields to query for the Category. Allowed values: id, name, description, parent_id, permalink, images, products.}
@returns(200) {category: map{id: int(int32), name: str, parent_id: int(int32), permalink: str}} # The selected Category.
@errors {404: Category Not Found.}

@endpoint PUT /categories/{id}.json
@desc Modify an existing Category.
@required {id: int(int32) # Id of the Category}
@optional {category: map{name: str, parent_id: int(int32)}}
@returns(200) {category: map{id: int(int32), name: str, parent_id: int(int32), permalink: str}} # OK
@errors {404: Category Not Found.}

@endpoint DELETE /categories/{id}.json
@desc Delete an existing Category.
@required {id: int(int32) # Id of the Category}
@returns(200) OK
@errors {404: Category Not Found.}

@endgroup

@group orders.json
@endpoint GET /orders.json
@desc Retrieve all Orders.
@optional {locale: str(string) # Locale code of the translation, status_filters[]: str(string)(paid/created/pending_payment/canceled/abandoned) # Order Status to query for the Order, fulfillment_filters: str(string)(unfulfilled/fulfilled) # Comma separated values of the fulfillment filters to query for the Order, dateFilter: str(string)(today/yesterday/last30days/last7days/last90days/customDate) # Date to query for the Order., initialDate: str(string) # Starting date to query for the Order in the format YYYY-MM-DD. CustomDate and finalDate need to be used, finalDate: str(string) # Starting date to query for the Order in the format YYYY-MM-DD. CustomDate and initialDate need to be used, fields: str(string)(id/tax/...) # Comma separated values of the fields to query for the Order, limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of Orders

@endpoint POST /orders.json
@desc Create a new Order.
@optional {locale: str(string) # Locale code of the translation, order: map{status: str, shipping_method_id: int(int32), shipping_method_name: str, shipping_price: num(float), shipping_required: bool, allow_missing_products: bool, customer: map, products: [map], billing_information: map}}
@returns(200) {order: map{id: int(int32), source: map{created_from: str, created_from_app_code: str, source_name: str, medium: str, campaign: str, referral_url: str, referral_code: str, user_agent: str, first_page_visited: str, first_page_visited_at: str, referral_source: str}, created_at: str, completed_at: str, currency: str, subtotal: num(float), tax: num(float), shipping_tax: num(float), shipping: num(float), shipping_required: bool, total: num(float), discount: num(float), shipping_discount: num(float), gift_cards_discount: num(float), fulfillment_status: str, shipping_method_id: int(int32), shipping_service_id: int(int32), shipping_method_name: str, payment_method_name: str, payment_method_type: str, payment_information: str, payment_notification_id: str, additional_information: str, duplicate_url: str, recovery_url: str, review_url: str, checkout_url: str, coupons: str, promotions: [any], customer: map{id: int(int32), email: str, phone: str, phone_prefix: str, ip: str, fullname: str}, shipping_branch: map{id: int(int32), name: str}, shipping_address: map{name: str, surname: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, latitude: num, longitude: num, municipality: str, neighbourhood: str}, billing_address: map{name: str, surname: str, taxid: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, municipality: str, neighbourhood: str}, pickup_address: map{name: str, surname: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, municipality: str, pickup_place_name: str}, products: [map], additional_fields: [map], shipping_taxes: [map], status: str, status_name: str, status_enum: str, tracking_url: str, tracking_company: str, tracking_number: str, shipping_option: str, same_day_delivery: bool, shipment_status: str, shipment_status_enum: str, recovered_from: int(int32), external_shipping_rate_id: str, external_shipping_rate_description: str, billing_information: map{business_activity: str, company_name: str, taxpayer_type: str}}} # OK

@endgroup

@group orders
@endpoint GET /orders/count.json
@desc Count all Orders.
@returns(200) {count: int(int32)} # OK

@endpoint GET /orders/status/{status}.json
@desc Retrieve orders filtered by status.
@required {status: str(abandoned/canceled/pending_payment/paid) # Status of the Order used as filter}
@returns(200) OK
@errors {404: Status Invalid.}

@endpoint GET /orders/{id}.json
@desc Retrieve a single Order.
@required {id: int(int32) # Id of the Order}
@returns(200) {order: map{id: int(int32), source: map{created_from: str, created_from_app_code: str, source_name: str, medium: str, campaign: str, referral_url: str, referral_code: str, user_agent: str, first_page_visited: str, first_page_visited_at: str, referral_source: str}, created_at: str, completed_at: str, currency: str, subtotal: num(float), tax: num(float), shipping_tax: num(float), shipping: num(float), shipping_required: bool, total: num(float), discount: num(float), shipping_discount: num(float), gift_cards_discount: num(float), fulfillment_status: str, shipping_method_id: int(int32), shipping_service_id: int(int32), shipping_method_name: str, payment_method_name: str, payment_method_type: str, payment_information: str, payment_notification_id: str, additional_information: str, duplicate_url: str, recovery_url: str, review_url: str, checkout_url: str, coupons: str, promotions: [any], customer: map{id: int(int32), email: str, phone: str, phone_prefix: str, ip: str, fullname: str}, shipping_branch: map{id: int(int32), name: str}, shipping_address: map{name: str, surname: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, latitude: num, longitude: num, municipality: str, neighbourhood: str}, billing_address: map{name: str, surname: str, taxid: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, municipality: str, neighbourhood: str}, pickup_address: map{name: str, surname: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, municipality: str, pickup_place_name: str}, products: [map], additional_fields: [map], shipping_taxes: [map], status: str, status_name: str, status_enum: str, tracking_url: str, tracking_company: str, tracking_number: str, shipping_option: str, same_day_delivery: bool, shipment_status: str, shipment_status_enum: str, recovered_from: int(int32), external_shipping_rate_id: str, external_shipping_rate_description: str, billing_information: map{business_activity: str, company_name: str, taxpayer_type: str}}} # OK
@errors {404: Order Not Found.}

@endpoint PUT /orders/{id}.json
@desc Modify an existing Order.
@required {id: int(int32) # Id of the Order}
@optional {order: map{status: str, shipment_status: str, tracking_number: str, tracking_company: str, tracking_url: str, additional_information: str, additional_fields: [map]}}
@returns(200) {order: map{id: int(int32), source: map{created_from: str, created_from_app_code: str, source_name: str, medium: str, campaign: str, referral_url: str, referral_code: str, user_agent: str, first_page_visited: str, first_page_visited_at: str, referral_source: str}, created_at: str, completed_at: str, currency: str, subtotal: num(float), tax: num(float), shipping_tax: num(float), shipping: num(float), shipping_required: bool, total: num(float), discount: num(float), shipping_discount: num(float), gift_cards_discount: num(float), fulfillment_status: str, shipping_method_id: int(int32), shipping_service_id: int(int32), shipping_method_name: str, payment_method_name: str, payment_method_type: str, payment_information: str, payment_notification_id: str, additional_information: str, duplicate_url: str, recovery_url: str, review_url: str, checkout_url: str, coupons: str, promotions: [any], customer: map{id: int(int32), email: str, phone: str, phone_prefix: str, ip: str, fullname: str}, shipping_branch: map{id: int(int32), name: str}, shipping_address: map{name: str, surname: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, latitude: num, longitude: num, municipality: str, neighbourhood: str}, billing_address: map{name: str, surname: str, taxid: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, municipality: str, neighbourhood: str}, pickup_address: map{name: str, surname: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, municipality: str, pickup_place_name: str}, products: [map], additional_fields: [map], shipping_taxes: [map], status: str, status_name: str, status_enum: str, tracking_url: str, tracking_company: str, tracking_number: str, shipping_option: str, same_day_delivery: bool, shipment_status: str, shipment_status_enum: str, recovered_from: int(int32), external_shipping_rate_id: str, external_shipping_rate_description: str, billing_information: map{business_activity: str, company_name: str, taxpayer_type: str}}} # OK
@errors {404: Order Not Found.}

@endpoint GET /orders/search.json
@desc Retrieve an Orders List from a query.
@optional {locale: str(string) # Locale code of the translation, query: str(string) # Text to query for the Order, status_filters[]: str(string)(paid/created/pending_payment/canceled/abandoned) # Order Status to query for the Order, fulfillment_filters: str(string)(unfulfilled/fulfilled) # Comma separated values of the fulfillment filters to query for the Order, dateFilter: str(string)(today/yesterday/last30days/last7days/last90days/customDate) # Date to query for the Order., initialDate: str(string) # Starting date to query for the Order in the format YYYY-MM-DD. CustomDate and finalDate need to be used, finalDate: str(string) # Starting date to query for the Order in the format YYYY-MM-DD. CustomDate and initialDate need to be used, fields: str(string)(id/tax/...) # Comma separated values of the fields to query for the Order, limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) {orders: [map], count: int} # OK
@errors {404: Invalid query.}

@endpoint GET /orders/after/{id}.json
@desc Retrieve orders filtered by Order Id.
@required {id: int(int32) # Id of the Order}
@returns(200) {order: map{id: int(int32), source: map{created_from: str, created_from_app_code: str, source_name: str, medium: str, campaign: str, referral_url: str, referral_code: str, user_agent: str, first_page_visited: str, first_page_visited_at: str, referral_source: str}, created_at: str, completed_at: str, currency: str, subtotal: num(float), tax: num(float), shipping_tax: num(float), shipping: num(float), shipping_required: bool, total: num(float), discount: num(float), shipping_discount: num(float), gift_cards_discount: num(float), fulfillment_status: str, shipping_method_id: int(int32), shipping_service_id: int(int32), shipping_method_name: str, payment_method_name: str, payment_method_type: str, payment_information: str, payment_notification_id: str, additional_information: str, duplicate_url: str, recovery_url: str, review_url: str, checkout_url: str, coupons: str, promotions: [any], customer: map{id: int(int32), email: str, phone: str, phone_prefix: str, ip: str, fullname: str}, shipping_branch: map{id: int(int32), name: str}, shipping_address: map{name: str, surname: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, latitude: num, longitude: num, municipality: str, neighbourhood: str}, billing_address: map{name: str, surname: str, taxid: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, municipality: str, neighbourhood: str}, pickup_address: map{name: str, surname: str, address: str, city: str, postal: str, region: str, country: str, country_code: str, region_code: str, street_number: num, complement: str, municipality: str, pickup_place_name: str}, products: [map], additional_fields: [map], shipping_taxes: [map], status: str, status_name: str, status_enum: str, tracking_url: str, tracking_company: str, tracking_number: str, shipping_option: str, same_day_delivery: bool, shipment_status: str, shipment_status_enum: str, recovered_from: int(int32), external_shipping_rate_id: str, external_shipping_rate_description: str, billing_information: map{business_activity: str, company_name: str, taxpayer_type: str}}} # OK
@errors {404: Order Not Found.}

@endpoint GET /orders/{id}/history.json
@desc Retrieve all Order History.
@required {id: int(int32) # Id of the Order}
@returns(200) An array with Order History

@endpoint POST /orders/{id}/history.json
@desc Create a new Order History Entry.
@required {id: int(int32) # Id of the OrderHistory}
@optional {order_history: map{message: str, log: map}}
@returns(200) {order_history: map{id: int(int32), message: str, created_at: str}} # OK

@endpoint GET /orders/{id}/documents.json
@desc Retrieve all Documents from an  Order.
@required {id: int(int32) # Id of the Order}
@returns(200) An array with Documents

@endpoint POST /orders/{id}/documents.json
@desc Create a new Order Document Entry.
@required {id: int(int32) # Id of the Order}
@optional {document: map{document_type: int, external_id: str, public_id: str, url: str, order_id: int, app_code: str}}
@returns(200) {document: map{document_type: int, external_id: str, public_id: str, url: str, order_id: int, app_code: str}} # OK

@endpoint PUT /orders/{id}/documents/{public_id}.json
@desc Update a Document from an Order.
@required {id: int(int32) # Id of the Order, public_id: int(int32) # Public Id of the Document}
@optional {document_type: int(0 - credit note/1 - invoice) # Type of Document, external_id: str # Document ID on the external service, public_id: str # Human recognizable document ID, url: str # Document url}
@returns(200) {document: map{document_type: int, external_id: str, public_id: str, url: str, order_id: int, app_code: str}} # OK
@errors {404: Document Not Found.}

@endpoint DELETE /orders/{id}/documents/{public_id}.json
@desc Delete a Document from an Order.
@required {id: int(int32) # Id of the Order, public_id: int(int32) # Public Id of the Document}
@returns(200) OK
@errors {404: Page Not Found.}

@endgroup

@group fulfillments
@endpoint GET /fulfillments/count.json
@desc Count all Fulfillments.
@returns(200) {count: int(int32)} # OK

@endpoint POST /fulfillments/rates.json
@desc Rates for fulfillment.
@optional {rates: map{order_id: str, location_id!: str, shipping_address: map, packages_dimensions: [map]}}
@returns(200) OK

@endgroup

@group fulfillments.json
@endpoint GET /fulfillments.json
@desc Retrieve all Fulfillments.
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of Fulfillments

@endpoint POST /fulfillments.json
@desc Create a new Fulfillment.
@optional {fulfillment: map{order_id: str, type!: str, shipping_address: map, receiver_email: str, packages_dimensions: [map], location_id!: str, phone: str, phone_prefix: str, tracking_number: str, tracking_company: str, tracking_url: str, external_id: str, service_type: str, message: str, observations: str, expected_arrival_from: str, expected_arrival_to: str, send_email: bool}}
@returns(200) {fulfillment: map{id: int(int32), created_at: str, updated_at: str, tracking_number: str, tracking_company: str, type: str, shipment_status: str, label_url: str, expected_arrival_from: str, expected_arrival_to: str, fulfillment_address: map{address: map{name: str, surname: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}}, order_id: int(int32), order: map{order: map{order: map}}}} # OK

@endgroup

@group fulfillments
@endpoint GET /fulfillments/{id}/label.json
@desc Retrieve a presigned URL for the Fulfillment label
@required {id: int(int32) # ID of the Fulfillment}
@returns(200) {url: str, expires_at: str(date-time)} # Label URL retrieved successfully
@errors {400: Invalid Label - The label could not be generated or found, 404: Fulfillment Not Found}

@endpoint GET /fulfillments/{id}.json
@desc Retrieve a single Fulfillment.
@required {id: int(int32) # Id of the Fulfillment}
@returns(200) {fulfillment: map{id: int(int32), created_at: str, updated_at: str, tracking_number: str, tracking_company: str, type: str, shipment_status: str, label_url: str, expected_arrival_from: str, expected_arrival_to: str, fulfillment_address: map{address: map{name: str, surname: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}}, order_id: int(int32), order: map{order: map{order: map}}}} # OK
@errors {404: Fulfillment Not Found.}

@endpoint PUT /fulfillments/{id}.json
@desc Modify an existing Fulfillment.
@required {id: int(int32) # Id of the Fulfillment}
@optional {fulfillment: map{shipment_status: str, type: str, tracking_number: str, tracking_company: str, tracking_url: str, external_id: str, service_type: str, message: str, observations: str, expected_arrival_from: str, expected_arrival_to: str}}
@returns(200) {fulfillment: map{id: int(int32), created_at: str, updated_at: str, tracking_number: str, tracking_company: str, type: str, shipment_status: str, label_url: str, expected_arrival_from: str, expected_arrival_to: str, fulfillment_address: map{address: map{name: str, surname: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}}, order_id: int(int32), order: map{order: map{order: map}}}} # OK
@errors {404: Fulfillment Not Found.}

@endgroup

@group order
@endpoint GET /order/{id}/fulfillments.json
@desc Retrieve the Fulfillments associated with the Order.
@required {id: int(int32) # Id of the Order}
@returns(200) OK
@errors {404: Fulfillment Not Found.}

@endgroup

@group pages.json
@endpoint GET /pages.json
@desc Retrieve all Pages.
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of Pages

@endpoint POST /pages.json
@desc Create a new Page.
@optional {page: map{title: str, body: str, status: str, page_title: str, meta_description: str, categories: [int], template: str, permalink: str}}
@returns(200) {page: map{id: int, title: str, body: str, status: str, legal: bool, page_title: str, meta_description: str, categories: [map], template: map{id: int, name: str}, permalink: str, image: map{id: int, url: str}}} # OK

@endgroup

@group pages
@endpoint GET /pages/count.json
@desc Count all Pages.
@returns(200) {count: int(int32)} # Total number of pages

@endpoint GET /pages/{id}.json
@desc Retrieve a single Page by id.
@required {id: int(int32) # Id of the Page}
@returns(200) {page: map{id: int, title: str, body: str, status: str, legal: bool, page_title: str, meta_description: str, categories: [map], template: map{id: int, name: str}, permalink: str, image: map{id: int, url: str}}} # OK
@errors {404: Page Not Found.}

@endpoint PUT /pages/{id}.json
@desc Update a Page.
@required {id: int(int32) # Id of the Page}
@optional {page: map{title: str, body: str, status: str, page_title: str, meta_description: str, categories: [int], template: str, permalink: str}}
@returns(200) {page: map{id: int, title: str, body: str, status: str, legal: bool, page_title: str, meta_description: str, categories: [map], template: map{id: int, name: str}, permalink: str, image: map{id: int, url: str}}} # OK
@errors {404: Page Not Found.}

@endpoint DELETE /pages/{id}.json
@desc Delete an existing Page.
@required {id: int(int32) # Id of the Page}
@returns(200) OK
@errors {404: Page Not Found.}

@endpoint GET /pages/{id}/images.json
@desc Retrieve all Page Images.
@required {id: int(int32) # Id of the Page}
@returns(200) OK
@errors {404: Page Not Found.}

@endpoint POST /pages/{id}/images.json
@desc Create a new Page Image.
@required {id: int(int32) # Id of the Page}
@optional {image: map{url: str}}
@returns(200) {image: map{id: int(int32), url: str}} # OK

@endpoint GET /pages/{id}/images/count.json
@desc Count all Page Images.
@required {id: int(int32) # Id of the Page}
@returns(200) {count: int(int32)} # OK
@errors {404: Page Not Found.}

@endpoint GET /pages/{id}/images/{image_id}.json
@desc Retrieve a single Page Image.
@required {id: int(int32) # Id of the Page, image_id: int(int32) # Id of the Page Image}
@returns(200) {image: map{id: int(int32), url: str}} # OK
@errors {404: Page Not Found.}

@endpoint PUT /pages/{id}/images/{image_id}.json
@desc Update a Page Image url.
@required {id: int(int32) # Id of the Page, image_id: int(int32) # Id of the Page Image}
@optional {image: map{url: str}}
@returns(200) {image: map{id: int(int32), url: str}} # OK
@errors {404: Page or Image Not Found.}

@endpoint DELETE /pages/{id}/images/{image_id}.json
@desc Delete a Page Image.
@required {id: int(int32) # Id of the Page, image_id: int(int32) # Id of the Page Image}
@returns(200) OK
@errors {404: Page Not Found.}

@endgroup

@group customers.json
@endpoint GET /customers.json
@desc Retrieve all Customers.
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of Orders

@endpoint POST /customers.json
@desc Create a new Customer.
@optional {customer: map{email: str, phone: str, password: str, status: str, shipping_address: map, billing_address: map, customer_category: [int]}}
@returns(200) {customer: map{id: int(int32), email: str, phone: str, fullname: str, status: str, accepts_marketing: bool, accepted_marketing_at: str, cancelled_marketing_at: str, shipping_address: map{name: str, surname: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}, billing_address: map{name: str, surname: str, taxid: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}, customer_categories: [map], customer_additional_fields: [map]}} # OK
@errors {404: Customer Not Found.}

@endgroup

@group customers
@endpoint GET /customers/count.json
@desc Count all Customers.
@returns(200) {count: int(int32)} # OK

@endpoint GET /customers/email/{email}.json
@desc Retrieve a single Customer by email.
@required {email: str # Email of the Customer}
@returns(200) {customer: map{id: int(int32), email: str, phone: str, fullname: str, status: str, accepts_marketing: bool, accepted_marketing_at: str, cancelled_marketing_at: str, shipping_address: map{name: str, surname: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}, billing_address: map{name: str, surname: str, taxid: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}, customer_categories: [map], customer_additional_fields: [map]}} # OK
@errors {404: Customer Not Found.}

@endpoint GET /customers/{id}/orders.json
@desc Retrieve all orders of single Customer
@required {id: int # ID of the Customer}
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of Orders
@errors {404: Customer Not Found.}

@endpoint GET /customers/{id}/orders/status/{status}.json
@desc Retrieve all orders of single Customer
@required {id: int # ID of the Customer, status: str(Abandoned/Canceled/Pending Payment/Paid) # Status of the Order used as filter}
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of Orders
@errors {404: Customer Not Found.}

@endpoint GET /customers/{id}.json
@desc Retrieve a single Customer by id.
@required {id: int(int32) # Id of the Customer}
@returns(200) {customer: map{id: int(int32), email: str, phone: str, fullname: str, status: str, accepts_marketing: bool, accepted_marketing_at: str, cancelled_marketing_at: str, shipping_address: map{name: str, surname: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}, billing_address: map{name: str, surname: str, taxid: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}, customer_categories: [map], customer_additional_fields: [map]}} # OK
@errors {404: Customer Not Found.}

@endpoint PUT /customers/{id}.json
@desc Update a new Customer.
@required {id: int(int32) # Id of the Customer}
@optional {customer: map{email: str, phone: str, password: str, status: str, shipping_address: map, billing_address: map, customer_category: [int]}}
@returns(200) {customer: map{id: int(int32), email: str, phone: str, fullname: str, status: str, accepts_marketing: bool, accepted_marketing_at: str, cancelled_marketing_at: str, shipping_address: map{name: str, surname: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}, billing_address: map{name: str, surname: str, taxid: str, address: str, city: str, postal: str, municipality: str, region: str, country: str}, customer_categories: [map], customer_additional_fields: [map]}} # OK
@errors {404: Customer Not Found.}

@endpoint DELETE /customers/{id}.json
@desc Delete an existing Customer.
@required {id: int(int32) # Id of the Customer}
@returns(200) OK
@errors {404: Customer Not Found.}

@endpoint GET /customers/search.json
@desc Retrieve a Customer List from a query.
@required {query: str(string) # Text to query for the Customer. If empty return all customers.}
@optional {order: str(string)=asc # Sort Customers by creation date, 'asc' for ascending order or 'desc' for descending order., limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of Customers

@endgroup

@group customer_categories.json
@endpoint GET /customer_categories.json
@desc Retrieve all Customer Categories.
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of Customer Categories

@endpoint POST /customer_categories.json
@desc Create a new CustomerCategory.
@optional {customer_category: map{name: str}}
@returns(200) {customer_category: map{id: int(int32), name: str, code: str}} # OK
@errors {404: CustomerCategory Not Found.}

@endgroup

@group customer_categories
@endpoint GET /customer_categories/{id}.json
@desc Retrieve a single CustomerCategory.
@required {id: int(int32) # Id of the CustomerCategory}
@returns(200) {customer_category: map{id: int(int32), name: str, code: str}} # OK
@errors {404: CustomerCategory Not Found.}

@endpoint PUT /customer_categories/{id}.json
@desc Update a CustomerCategory.
@required {id: int(int32) # Id of the CustomerCategory}
@optional {customer_category: map{name: str}}
@returns(200) {customer_category: map{id: int(int32), name: str, code: str}} # OK
@errors {404: CustomerCategory Not Found.}

@endpoint DELETE /customer_categories/{id}.json
@desc Delete an existing CustomerCategory.
@required {id: int(int32) # Id of the CustomerCategory}
@returns(200) OK
@errors {404: CustomerCategory Not Found.}

@endpoint GET /customer_categories/{id}/customers.json
@desc Retrieves the customers in a CustomerCategory.
@required {id: int(int32) # Id of the CustomerCategory}
@returns(200) OK
@errors {404: CustomerCategory Not Found.}

@endpoint POST /customer_categories/{id}/customers.json
@desc Adds Customers to a CustomerCategory.
@required {id: int(int32) # Id of the CustomerCategory}
@optional {customers: [map{id: int(int32), email: str}]}
@returns(200) Array of Customers in the Customer Category
@errors {404: CustomerCategory Not Found.}

@endpoint DELETE /customer_categories/{id}/customers/{customer_id}.json
@desc Delete Customer from an existing CustomerCategory.
@required {id: int(int32) # Id of the CustomerCategory, customer_id: int(int32) # Id of the Customer}
@returns(200) OK
@errors {404: CustomerCategory or Customer Not Found.}

@endgroup

@group customers
@endpoint GET /customers/{id}/fields
@desc Retrieves the Customer Additional Field of a Customer.
@required {id: int(int32) # Id of the Customer}
@returns(200) OK
@errors {404: Customer Not Found.}

@endpoint POST /customers/{id}/fields
@desc Adds Customer Additional Fields to a Customer.
@required {id: int(int32) # Id of the Customer}
@optional {customer_additional_field: map{value: str, checkout_custom_field_id: int(int32)}}
@returns(200) {customer_additional_field: map{id: int(int32), label: str, value: str, area: str, customer_id: int(int32), checkout_custom_field_id: int(int32)}} # OK
@errors {404: Customer Additional Field Not Found.}

@endpoint GET /customers/{id}/fields/{field_id}
@desc Retrieve a single Customer Additional Field.
@required {id: int(int32) # Id of the Customer, field_id: int(int32) # Id of the Customer Additional Field}
@returns(200) {customer_additional_field: map{id: int(int32), label: str, value: str, area: str, customer_id: int(int32), checkout_custom_field_id: int(int32)}} # OK
@errors {404: Customer Not Found.}

@endpoint PUT /customers/{id}/fields/{field_id}
@desc Update a Customer Additional Field.
@required {id: int(int32) # Id of the Customer, field_id: int(int32) # Id of the Customer Additional Field}
@optional {customer_additional_field: map{value: str, checkout_custom_field_id: int(int32)}}
@returns(200) {customer_additional_field: map{id: int(int32), label: str, value: str, area: str, customer_id: int(int32), checkout_custom_field_id: int(int32)}} # OK
@errors {400: Customer Additional Field Bad Parameters., 404: Customer Additional Field Not Found.}

@endpoint DELETE /customers/{id}/fields/{field_id}
@desc Delete a Customer Additional Field.
@required {id: int(int32) # Id of the Customer, field_id: int(int32) # Id of the Customer Additional Field}
@returns(200) OK
@errors {404: Customer Not Found.}

@endgroup

@group promotions.json
@endpoint GET /promotions.json
@desc Retrieve all Promotions.
@optional {limit: int(integer) # Promotions' list restriction (default: 50 | max: 200)., page: int(integer) # Promotions' list page (default: 1).}
@returns(200) An array of Promotions

@endpoint POST /promotions.json
@desc Create a new Promotion.
@optional {promotion: map{name: str, enabled: bool, discount_target: str, buys_at_least: str, condition_price: num(float), condition_qty: int(int32), quantity_x: int(int32), type: str, discount_amount_fix: num(float), discount_amount_percent: num(float), lasts: str, begins_at: str, expires_at: str, max_times_used: int(int32), cumulative: bool, customers: str, categories: [map], categories_x: [map], customer_categories: [map], products: [map], products_x: [map], coupons: [map], countries: [str], regions: [str], municipalities: [str]}}
@returns(200) {promotion: map{id: int(int32), name: str, status: str, enabled: bool, discount_target: str, condition_price: num(float), condition_qty: int(int32), quantity_x: int(int32), discount_amount_fix: num(float), discount_amount_percent: num(float), lasts: str, begins_at: str, expires_at: str, times_used: int(int32), max_times_used: int(int32), cumulative: bool, categories: [map], customer_categories: [map], products: [map], products_x: [map], coupons: [map], countries: [str], regions: [str], municipalities: [str]}} # OK
@errors {404: Promotion Not Found.}

@endgroup

@group promotions
@endpoint GET /promotions/{id}.json
@desc Retrieve a single Promotion.
@required {id: int(int32) # Id of the Promotion}
@returns(200) {promotion: map{id: int(int32), name: str, status: str, enabled: bool, discount_target: str, condition_price: num(float), condition_qty: int(int32), quantity_x: int(int32), discount_amount_fix: num(float), discount_amount_percent: num(float), lasts: str, begins_at: str, expires_at: str, times_used: int(int32), max_times_used: int(int32), cumulative: bool, categories: [map], customer_categories: [map], products: [map], products_x: [map], coupons: [map], countries: [str], regions: [str], municipalities: [str]}} # OK
@errors {404: Promotion Not Found.}

@endpoint PUT /promotions/{id}.json
@desc Update a Promotion.
@required {id: int(int32) # Id of the Promotion}
@optional {promotion: map{name: str, enabled: bool, discount_target: str, buys_at_least: str, condition_price: num(float), condition_qty: int(int32), quantity_x: int(int32), type: str, discount_amount_fix: num(float), discount_amount_percent: num(float), lasts: str, begins_at: str, expires_at: str, max_times_used: int(int32), cumulative: bool, customers: str, categories: [map], categories_x: [map], customer_categories: [map], products: [map], products_x: [map], coupons: [map], countries: [str], regions: [str], municipalities: [str]}}
@returns(200) {promotion: map{id: int(int32), name: str, status: str, enabled: bool, discount_target: str, condition_price: num(float), condition_qty: int(int32), quantity_x: int(int32), discount_amount_fix: num(float), discount_amount_percent: num(float), lasts: str, begins_at: str, expires_at: str, times_used: int(int32), max_times_used: int(int32), cumulative: bool, categories: [map], customer_categories: [map], products: [map], products_x: [map], coupons: [map], countries: [str], regions: [str], municipalities: [str]}} # OK
@errors {404: Promotion Not Found.}

@endpoint DELETE /promotions/{id}.json
@desc Delete an existing Promotion.
@required {id: int(int32) # Id of the Promotion}
@returns(200) OK
@errors {404: Promotion Not Found.}

@endgroup

@group payment_methods.json
@endpoint GET /payment_methods.json
@desc Retrieve all Store's Payment Methods.
@returns(200) An array of Payment Methods

@endpoint POST /payment_methods.json
@desc Creates an External Payment Method.
@optional {payment_method: map{name: str, description: str, payment_method_url: str, key: str, secret: str, show_review: bool, use_new_version: bool}}
@returns(200) {payment_method: map{id: int(int32), type: str, name: str}} # OK
@errors {404: PaymentMethod Not Found.}

@endgroup

@group payment_methods
@endpoint GET /payment_methods/{id}.json
@desc Retrieve a single Payment Method.
@required {id: int(int32) # Id of the Payment Method}
@returns(200) {payment_method: map{id: int(int32), type: str, name: str}} # OK
@errors {404: PaymentMethod Not Found.}

@endgroup

@group shipping_methods.json
@endpoint GET /shipping_methods.json
@desc Retrieve all Store's Shipping Methods.
@optional {enabled: bool # If shipping method is enabled}
@returns(200) An array of Shipping Methods

@endpoint POST /shipping_methods.json
@desc Creates a Shipping Method.
@optional {shipping_method: map{type: str, name: str}}
@returns(200) {shipping_method: map{id: int(int32), type: str, name: str, enabled: bool, free_shipping: bool, free_shipping_minimum_purchase: bool, fee: [map], callback_url: str, fetch_services_url: str, state: str, city: str, postal: str, services: [map], tables: [map]}} # OK
@errors {404: ShippingMethod Not Found.}

@endgroup

@group shipping_methods
@endpoint GET /shipping_methods/{id}.json
@desc Retrieve a single Shipping Method.
@required {id: int(int32) # Id of the Shipping Method}
@returns(200) {shipping_method: map{id: int(int32), type: str, name: str, enabled: bool, free_shipping: bool, free_shipping_minimum_purchase: bool, fee: [map], callback_url: str, fetch_services_url: str, state: str, city: str, postal: str, services: [map], tables: [map]}} # OK
@errors {404: ShippingMethod Not Found.}

@endpoint PUT /shipping_methods/{id}.json
@desc Update a Shipping Method.
@required {id: int(int32) # Id of the Shipping Method}
@optional {shipping_method: map{type: str, name: str}}
@returns(200) {shipping_method: map{id: int(int32), type: str, name: str, enabled: bool, free_shipping: bool, free_shipping_minimum_purchase: bool, fee: [map], callback_url: str, fetch_services_url: str, state: str, city: str, postal: str, services: [map], tables: [map]}} # OK
@errors {404: Shipping Method Not Found.}

@endpoint DELETE /shipping_methods/{id}.json
@desc Delete an existing Shipping Method.
@required {id: int(int32) # Id of the Shipping Method}
@returns(200) OK
@errors {404: Shipping Method Not Found.}

@endgroup

@group locations.json
@endpoint GET /locations.json
@desc Retrieve all Store's Locations
@returns(200) An array of Pickup Locations

@endpoint POST /locations.json
@desc Create a Pickup Location
@required {name: str # Name of the location, email: str # Email for the location, address: str # Address of the location, city: str # City of the location, country: str # Country of the location}
@optional {main: bool # Is the main location, pickup_point: bool # Is a pickup_point, postal: str # Postal code of the location, Region: str # Region of the location}
@returns(200) {location: map{id: int(int32), name: str, email: str, active: bool, main: bool, pickup_point: bool, is_stock_origin: bool, location_address: map{id: int(int32), name: str, surname: str, address: str, street_number: str, complement: str, city: str, postal: str, country: str, region: str, type: str, taxid: str, taxid_type: str, default: bool, region_format: str, municipality: str, latitude: num(float), longitude: num(float)}}} # An array of Pickup Locations

@endgroup

@group locations
@endpoint GET /locations/{id}.json
@desc Retrieve a Store's Locations by ID
@required {id: int(int32) # Id of the Product}
@returns(200) OK
@errors {404: Location not found.}

@endpoint PUT /locations/{id}.json
@desc Update a Pickup Location
@required {id: int(int32) # Id of the Product, name: str # Name of the location, email: str # Email for the location, address: str # Address of the location, city: str # City of the location, country: str # Country of the location}
@optional {main: bool # Is the main location, pickup_point: bool # Is a pickup_point, postal: str # Postal code of the location, Region: str # Region of the location}
@returns(200) {location: map{id: int(int32), name: str, email: str, active: bool, main: bool, pickup_point: bool, is_stock_origin: bool, location_address: map{id: int(int32), name: str, surname: str, address: str, street_number: str, complement: str, city: str, postal: str, country: str, region: str, type: str, taxid: str, taxid_type: str, default: bool, region_format: str, municipality: str, latitude: num(float), longitude: num(float)}}} # An array of Pickup Locations

@endpoint DELETE /locations/{id}.json
@desc Delete a Store's Locations by ID
@required {id: int(int32) # Id of the Product}
@returns(200) OK
@errors {404: Location Not Found.}

@endgroup

@group custom_fields.json
@endpoint GET /custom_fields.json
@desc Retrieve all Store's Custom Fields.
@returns(200) An array of Custom Fields

@endpoint POST /custom_fields.json
@desc Create a new Custom Field.
@optional {custom_field: map{label: str, type: str, values: [str], product_visibility: bool}}
@returns(200) {custom_field: map{id: int(int32), label: str, type: str, values: [str], product_visibility: bool}} # OK

@endgroup

@group custom_fields
@endpoint GET /custom_fields/{id}.json
@desc Retrieve a single CustomField.
@required {id: int(int32) # Id of the CustomField}
@returns(200) {custom_field: map{id: int(int32), label: str, type: str, values: [str], product_visibility: bool}} # OK
@errors {404: CustomField Not Found.}

@endpoint PUT /custom_fields/{id}.json
@desc Update a CustomField.
@required {id: int(int32) # Id of the CustomField}
@optional {custom_field: map{label: str, type: str, values: [str], product_visibility: bool}}
@returns(200) {custom_field: map{id: int(int32), label: str, type: str, values: [str], product_visibility: bool}} # OK
@errors {404: CustomField Not Found.}

@endpoint DELETE /custom_fields/{id}.json
@desc Delete an existing CustomField.
@required {id: int(int32) # Id of the CustomField}
@returns(200) OK
@errors {404: CustomField Not Found.}

@endpoint GET /custom_fields/{id}/select_options.json
@desc Retrieve all Store's Custom Fields.
@required {id: int(int32) # Id of the CustomField}
@returns(200) An array of Custom Fields Select Options

@endpoint POST /custom_fields/{id}/select_options.json
@desc Create a new Custom Field Select Option.
@required {id: int(int32) # Id of the CustomField}
@optional {custom_field_select_option: map{value: str}}
@returns(200) {custom_field_select_option: map{id: int(int32), value: str}} # OK

@endpoint GET /custom_fields/{id}/select_options/{custom_field_select_option_id}.json
@desc Retrieve a single SelectOption from a CustomField.
@required {id: int(int32) # Id of the CustomField, custom_field_select_option_id: int(int32) # Id of the CustomFieldSelectOption}
@returns(200) {custom_field_select_option: map{id: int(int32), value: str}} # OK
@errors {404: CustomFieldSelectOption Not Found.}

@endpoint PUT /custom_fields/{id}/select_options/{custom_field_select_option_id}.json
@desc Update a SelectOption from a CustomField.
@required {id: int(int32) # Id of the CustomField, custom_field_select_option_id: int(int32) # Id of the CustomFieldSelectOption}
@optional {custom_field_select_option: map{value: str}}
@returns(200) {custom_field_select_option: map{id: int(int32), value: str}} # OK
@errors {404: CustomFieldSelectOption Not Found.}

@endpoint DELETE /custom_fields/{id}/select_options/{custom_field_select_option_id}.json
@desc Delete an existing CustomFieldSelectOption.
@required {id: int(int32) # Id of the CustomField, custom_field_select_option_id: int(int32) # Id of the CustomFieldSelectOption}
@returns(200) OK
@errors {404: CustomFieldSelectOption Not Found.}

@endgroup

@group checkout_custom_fields.json
@endpoint GET /checkout_custom_fields.json
@desc Retrieve all Checkout Custom Fields.
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of Checkout Custom Fields

@endpoint POST /checkout_custom_fields.json
@desc Create a new CheckoutCustomField.
@optional {checkout_custom_field: map{label: str, type: str, area: str, required: bool, position: int(int32), deletable: bool, custom_field_select_options: [str]}}
@returns(200) {checkout_custom_field: map{id: int(int32), label: str, type: str, area: str, required: bool, position: int(int32), deletable: bool, custom_field_select_options: [str]}} # OK
@errors {404: CheckoutCustomField Not Found.}

@endgroup

@group checkout_custom_fields
@endpoint GET /checkout_custom_fields/{id}.json
@desc Retrieve a single CheckoutCustomField.
@required {id: int(int32) # Id of the CheckoutCustomField}
@returns(200) {checkout_custom_field: map{id: int(int32), label: str, type: str, area: str, required: bool, position: int(int32), deletable: bool, custom_field_select_options: [str]}} # OK
@errors {404: CheckoutCustomField Not Found.}

@endpoint PUT /checkout_custom_fields/{id}.json
@desc Update a CheckoutCustomField.
@required {id: int(int32) # Id of the CheckoutCustomField}
@optional {checkout_custom_field: map{label: str, type: str, area: str, required: bool, position: int(int32), deletable: bool, custom_field_select_options: [str]}}
@returns(200) {checkout_custom_field: map{id: int(int32), label: str, type: str, area: str, required: bool, position: int(int32), deletable: bool, custom_field_select_options: [str]}} # OK
@errors {404: CheckoutCustomField Not Found.}

@endpoint DELETE /checkout_custom_fields/{id}.json
@desc Delete an existing CheckoutCustomField.
@required {id: int(int32) # Id of the CheckoutCustomField}
@returns(200) OK
@errors {404: CheckoutCustomField Not Found.}

@endgroup

@group countries.json
@endpoint GET /countries.json
@desc Retrieve all Countries.
@returns(200) An array of Countries

@endgroup

@group countries
@endpoint GET /countries/{country_code}.json
@desc Retrieve a single Country information.
@required {country_code: str(string) # ISO3166 Country Code}
@returns(200) {code: str, name: str} # A Country information object
@errors {404: Country Not Found.}

@endpoint GET /countries/{country_code}/regions.json
@desc Retrieve all Regions from a single Country.
@required {country_code: str(string) # ISO3166 Country Code}
@returns(200) An array of Regions from a single Country
@errors {404: Country Not Found.}

@endpoint GET /countries/{country_code}/regions/{region_code}/municipalities.json
@desc Retrieve all Municipalities from a single Region.
@required {country_code: str(string) # ISO3166 Country Code, region_code: str(string) # Region Code}
@returns(200) An array of Municipalities from a single Region
@errors {404: Country or Region Not Found.}

@endpoint GET /countries/{country_code}/regions/{region_code}.json
@desc Retrieve a single Region information object.
@required {country_code: str(string) # ISO3166 Country Code, region_code: str(string) # Region Code}
@returns(200) {code: str, name: str, iso: str} # A Region information object
@errors {404: Country or Region not found.}

@endgroup

@group taxes.json
@endpoint GET /taxes.json
@desc Retrieve all Taxes.
@returns(200) An array of Taxes

@endpoint POST /taxes.json
@desc Create a new Tax.
@optional {tax: map{country: str, name: str, region: str, category_id: int(int32), tax: num(float), fixed: bool, shipping: bool}}
@returns(200) {tax: map{id: int(int32), name: str, country: str, region: str, category_id: int(int32), tax_amount: num(float), fixed: bool, shipping: bool}} # OK
@errors {404: Tax Not Found.}

@endgroup

@group taxes
@endpoint GET /taxes/{id}.json
@desc Retrieve a single Tax information.
@required {id: int(int32) # Id of the Tax}
@returns(200) {tax: map{id: int(int32), name: str, country: str, region: str, category_id: int(int32), tax_amount: num(float), fixed: bool, shipping: bool}} # A Tax information object
@errors {404: Tax Not Found.}

@endgroup

@group store
@endpoint POST /store/setup.json
@desc Create a new store.
@required {store: map{name!: str, country: str, theme: str}}
@returns(201) {store: map{code: str, name: str, url: str, admin_url: str}, credentials: map{login: str, authtoken: str}} # Store created successfully.
@errors {400: Bad Request - invalid name or JSON body., 402: Payment Required - a paying subscription is required., 403: Forbidden - store creation is available 24 hours after first payment., 429: Too Many Requests - store creation limit exceeded (5 per day).}

@endgroup

@group carts
@endpoint GET /carts/{id}.json
@desc Obtain information for a cart.
@required {id: int(int32) # Id of the cart}
@optional {locale: str(string) # Locale code of the translation}
@returns(200) An array of Orders
@errors {404: Cart Not Found.}

@endgroup

@group documents.json
@endpoint GET /documents.json
@desc Retrieve all Documents from a Store.
@optional {limit: int(integer)=50 # List restriction, page: int(integer)=1 # List page}
@returns(200) An array of documents

@endgroup

@group transaction_ledger
@endpoint GET /transaction_ledger/balance.json
@desc Retrieve Store Balance.
@returns(200) Store Balance Information

@endgroup

@group products_locations
@endpoint GET /products_locations
@desc Stock by Product and Location
@required {location_ids: [int] # List of location IDs (comma separated), product_ids: [int] # List of product IDs (comma separated)}
@optional {variant_ids: [int] # List of variant IDs (comma separated)}
@returns(200) Array of products locations
@errors {404: Not found}

@endpoint PUT /products_locations
@desc Update Stock by Product and Location
@required {location_id: int, product_id: int, stock_unlimited: bool, stock: int}
@optional {variant_id: int}
@returns(200) Products locations updated successfully
@errors {400: Bad request, check your parameters, 500: Error while updating stock error}

@endgroup

@end
