Only this pageAll pages
Powered by GitBook
1 of 29

Developer Guides

Introduction

Loading...

Core

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

API

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Overview

Welcome to DotApparel Core

In this guide, you'll find all the documentation you need to get up and running with different aspects of DotApparel Core, our Apparel21 and Shopify solutionI.

Frontend

Frontend

This guide is for front-end developers who are building the user-facing elements of a website that incorporates DotApparel Core. It includes instructions for integrating with DotApparel's API, which powers website features such as gift cards, check stock, rewards programs, and retail transactions.

Welcome

DotApparel Developer Guides

Core
API
Future-Proof Apparel21 Integrations

Implementation & Testing

A merchant may have any one of the following front-end features:

  • Gift cards

  • Check stock

  • Sibling products

  • Rewards program

  • Retail transactions

Each of these features will need to be implemented and tested.

Steps for front-end implementation

At handover, the back-end app installation has already been taken care of, and we're ready to move on to front-end development in a staging environment. The DotApparel webhooks will be disabled while front-end development is in progress, then re-enabled for final testing on staging before going live in production.

  1. Review the front-end guide: Review the front-end guide before starting the implementation.

  2. Confirm the AP21 connection: The DotApparel staging app will be installed in a staging Shopify store and connected to a test Apparel21 instance (i.e., testApparel21Connection).

  3. Start front-end development: With the front-end guide and the suitable connection in place, start developing the front-end of the application as per the requirements. This would involve creating the user interface, setting up the product pages, and integrating it with DotApparel.

Front-end testing checklist

Make sure that the front end is usable (able to place test orders and sign up for the newsletter) and that the website is connected to the DotApparel app.

Testing and feedback: Once the front-end development is completed, you can share the work with the team for testing. They can provide feedback and suggest any changes or improvements needed before moving to the next step.

  • Enable webhooks: After all the necessary changes and feedback are incorporated into the front-end, webhooks can be enabled to start receiving real-time updates from DotApparel.

  • Final testing: Test the front-end with webhooks enabled to ensure everything is working as expected.

  • Go-live date: Once all testing scenarios have passed, DotApparel can be referred to the production instance, and go-live can be scheduled on a mutually agreed date that works for everyone.

    • Copy front-end code to production: On the morning of go-live, copy the front-end code from staging to the production environment.

    • Enable DotApparel syncing: The DotApparel team will enable automation/syncing for the app. Once this is done, DotApparel is officially live. 🎉

  • Make a Copy of the Front-end Test Cases

    Using the API endpoints

    Shopify App proxy

    Online store must not have the password page enable when calling the app proxy

    The DotApparel app itself is hosted in a serverless environment on Google Cloud. Each time the frontend needs to make an API request to the app to retrieve data, it will call a designated API endpoint for that type of data.

    Rather than making direct requests to the Google Cloud endpoints, we strongly recommend using the Shopify App proxy. Using the app proxy means that if your Shopify store is hosted on http://acme.myshopify.com , you would make a request to the following endpoint.

    • https://acme.myshopify.com/apps/dotapparel/[endpoint]

    • [Deprecated] https://acme.myshopify.com/apps/dotapparel21/[endpoint]

    Using the app proxy means that the browser is only making requests to the current domain, which negates the need to handle and other cross-origin concerns.

    When the DotApparel app is installed into your store, the API endpoints listed in this guide will always be available at /apps/dotapparel. The remainder of this guide will use the above domain as an example.

    Usage

    Each of the API endpoints is documented in the specific section. For example, if you’re looking to access in-store orders, see

    Reference

    Inventory

    Our base domain URL is https://api.dotapparel.io.

    CORS
    http://acme.myshopify.com
    retail transactions.
    Customers
    Inventory
    Orders
    Products
    Rewards
    Stores
    Vouchers
    Staff

    Retail transactions

    Being a POS platform, Apparel21 is able to capture physical in-store orders, as well as web orders. If the POS operator collects the customers' personal information at checkout, then the order will be attached to the Apparel21 “person” record associated with that customer.

    If the orders are attached to the relevant person in Apparel21 (using the same email address as the one used online), then it’s possible to show the customer a list of their in-store orders on the website.

    DotApparel achieves this by exposing an API endpoint which when called with the customer email address and a special signature, a live request is made to Apparel21 to fetch the retail transactions, before returning them back to the website frontend for display.

    Customer signatures

    All customer-specific endpoints in DotApparel are secured using an HMAC signature, which consists of the customer email address, signed using HMAC and a shared secret. This mechanism is in place such that unauthorized users cannot make requests for email addresses that do not belong to them.

    You should read the before proceeding.

    Using the API endpoints

    If you’re , then you can make a POST request to /apps/dotapparel/api-retailTransactions with the following JSON payload.

    Orders

    Our base domain URL is https://api.dotapparel.io.

    Customers

    Our base domain URL is https://api.dotapparel.io.

    Vouchers

    Our base domain URL is https://api.dotapparel.io.

    Overview

    Welcome to DotApparel API

    In this guide, you'll find all the documentation you need to get up and running with the DotApparel API.

    The API endpoints utilise basic authentication and feature access control based on user roles. The different roles and their respective scopes are:

    • admin: has unrestricted access

    Accounts

    The endpoints listed on this page are used for managing user authentication within DotApparel API. It typically includes endpoints for creating, updating, and deleting user accounts:

    1. Creating Users: The administrator is able to generate new user credentials with an assigned role.

    2. Updating Users: The administrator has the ability to modify the role or reset the password of a specific API user.

    3. Deleting Users: The administrator has the authority to revoke a user's authentication.

    Quick Start

    Our base domain URL is https://api.dotapparel.io. Before you get started, please make sure you have an account with us. If you do not have an account, please reach out to us to request an admin account.

    Get your API keys

    Our API uses basic authentication with username and password. To authenticate your requests, include your username and password as a header in your HTTP requests.

    Authorization: Basic <YOUR_API_KEY>

    Rewards

    Our base domain URL is https://api.dotapparel.io.

    Stores

    Our base domain URL is https://api.dotapparel.io.

    maintainer
    : can use all
    POST
    ,
    PUT
    , and
    GET
    methods except those linked to authentication
  • visitor: is only allowed to use GET methods

  • The admin user is responsible for managing the API users for authentication, which includes creating, updating, and deleting them. For more details, go to the Accounts page.

    If you're looking for more information about DotApparel, please head to the Merchant Guide.

    Ready to get started immediately?

    Feeling excited to dive right in? Check out our Quick Start Documentation and start making your first API request today!

    Looking to explore our API in detail?

    Take a deep dive into our API Reference and discover the full range of possibilities and functionalities available through our API:

    Accounts
    Quick Start
    Reference
    {
      "email": "[email protected]",
      "signature": "foobar"
    }
    customer signatures guide
    using the API endpoints

    This document is restricted to the administrator user only. If you wish to access other endpoints, please head to the API Reference.

    Our base domain URL is https://api.dotapparel.io.

    Make sure to include your username and password in the request header as described in the Authentication section above, as well as the X-DotApparel-Name header with the correct value for your account.

    Reference
    Please note that all API requests must be made over HTTPS.

    Make your first request

    To make your first API request, you will need to specify the API endpoint and any required parameters.

    Make sure to include your username and password in the request header as described in the Authentication section above, as well as the X-DotApparel-Name header with the correct value for your account.

    For example, if you want to retrieve a list of all stores, you can make a GET request to the following endpoint:

    You may want to consider using Postman to create your own requests or you can quickly view the API by using the following curl command.

    Take a look at how you might call this method using via curl:

    If successful, the API will return a JSON object containing the list of stores.

    That's it! You're now ready to start exploring our API documentation and building your own applications. If you have any questions or need further assistance, please do not hesitate to reach out to us at [email protected]. Happy coding!

    Sibling products

    To ensure each colour of a product has its own unique page and is listed separately on collection pages, DotDev recommends representing each colour as its own product in Shopify.

    However, since Shopify doesn't have a built-in relationship between these products, displaying a "swatch picker" that allows customers to switch between colours of the same style can be difficult for merchants.

    To solve this problem, DotApparel syncs tags to each product that detail its "siblings," allowing product detail pages to be linked together using Liquid or Javascript.

    Option A: Product sibling metafields

    DotApparel provides the "siblings" metafield, which is used to indicate sibling products. To enhance the product page, the frontend can be improved by utilising the new metafields structure to fetch information about sibling products.

    The "siblings" metafield is located within the "dotapparel21" namespace and contains relevant details about sibling products. This information includes the color name, color code, title, handle, publishing status, tags, and other related data.

    For example:

    Option B: Product sibling tags

    When a product has multiple colours, a series of sibling tags will be applied to the product, pointing at the Shopify product handles of each sibling colour. These tags include the "current" product in addition to the sibling colours, as often, the "current" colour will itself be displayed.

    Let's say we have an ACME T-Shirt which comes in Red, Green and Blue. It has the style code ABC. The Red product (which has handle abc-acme-tshirt-red) would have the following tags automatically written by the DotApparel app.

    • x-sibling-handle:abc-acme-tshirt-red

    • x-sibling-handle:abc-acme-tshirt-blue

    • x-sibling-handle:abc-acme-tshirt-green

    Liquid or Javascript can be used to loop over these tags, and fetch the full product data from Shopify using the attached handle. Then, the name of the colour, the image or anything else on the product as dictated by the design can be output in the swatch area, thus linking the products together.

    Prepending style codes to handles

    We strongly recommend including the product style code at the start of the product handle. This is so that handles are guaranteed to always be unique. Often, merchants will add an “acme-tshirt”, and then later on, perhaps years later, add another product with the same title, which Shopify will then assign “acme-tshirt-1” as the handle.

    Using handles which are not guaranteed to be unique, often causes issues for things like swatch resolution, so where possible, we always recommend prepending the style code.

    Gift Card validation API (Optional)

    Use the Gift Card validation API

    If there is a need to redeem the gift card outside the checkout page, specifically on the cart page, DotApparel offers a Gift Card validating API to address this scenario. The API endpoint employs the GET method and accepts query parameters such as the voucher number, PIN, and amount. Upon verifying the validity of the voucher number and PIN, the API will respond with a Shopify gift card code as part of the payload. Furthermore, the API will provide information about the available amount and other relevant details pertaining to the voucher. In this approach, the frontend can utilise the gift card code to include the gift card during the checkout process. For more comprehensive information, please refer to the section on the Gift Card validation API below.

    Use the new SKU structure

    Each denomination of the gift card and gift card type (physical or digital) should be defined as a separate variant of the Shopify product. The SKU structure should define the type and denomination so you might have AP21GIFTCARD-2124-0-1, AP21GIFTCARD-2124-0-2, AP21GIFTCARD-2124-0-3, AP21GIFTCARD-2124-0-4. The frontend template should allow the customer to select a gift card type (physical/digital) and then a denomination, which should select the appropriate variant.

    Update the custom line item attributes

    The custom line item attributes must have the following names.

    • From - This is the name of the sender.

    • To - This is the name of the receiver.

    • Email - This is the email of the receiver, for digital vouchers.

    Please note: Make sure all key names above are capitalised as they are case-sensitive within DotApparel.

    Gift Card validation API

    Check Gift Card balance API

    Customer signatures

    DotApparel's APIs are public by default because they are designed to be called from the website's front end. For endpoints that expose public data, like product availability or gift card balances, no authentication is necessary. However, for endpoints that return customer-specific data, such as retail transactions, authentication is required to prevent unauthorised access.

    To solve this problem, DotApparel requires an additional signature property, which is an HMAC of the customer's email address, for endpoints that identify customers with email addresses. The shared secret used to generate this HMAC is available in the DotApparel app backend and should never be made public to the website's front end.

    Generating a signature

    To generate an HMAC signature, you must have access to a secure environment, where the shared secret will not be exposed to the front-end.

    • If you have a Shopify Liquid theme, then you can generate the secret using a Liquid filter, and store the shared secret in your theme settings

    • If you have a headless front-end, then we recommend generating the signature using a serverless function, after you have authenticated the customer using your own methods

    Using a Liquid filter

    Generating the HMAC signature in a Liquid theme is trivial because Shopify already handles the customer authentication for you. Inside a Liquid theme, if you have access to the {{ customer }} object, then you know that the customer has already authenticated, thus you can generate a signature for them using the .

    When the signature is available on the page, you can then use it in the Javascript helper to access a customer instance, or use it to directly call the API endpoints.

    Check stock

    The Check stock API endpoint receives an SKU parameter for a particular product. The SKU can be found in the Shopify variant sku attribute.

    In return, DotApparel will respond with a list of inventory locations, identified by their Apparel21 store ID, and the current stock level for each location. This data should be matched with the enriched store data stored elsewhere, and displayed to the customer.

    1. Make a request

    Make a

    Products

    Our base domain URL is https://api.dotapparel.io.

    curl -X 'GET' \
      'https://api.dotapparel.io/stores' \
      -H 'accept: application/json' \
      -H 'X-DotApparel-Name: YOUR_VALUE' \
      -H 'Authorization: Basic YOUR_API_KEY'

    Message - Personal message, included in the email.

  • Email Subject (Optional) - This will override the email subject of the voucher.

  • {% if customer and customer.email %}
      <script id="CustomerEmail">{{ customer.email }}</script>
      <script id="CustomerSig">{{ customer.email | hmac_sha256: 'secret_key' }}</script>
    {% endif %}
    hmac_sha256 filter
    GET
    request to
    /apps/dotapparel/api-checkStock?sku=
    from the frontend of your Shopify store. This uses the
    to pass the request through to the DotApparel backend for calculation.

    For example, if the Shopify sku is 9328088450762, you can make a GET request to /apps/dotapparel/api-checkStock?sku=9328088450762

    The proxy URL path /apps/dotapparel could be different depending on the specific setup of the Shopify app proxy. It is important to take into account that certain earlier versions of DotApparel might require using an alternative URL path, /apps/dotapparel21. In this case, the example request URL will be /apps/dotapparel21/api-checkStock?sku=9328088450762

    2. Parse the response

    The response will look like the example below.

    Each entry in the data array corresponds to a store in which that product is stocked. If a store is missing, it means that the item is not currently stocked at that location.

    The storeId and storeNumber attributes are taken directly from Apparel21. The storeId is a unique ID that Apparel21 assigns to the store, which makes be different between Apparel21 instances. The storeNumber attribute is manually entered by your administrator when setting up stores. Therefore, we recommend using storeNumber to identify stores.

    Shopify app proxy
    [
      {
        "colourName": "white",
        "colourCode": "WHT",
        "handle": "regular-raised-neck-l-s-t-shrt-pc19wjt145-white",
        "isCurrentProduct": false,
        "productLegacyResourceId": "8405009629485",
        "published": false,
        "imageUrl": null,
        "colourHex": null,
        "colourGroup": null,
        "styleCode": "PC19WJT145",
        "title": "regular raised neck long sleeve t.shirt",
        "tags": [
          "link-PC19WJT145",
          "swatch-white",
          "x-colourCode:WHT",
          "x-dotapparel",
          "x-mappingIndex:35102-92279",
          "x-markdown:no",
          "x-sibling-handle:regular-raised-neck-l-s-t-shrt-pc19wjt145-black",
          "x-sibling-handle:regular-raised-neck-l-s-t-shrt-pc19wjt145-white",
          "x-styleCode:PC19WJT145",
        ],
        "images": [
          {
            "altText": "PC19WJT145_WHT_1",
            "url": "https://cdn.shopify.com/s/files/1/0695/7518/0311/products/RE24DR036_REGRN085_01.jpg",
          },
          {
            "altText": "PC19WJT145_WHT_2",
            "url": "https://cdn.shopify.com/s/files/1/0695/7518/0311/products/RE24DR036_REGRN085_01.jpg",
          }
        ],
        "minPrice": 99.99,
        "maxPrice": 159.99,
      },
      { ... }
    ]
    GET https://{shopDomain}/apps/dotapparel21/api-giftcardValidation?
    
    // Query parameters
    number   // voucher number e.g. 2062389
    pin      // PIN number e.g. 7452
    amount   // validation amount e.g. 100
    
    // Response
    {
        "data": {
            "voucher_number": "2062389",
            "expiry_date": "2026-07-07",
            "original_amount": "150.00",
            "original_amount_int": 15000,
            "used_amount": "0.00",
            "used_amount_int": 0,
            "available_amount": "150.00",
            "available_amount_int": 15000,
            "validated_amount": "100.00",
            "validated_amount_int": 10000,
            "shopify_code": "16892131261792389",
            "shopify_expires_at": null
        }
    }
    
    POST https://{shopDomain}/apps/dotapparel21/api-checkGiftcardBalance
    
    {
        "number": "4213925",
        "pin": "30411"
    }
    
    // Response
    {
      status: "success",
      data: {
        voucherNumber: "4213925",
        expiryDate: "2023-12-01",
        originalAmount: "100",
        usedAmount: "0",
        availableAmount: "100",
      },
    }
    const email = document.getElementById("CustomerEmail").innerHTML;
    const signature = document.getElementById("CustomerSig").innerHTML;
    
    // call this once on your page
    window.dotapparel21.setCustomer({ email, signature });
    
    // window.dotapparel21.customer is now available
    const retailTransactions = await window.dotapparel21.customer.retailTransactions();
    // GET /apps/dotapparel/api-checkStock?sku=9328088450762
    
    // Or GET /apps/dotapparel21/api-checkStock?sku=9328088450762
    
    {
      "data": [
        {
          "type": "inventoryLevel",
          "id": "5226-9328088450762",
          "attributes": {
            "sku": "9328088450762",
            "storeName": "High Street",
            "storeId": 5226,
            "storeNumber": 204,
            "freeStock": 1
          }
        }
      ]
    }

    Gift cards

    DotApparel integrates Apparel21 "vouchers" with Shopify for purchase, redemption, and balance checking. Apparel21 vouchers, similar to "gift cards" in e-commerce, have a voucher number, PIN, and balance.

    Using Apparel21 vouchers instead of Shopify gift cards allows customers to purchase and redeem vouchers at the point of sale (POS), enabling immediate online or in-store redemption.

    It's important to note that Apparel21 is always the source of truth for vouchers in this model. When redeeming a voucher in Shopify, DotApparel verifies the PIN and balance directly with Apparel21 before applying it to the order.

    Prerequisites

    If setting up AP21 gift voucher:

    • Apparel21 SKU IDX

    • Apparel21 voucher type

    If the merchant is using Shopify gift card:

    • Apparel21 SKU IDX (dummy)

    "dummy" is used for mapping order line items with an AP21 sku idx when purchasing a Shopify gift card. This can ensure the order is synced without issues (such as "cannot parse sku idx for xxxxx").

    If setting up any other new payment gateway

    • Ap21 Merchant ID

    • Card Type

    Implement Gift Cards with DotApparel

    1. Install DotApparel Voucher Widget or Checkout UI Extension

    JS Widget

    In layout/checkout.liquid, add the following just before the </head> tag.

    Note: If a previous custom Gift Card exists, you may need to remove this from the codebase.

    Checkout UI Extension

    Find the Gift Card Redemption app and add it to the checkout customization.

    2. Use the new SKU structure

    Each denomination of the gift card and gift card type (physical or digital) should be defined as a separate variant of the Shopify product. The SKU structure should define the type and denomination so you might have giftcard-p-20, giftcard-p-40, giftcard-e-20, giftcard-e-40. The frontend template should allow the customer to select a gift card type (physical/digital) and then a denomination, which should select the appropriate variant.

    3. Update the custom line item attributes

    The custom line item attributes must have the following names.

    • From - This is the name of the sender.

    • To

    4. Test Gift Cards

    The Gift Card form appears in the checkout

    Ensure that the request is sent to the DotApparel api-giftcardValidation endpoint.

    Purchasing vouchers

    Purchasing vouchers in Shopify works like any other product, with the addition of some custom line item attributes which allow the customer to provide attributes such as the receivers name, email, and a personal message which is either included in the email (if it's a digital voucher) or included with the plastic card (if it's a physical voucher).

    An example of this in action can be found at . The gift card itself is an ordinary Shopify product, which is manually created directly in Shopify. A custom product template is used to show the additional fields, which when added to the cart, are stored as line item attributes.

    Each denomination of the gift card and gift card type (physical or digital) should be defined as a separate variant of the Shopify product. The SKU structure should define the type and denomination so you might have giftcard-p-20, giftcard-p-40, giftcard-e-20, giftcard-e-40. The frontend template should allow the customer to select a gift card type (physical/digital) and then a denomination, which should select the appropriate variant.

    When added to the cart with these attributes, the rest of the process works like any other product through to checkout. When DotApparel receives the order, it will send the appropriate attributes to Apparel21 where a new voucher will be generated, and in the case of a digital voucher, an email will be sent directly from Apparel21 to the receiver, containing the voucher number and PIN.

    Reducing fraud risk

    Gift vouchers are subject to a high risk of fraudulent transactions. When a digital voucher is purchased, Apparel21 will immediately generate a voucher and email it to the receiver. If the purchaser has used fraudulent card details, this means that the merchant could be subject to a chargeback, but the attacker has already received their voucher number and PIN. By the time the fraud has been detected, the attacker could have purchased physical items from a store using the voucher at POS, which would not be recoverable.

    DotDev strongly recommends that the Shopify system is utilised to detect potentially fraudulent transactions. Orders which are marked as fraud can be prevented from reaching Apparel21 using the following process.

    1. In Shopify, configure transactions do not automatically capture, this means that by default, all payments will be authorized but not yet captured

    2. Install and configure the app to check the fraud rating assigned by Shopify to each order, and also the value of any gift cards added to the order

    3. If Shopify has assigned the order a low fraud rating, and the value of the gift cards is low (e.g. under $500), set Shopify Flow to automatically capture the payment on the order, this will result in the order flowing through to Apparel21 and the voucher being generated/sent

    Redeeming vouchers

    As the Apparel21 voucher redemption process is quite complicated, DotDev provides a premade Javascript widget to be included in the checkout template. This widget will display the Apparel21 gift card form, and perform the logic required to redeem the voucher.

    DotApparel provides a solution for redeeming Apparel21 vouchers at the Shopify checkout. This requires checkout customisations to be enabled, which is only available on the Shopify Plus plan as a custom form needs to be embedded into the checkout, to capture the voucher number and PIN.

    Shopify itself only understands Shopify gift cards, and there is no other mechanism for applying a voucher-type discount to a Shopify order. Therefore, the DotApparel solution works by first capturing the voucher number and PIN from the customer, before validating that information with Apparel21 to check the number, PIN, and balance.

    If the voucher is valid, a temporary Shopify gift card is created equal to the balance of the Apparel21 voucher. Behind the scenes, the Shopify gift card is applied to the checkout which reduces the payable amount. However, due to the checkout customisations, it looks like the Apparel21 voucher itself has been applied against the order.

    When the order is completed, DotApparel detects that a Shopify gift card has been applied against the order, and swaps it out for the real Apparel21 voucher before sending the order to Apparel21. When Apparel21 receives the order, the voucher balance is deducted accordingly.

    Because this solution uses temporary Shopify gift cards, it is to be expected that the Shopify backend will show a list of gift cards in the admin panel. These gift cards should be ignored as they are only for internal purposes. It is not possible to use Shopify gift cards at the same time as Apparel21 vouchers, any vouchers must be generated in Apparel21.

    Check balance API

    Staff

    Our base domain URL is https://api.dotapparel.io.

    - This is the name of the receiver.
  • Email - This is the email of the receiver, for digital vouchers.

  • Message - Personal message, included in the email.

  • Email Subject (Optional) - This will override the email subject of the voucher.

  • Delivery Date (Optional) - This is the future date that the gift card will be delivered. The format is YYYY-MM-DD (e.g. 2023-10-20). Please don’t provide this attribute unless the purchased gift card will be delivered via email and email should be delayed.

  • Please note: Make sure all key names above are capitalised as they are case-sensitive within DotApparel.

    Please also note: If using Delivery Date , additional setup is required in Apparel21.

    If Shopify has assigned the order a high fraud rating, or the value of the gift cards in the order is suspiciously high (e.g. more than $500), do not automatically capture the order

  • Orders which have not automatically been captured will remain in Shopify in an authorized state and can be reviewed from within the Shopify admin panel

  • The merchant should manually review these orders, including contacting the customer for further identification details. If the customer cannot adequately identify themselves as a legitimate order, the order should be cancelled in Shopify, which will simply let the authorization expire (thus not costing the merchant any transaction fees). If the order is deemed to not be fraudulent, the merchant should capture the payment using the button in Shopify, which will then trigger the sync to Apparel21, thus generating and dispatching the voucher.

  • https://www.decjuba.com.au/products/gift-card
    Fraud prevention
    Shopify Flow
    <script src="https://unpkg.com/@dotdev/dotapparel-voucher-widget"></script>
    POST https://{shopDomain}/apps/dotapparel/api-checkGiftcardBalance
    
    {
        "number": "4213925",
        "pin": "30411"
    }
    
    // Response
    {
      status: "success",
      data: {
        voucherNumber: "4213925",
        expiryDate: "2023-12-01",
        originalAmount: "100",
        usedAmount: "0",
        availableAmount: "100",
      },
    }

    Shopify Local Pick-up

    Learn how to configure Local Pickup in your Merchants Shopify store, and customise pickup options.

    Headless Stores

    Prerequisites

    While there are no FE prerequisites for the checkout, to be able to query stock levels on the FE, you need the following:

    • Shopify Storefront API version 2023-04 or above

    • Stores set up in Shopify that allow in-store pickup

    The Hook

    To handle this, we’re best to create a useFindInStore hook — this would power a few parts:

    • Fetching user location

    • Fetching the product variant data

    • Handling errors

    The GraphQL Query

    The storeAvailability connection is available on the variant, so before you can run the query, the user should have already selected a variant (see 2 in need to knows).

    We can then present the user with the option to search for store stock. An example would be:

    With the following variables:

    This will return this response:

    From this response, you could flatten the array then sort by the distance:

    Example Implementation

    Whilst it is outdated, Tony Bianco is a good reference for how to implement native Shopify Pickup.

    On the PDP, the drawer uses Google Maps API to search for the user's location with autocomplete, or the Find My Location uses navigator.geolocation to get the user's current position.

    Links

    • PDP:

    • useFindStore Hook: (not the best reference because it’s outdated, but an okay-ish reference for how it all pieces together)

    • Find In Store Components:

    https://www.tonybianco.com/au/products/marcel-black-patent-10-5cm-heels
    https://gitlab.com/dotdevv/clients/tonybianco/tony-bianco-website/-/blob/main/app/src/hooks/useFindStore.tsx
    https://gitlab.com/dotdevv/clients/tonybianco/tony-bianco-website/-/tree/main/app/src/components/FindInStore
    query FindInsStoreVariantsAndLocations($handle: String!, $latitude: Float!, $longitude: Float!) {
    	product(handle: $handle) {
    		variantBySelectedOptions(selectedOptions: $selectedOptions) {
    			storeAvailability(first:250, near: { latitude: $latitude, longitude: $longitude }) {
    				edges {
    					node {
    						available
                            pickUpTime
    						location {
    							name
    							id
    							address {
    								formatted
    								latitude
    								longitude
    							}
    						}
    					}
    				}
    			}
    		}
    	}
    }
    variables: {
      handle: product?.handle,
    	selectedOptions: product?.activeVariant?.selectedOptions,
      latitude: coords.lat,
      longitude: coords.lng,
    }
    {
        "data": {
            "product": {
                "variantBySelectedOptions": {
                    "storeAvailability": {
                        "edges": [
                            {
                                "node": {
                                    "available": true,
                                    "pickUpTime": "Usually ready in 24 hours",
                                    "location": {
                                        "name": "Doncaster Store",
                                        "id": "gid://shopify/Location/60903817288",
                                        "address": {
                                            "formatted": [
                                                "619 Doncaster Road",
                                                "Shop 1013",
                                                "Doncaster VIC 3108",
                                                "Australia"
                                            ],
                                            "latitude": -37.7851115,
                                            "longitude": 145.1262028
                                        }
                                    }
                                }
                            },
                            {
                                "node": {
                                    "available": true,
                                    "pickUpTime": "Usually ready in 24 hours",
                                    "location": {
                                        "name": "Armadale Store",
                                        "id": "gid://shopify/Location/60898607176",
                                        "address": {
                                            "formatted": [
                                                "1080 High Street",
                                                "Armadale VIC 3143",
                                                "Australia"
                                            ],
                                            "latitude": -37.855974,
                                            "longitude": 145.023201
                                        }
                                    }
                                }
                            }
                        ]
                    }
                }
            }
        }
    }
    const getDistance = useCallback((pos1: any, pos2: any) => {
      if (!pos1 || !pos2) {
        return 0
      }
    
      const R = 6371 // Radius of the earth in km
      const dLat = deg2rad(pos2.lat - pos1.lat) // deg2rad below
      const dLon = deg2rad(pos2.lng - pos1.lng)
      const a =
        Math.sin(dLat / 2) * Math.sin(dLat / 2) +
        Math.cos(deg2rad(pos1.lat)) * Math.cos(deg2rad(pos2.lat)) * Math.sin(dLon / 2) * Math.sin(dLon / 2)
      const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
      return R * c
    }, [])
    
    const availability = edgeNormaliser(data?.product?.variantBySelectedOptions?.storeAvailability)
    const sortedAvailability = availability?.map(location => ({...location, distance: getDistance(userCoords, {lat:location?.location?.latitude, lng:location?.location?.longitude})}))?.sort((a: any, b: any) => parseInt(a?.distance) - parseInt(b?.distance))
    
    return storeAvailability

    Changelog

    This changelog is the source of truth for all changes to the DotApparel API.

    10 May 2024

    ADDED New query parameters updated_before and asc for /orders/transactions/search

    • The updated_before parameter enables users to filter and retrieve a list of retail transactions that were created before a specific date.

    • The asc is a boolean parameter that allows the sorting of retail transactions by saleDate in ascending order. e.g. asc=true

    Now users can limit order records for a specific date range by using both updated_before and updated_after.

    20 March 2024

    ADDED New fields emailSubscription and smsSubscription in the customers POST and PUT requests

    The POST and PUT "customers" endpoints now accept boolean fields emailSubscription and smsSubscription. If either of these fields is set to true, it will automatically override the privacy field to false.

    NOTE: Both emailSubscription and smsSubscription can modify customer references in Apparel21. However, this process requires mapping configuration within DotApparel Core. If you require assistance with this configuration, please reach out to [email protected]

    08 March 2024

    FIXED Both mobile and dateOfBirth attributes are optional in customer POST and PUT requests

    Resolved an issue where the customer creation or update requests could fail because both the mobile and dateOfBirth attributes were mandatory in the request payload.

    07 March 2024

    ANNOUNCEMENT Introducing new Staff endpoints

    We're thrilled to introduce new Staff endpoints equipped with pagination and filtering capabilities. This update brings improved efficiency to accessing staff data via our API.

    GET /staff?email=<value>&code=<value>

    GET /staff/{id}

    26 July 2023

    ADDED New store and loyalty fields in customers/search response payloads

    Now, the GET customers/search API responses include additional data related to the "sign-up" store code and loyalty program code/name.

    19 July 2023

    BREAKING The updateTimeStamp field is no longer required in Customers PUT request

    The updateTimeStamp field has been removed from the request payload of the Customers PUT method, as it will be handled internally.

    11 July 2023

    ANNOUNCEMENT Introducing new Retail Transactions and Customers endpoints with pagination and timestamp filtering support

    We are introducing highly efficient API endpoints for retrieving a list of customers or retail transaction data.

    GET /customers/search

    GET /orders/transactions/search

    The new endpoints implemented an optimised approach to enhance the speed and performance of data retrieval. The endpoints support pagination using a cursor-based approach, enabling retrieval of up to 100 records per page. They also support for querying data using a timestamp parameter, allowing for filtering based on updated records. For more detailed information and examples on how to utilise this new efficient endpoint, please refer to the API reference page.

    9 July 2023

    ANNOUNCEMENT Introducing Get All Payment Gateways endpoint

    We added a new API endpoint for developers to easily retrieve the list of available payment gateway names, enabling them to seamlessly pick up a desired gateway when posting orders or gift vouchers to Apparel21.

    5 July 2023

    ANNOUNCEMENT Introducing return creation endpoint

    We added a new API endpoint for developers to facilitate return creation in Apparel21. It is crucial to note that the SKU ID must be present on the original order for the return to be processed successfully. This new functionality enhances the flexibility and convenience of managing returns within Apparel21. Please refer to the Orders API documentation for detailed instructions on how to use this endpoint effectively.

    ANNOUNCEMENT Introducing voucher creation endpoint

    We are also introducing a new API endpoint for creating gift vouchers in Apparel21. This endpoint enables the creation of digital gift vouchers that can be sent to customers via email. Each gift voucher includes a voucher number and PIN that customers can use for making purchases. Prior to using this endpoint, it is important to ensure the configurations for Gift Card SKU IDX, Voucher Type and Gift Voucher function are in place. Please refer to the updated Vouchers API documentation for detailed instructions on how to utilise this endpoint and complete the necessary configurations in DotApparel and Apparel21.

    27 June 2023

    ANNOUNCEMENT Introducing rewards endpoints

    We have implemented new endpoints that interact with the Apparel21 Rewards feature to retrieve essential information regarding retail rewards and gifts. This data can be used to display the shopper's reward balance accurately on the website. By utilising these endpoints, the website can seamlessly retrieve and present the necessary details related to retail rewards and gifts, ensuring an up-to-date and accurate representation of the shopper's reward balance.

    ANNOUNCEMENT Introducing vouchers endpoints

    We are introducing new endpoints that encapsulate the functionality of the Apparel21 Gift Vouchers feature. This includes retrieving information about a gift voucher and locking a gift voucher.

    26 June 2023

    FIXED Retrieving customers by updated_after parameter requires the AP21 Retail API version to be 2022.1 or higher

    In the event that the AP21 Retail API falls below the required version, the endpoint will respond with an empty array. To ensure proper functionality, it is crucial to verify the current API version with the merchant and initiate an upgrade if it is determined to be necessary.

    23 June 2023

    ADDED New contact field in customer response payloads

    The customer response now includes a new field called contact which is an object including email and phones. This field is a replacement for the existing contacts field.

    BREAKING The updateTimeStamp and startDate fields in customer response have some changes

    More details

    The updateTimeStamp is now mandatory in the response payload

    The value of both fields has changed the format to YYYY-MM-DD HH:MM:SS

    22 June 2023

    ADDED New Shopify ID fields in customer response payloads

    The customer response now includes two new fields called shopifyAdminId and shopifyLegacyId, which represents customer id in Shopify. Please note that these fields are not included in the response when using the "updated_after" parameter in a GET request.

    FIXED Changing some address field names to using "camel" format in customer response payloads

    The affected fields are addressLine2, state, city, postcode, and country

    5 May 2023

    ANNOUNCEMENT Introducing retail transactions endpoint

    DotApparel API now supports looking up retail history for a shopper; including store sales, head office telephone/mail sales and web system sales.

    21 April 2023

    FIXED Changing customer privacy in Apparel21

    DotApparel API now allows the modification of a customer's accept market status within Apparel21.

    17 April 2023

    ANNOUNCEMENT Introducing customer list endpoint

    DotApparel API now supports returning a list of Apparel21 customers using a given update_after query parameter.

    5 April 2023

    ADDED New fields in API response payloads

    This implementation involves updating the store, inventory, product and customer endpoints.

    More details
    • Modified store endpoints to return mapped Shopify location ID.

    • Modified inventory endpoints to return store inventory buffer.

    10 March 2023

    ANNOUNCEMENT Introducing DotApparel API

    The initial release of the API layer project.

    Modified product endpoints to return Shopify SKU for each Apparel21 colour size.
  • Modified customer endpoints to retrieve the actual reference value from DotApparel's reference cache instead of just the reference ID.

  • Staff
    Orders
    Customers
    Orders
    Vouchers

    Rewards program

    DotApparel will expose an endpoint POST /api-rewardsAccount that accepts an email address and returns the details of the rewards account of the given customer.

    The frontend will need to call the endpoint directly to get “rewards account” details.

    Rewards Account Creation

    If a customer does not have any rewards account in AP21, the endpoint is able to automatically create a new rewards account and proceed with the new account. (Please note that this option should be enabled in the app’s settings)

    Rewards Tier Tags Synchronisation

    When Sync customer rewards tier tags is enabled in DotApparel rewards settings:

    • DotApparel will automatically add a tag in the format x-loyalty:{tierName} to the Shopify customer

    • The tag prefix (e.g., x-loyalty) is configurable in the settings

    Endpoint

    Request:

    Response:


    Adding Reward to Orders

    UI extension is available for this Reward Redemption process.

    Please contact support if you have the enabled.

    Endpoints

    Get Reward Balance

    Request:

    Response:

    UI example

    Guest checkout

    Customer logged in (Hide the form if the available balance is 0)

    Form validations

    It is important to ensure that all necessary validations are performed before requesting the redeem reward endpoint. The following validations are crucial:

    • The "amount to redeem" must not exceed the available balance.

    • Once the cart has a "REWARD" discount applied to it, the available balance must be calculated on the front end. Please note that the "available_rewards" value won't be reflected in the "Get Rewards Balance" API until the order is created.

    Recommended workflow

    • The front-end team is responsible for designing the redemption solutions and workflow on the website. This includes creating a user interface for customers to enter and apply their reward amount during the checkout process.

    • The frontend team should ensure that the Discount Application Title is set to "Reward Redemption" within the Shopify Scripts implementation. This title is crucial for correctly identifying and applying the reward amount as a discount when sending an order to AP21.

    1. Make an API call to the Get Reward Balance endpoint to retrieve the available balance (available_rewards) for the customer.

    2. When a customer wishes to use their rewards, you'll need to add a "reward_amount" to the cart to trigger the Shopify Scripts that handle the rewards redemption. Follow these steps:

      • When the customer enters an amount to redeem their reward, programmatically add the relevant line item properties to the cart item(s) using Shopify's cart API.

    Example discount_application of Reward Redemption in Shopify orders


    Adding a Gift Product to Orders

    • To apply the reward amount as a discount, you need to implement a Shopify Script. This script will identify the Loyalty Reward product in the cart and transform the reward amount into a discount. Follow these steps:

      • Create a new Shopify Script or modify an existing one to handle the Loyalty Reward redemption.

      • In the script, identify the Loyalty Reward product in the cart by checking the line item properties.

    Similar to the "Rewards" redemption, DotApparel also provides the available gifts in the API response that a customer earned from a reward program.

    The recommended workflow:

    1. Make an API call to the DotApparel API endpoint to retrieve the available gifts for the customer.

    2. When a customer wishes to redeem a gift, they need to add the corresponding gift product to their cart along with relevant line item properties. Follow these steps:

      • When the customer selects the option to redeem a gift, programmatically add the gift card product to their cart using Shopify's cart API.

    • The front-end team is responsible for designing and implementing the redemption solutions and workflow on the website. This includes creating a user-friendly interface that allows customers to easily select and apply their earned gifts during the checkout process.

    • It is important to ensure that the gift products are set to a price of zero in the order. The front-end team should ensure that the necessary adjustments are made to the price of the gift product when it is added to the customer's cart.

    Example payload of Gift Redemption discount and item in Shopify orders

    Include the necessary line item properties (i.e. _reward_amount) that will be used to trigger the Shopify Scripts. These properties will indicate that the loyalty reward has been redeemed and will initiate the discount calculation.

  • To apply the reward amount as a discount, you need to implement a Shopify Script. This script will identify the loyalty reward amount that has been redeemed in the cart and transform the reward amount into a discount. Follow these steps:

    • Create a new Shopify Script or modify an existing one to handle the loyalty reward redemption.

    • In the script, identify the relevant info from the cart by checking the line item properties (i.e. _reward_amount)

    • Calculate and apply the discount equivalent to the reward amount.

    • Ensure that the "Discount Application Title" is set to "Reward Redemption" to correctly redeem the reward amount in Apparel21.

  • Please note each order can only have one reward discount application.

  • Calculate and apply the discount equivalent to the reward amount.

  • Ensure that the "Discount Application Title" is set to "Reward Redemption" to correctly redeem the reward amount in Apparel21.

  • Include the necessary line item properties (i.e. _gift_id) that will be used to identify the gift card and trigger the Shopify Scripts.
  • To apply the discount to gift products, you need to implement a Shopify Script. This script will adjust the price of the gift product to zero and apply the necessary discount. Follow these steps:

    • Create a new Shopify Script or modify an existing one to handle the Gift Redemption.

    • In the script, identify the gift card product in the cart by checking the line item properties.

    • Set the price of the gift card product to zero.

    • Ensure that the "Discount Application Title" is set to "Gift Redemption" to correctly apply the discount.

  • During the implementation of Shopify Scripts, the front-end team should ensure that

    • The Discount Application Title is set to "Gift Redemption."

    • The discount percentage should be set to 100%, and prevent any other discounts from applying to the gift items.

  • The Discount Application Title and percentage play a crucial role in correctly identifying and processing the gift redemption when sending the order to AP21.

  • new Shopify checkout custmosization
    POST https://{shopDomain}/apps/dotapparel/api-rewardsAccount
    
    {
      "email": "[email protected]"
    }
    {
      available_rewards: "0",
      gifts: [
        {
          created_at: "2021-05-27",
          description: "Test March Gift",
          expires_at: "2023-03-06",
          gift_id: "21", // previously called "id"
          options: [
            {
              handle: "abc-123",
              shopify_id: 1234567890,
            },
          ],
        },
      ],
      join_date: "2019-03-06", 
      tier_description: "$300 - $699", 
      tier_locked_until_date: "2021-09-01",
      tier_join_date: "2021-05-27", 
      tier_name: "Tier 2", 
      next_tier_id: "4",
      next_tier_name: "Business Class",
      reward_account_id: "461116", 
      rewards: [
        {
          available: "25.00",
          id: "163421",
          created_at: "2018-08-22",
          description: "Example Reward",
          expires_at: "2023-03-06",
          redeemed: "0.00",
          total: "25.00",
        },
      ],
      spend_to_next_tier: "700.00",
    }
    POST https://{shopDomain}/app/dotapparel/api-rewardsBalance
    
    {
        "email": "[email protected]"
    }
    {
        "data": {
            "available_rewards": "90", // Use this value as the available balance
            "join_date": "2021-05-03",
            "next_tier_name": "",
            "next_tier_id": "N/A",
            "tier_description": "Annual Spend $1800+",
            "tier_name": "Cashmere",
            "tier_join_date": "2023-06-05",
            "tier_locked_until_date": "2019-09-01",
            "rewards": [
                {
                    "available": "0",
                    "created_at": "2023-04-13T13:19:36",
                    "description": "DotDev Rewards TEST",
                    "expires_at": "2023-12-30",
                    "id": "43923",
                    "redeemed": "29",
                    "pending_redemption": "21",
                    "total": "50"
                },
                {
                    "available": "40",
                    "created_at": "2023-05-29T16:47:12",
                    "description": "DotDev Rewards TEST3",
                    "expires_at": "2023-12-30",
                    "id": "43945",
                    "redeemed": "10",
                    "pending_redemption": "0",
                    "total": "50"
                },
                {
                    "available": "50",
                    "created_at": "2023-05-29T17:12:23",
                    "description": "DotDev Rewards TEST3",
                    "expires_at": "2023-12-30",
                    "id": "43946",
                    "redeemed": "0",
                    "pending_redemption": "0",
                    "total": "50"
                }
            ],
            "reward_account_id": "22672"
        }
    }
    discount_applications": [
        // normal discount application
        {
            "target_type": "line_item",
            "type": "script",
            "value": "65.98",
            "value_type": "fixed_amount",
            "allocation_method": "across",
            "target_selection": "explicit",
            "title": "30% Off",
            "description": "30% Off"
        },
        // Reward Redemption discount application
        {
            "target_type": "line_item",
            "type": "script",
            "value": "20.0",
            "value_type": "fixed_amount",
            "allocation_method": "across",
            "target_selection": "explicit",
            "title": "Reward Redemption", // Ensure that the correct title is used
            "description": "Reward Redemption" 
        }
    ],
    
    {
    // ...
        "discount_applications": [
            // Reward Redemption
            {
                "target_type": "line_item",
                "type": "script",
                "value": "40.0",
                "value_type": "fixed_amount",
                "allocation_method": "across",
                "target_selection": "explicit",
                "title": "Reward Redemption",
                "description": "Reward Redemption"
            },
            // Gift Redemption
            {
                "target_type": "line_item",
                "type": "script",
                "value": "29.95",
                "value_type": "fixed_amount",
                "allocation_method": "across",
                "target_selection": "explicit",
                "title": "Gift Redemption", // Ensure that the correct title is used
                "description": "Gift Redemption"
            }
        ]
        // ...
        "line_items": [
            // ...
            {},
            // gift product item
            {
                "id": 1234567890,
                "name": "T-Shirt Black",
                "properties": [
                    {
                        "name": "_gift_id",
                        "value": "1234"
                    }
                ],
                "price": "29.95",
                // total discount amount should match the "price"
                "total_discount_set": {
                    "shop_money": {
                        "amount": "29.95",
                        "currency_code": "AUD"
                    }
                },
                // ...
                // ...
                // a discount_application should appear which indicates this discount to the order.discount_allocations above
                "discount_allocations": [
                    {
                        "amount": "29.95",
                        "amount_set": {
                            "shop_money": {
                                "amount": "29.95",
                                "currency_code": "AUD"
                            }
                        },
                        "discount_application_index": 1
                    }
                ]
            }
        ]
    }

    Create new API user

    post

    Scope: admin

    This endpoint creates a new API user by accepting required information, including email, password, and role.

    The endpoint checks that all required fields are present and that the email is not already associated with an existing user record. The role must be chosen from a predefined list of roles, including maintainer or visitor.

    If the required information is valid, the endpoint creates a new user record with the specified email, password, and role and returns a success message with the new user's ID or a JSON object containing their information

    Authorizations
    AuthorizationstringRequired
    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    emailstringRequiredExample: [email protected]
    passwordstringRequiredExample: your_password
    rolestring · enumRequiredExample: visitorPossible values:
    Responses
    201

    Successful response

    application/json
    400

    Bad Request: The request body was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    post
    /user

    Reset password or modify role for existing API user

    put

    Scope: admin

    This endpoint allows for the updating of an existing user with a specific email by changing the role or resetting the password.

    The endpoint accepts a JSON object in the request body that contains the new values for the user's email, password, and role. The email field is required but cannot be changed. The password field will be encrypted and stored in the database. The role field must be chosen from maintainer or visitor.

    Authorizations
    AuthorizationstringRequired
    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    emailstringRequired
    passwordstringOptional
    rolestring · enumOptionalExample: visitorPossible values:
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The request body was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    404

    Not Found: The user with the specified userId was not found.

    put
    /user

    Delete API user

    delete

    Scope: admin

    This endpoint deletes an existing API user by accepting required email.

    The response does not include a response body, only a response code. If the user is successfully deleted, the server will respond with a 204 No Content status code.

    Authorizations
    AuthorizationstringRequired
    Query parameters
    emailstringRequired

    The email address of the user to delete.

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The user with the specified email was not found.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The user does not have permission to perform this action.

    delete
    /user

    List all API users

    get

    Scope: admin

    This endpoint returns a list of all existing API users.

    Authorizations
    AuthorizationstringRequired
    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The user does not have permission to perform this action.

    get
    /user/list

    Retrieve inventory data of the given SKU from stores

    get

    Scope: visitor and above

    This endpoint retrieves inventory data by accepting a required SKU parameter.

    The endpoint checks that the SKU is valid and associated with an existing product record. If the SKU is valid, the endpoint retrieves inventory data for the SKU from multiple stores. The returned data is a list of object that includes the quantity of the SKU in stock, the location of the store, and any other relevant information related to the inventory.

    Authorizations
    Authorizationstring

    Returns some or all retail transactions based on timestamp filters

    get

    Scope: visitor and above

    This endpoint retrieves retail transaction details and utilises pagination with a cursor-based approach, allowing for a maximum of 100 transactions per page.

    You have the option to include a timestamp parameter to filter the results and retrieve transactions that occurred after the specified timestamp. If no timestamp is provided, all retail transactions are returned without any time-based filtering.

    The endpoint supports cursor pagination, where a cursor value is returned in the response, enabling navigation through the transaction results. The maximum number of transactions per page is limited to 100.

    Authorizations

    Retrieve all order of a customer in Apparel21

    get

    Scope: visitor and above

    Retrieve all order of a customer in Apparel21

    Authorizations
    AuthorizationstringRequired
    Path parameters

    Retrieve a single order in Apparel21

    get

    Scope: visitor and above

    Retrieve a single order in Apparel21

    Authorizations
    AuthorizationstringRequired

    Retrieve sales history for a person

    get

    Scope: visitor and above

    This endpoint retrieve a person's sales history across various channels, including in-store, telephone/mail orders, and web system sales. This endpoint is designed to display a comprehensive record of all sales that have been dispatched or picked up by the shopper. It is important to note that any items that are still on order will not be visible through this feature.

    The response is split into three main sections: Transaction Header, Transaction Detail, and Transaction Discount Detail. The Transaction Header provides key information about the transaction, including the type of transaction, the date and location it occurred, and the currency used. The Transaction Detail section contains detailed product information at the SKU level, including product codes, size, color, and pricing. The Transaction Discount Detail section includes information on any discounts applied, such as the type, reason, and amount.

    The endpoint does NOT include the following types of transactions made by a person: wholesale orders, debtor sales, customer orders, and account payments.

    List all payment gateway names

    get

    Scope: visitor and above

    This endpoint will retrieve a list of available payment gateway names.

    The returned information is typically used when posting orders or gift vouchers in Apparel21.

    Authorizations
    AuthorizationstringRequired
    Header parameters

    Create order in Apparel21

    post

    Scope: maintainer and above

    This endpoint allows for the creation of orders in the Apparel21 system.

    The endpoint accepts either Apparel21 SKU id or Shopify SKU. When sku id is not provided, the endpoint has the ability to search for SKU IDs in DotApparel based on SKUs. Additionally, the endpoint can map freight options from DotApparel based on shipping method titles. In order to use the endpoint, the user must provide a valid gateway name that matches the settings in DotApparel.

    To begin using the endpoint, the user must first search for the Apparel21 person ID using the customer endpoints. Once the person ID has been located, the user can then submit a JSON payload containing the person ID to create a new order in the Apparel21 system. This endpoint is designed to streamline the process of creating orders in Apparel21 by allowing users to easily locate the necessary information and submit it in a convenient format.

    Authorizations

    Create return in Apparel21

    post

    Scope: maintainer and above

    This endpoint allows you to create returns in Apparel21. You can specify the SKU ID directly or provide a SKU to search for the SKU ID in DotApparel. The SKU ID must be present on the original order for the return to be processed successfully.

    Authorizations
    AuthorizationstringRequired
    Header parameters

    Returns some or all customers based on timestamp filters

    get

    Scope: visitor and above

    This endpoint retrieves customer details and implements pagination using a cursor-based approach.

    You can optionally include a timestamp parameter to filter the results based on customer records updated after the provided timestamp. If no timestamp is provided, all customer details are returned without any time-based filtering.

    The endpoint supports cursor pagination, where a cursor value is included in the response to facilitate navigation through the results. The maximum number of records per page is limited to 100.

    Authorizations
    Authorization

    Retrieve customers by email or after a specific timestamp

    get

    Scope: visitor and above

    This endpoint retrieves customer details by accepting a parameter of either a valid email address or a specific timestamp.

    If an email address is provided, the endpoint checks that the email address is valid and associated with an existing customer record, and returns the person records that match the email entered.

    If a specific timestamp is provided, the endpoint checks that the timestamp is valid and no more than 7 days ago, and returns a list of person records that have been updated after the timestamp. It is important to be aware that this parameter requires the Apparel21 Retail API version 2022.1 or a more recent version.

    Authorizations

    Retrieve customer by Apparel21 Person ID

    get

    Scope: visitor and above

    This endpoint retrieves customer details by an associated Apparel21 Person ID.

    The endpoint checks that the email address is valid and associated with an existing customer record. If the ID is valid, the endpoint retrieves the customer's record and returns a success message with a JSON object containing their information.

    Authorizations
    Authorizationstring

    Create customer in Apparel21

    post

    Scope: maintainer and above

    This endpoint creates new customers by accepting required information including first name, last name, and unique email address, as well as optional contact number and address.

    The endpoint checks that all required fields are present and that the email is not already associated with an existing customer. If the required information is valid, the endpoint creates a new customer record and returns a success message with a JSON object containing the new customer's ID and their information.

    NOTE: The endpoint accepts boolean fields emailSubscription and smsSubscription. If either of these fields is set to true, it will automatically override the privacy field to false. Both of these fields can modify customer references in Apparel21. However, this process requires mapping configuration within DotApparel Core. If you require assistance with this configuration, please reach out to [email protected]

    Update customer in Apparel21

    put

    Scope: maintainer and above

    This endpoint updates existing customers by accepting optional information including first name, last name, contact number, and address.

    The endpoint checks that the first name and last name are not empty before updating the customer record. If the required information is valid, the endpoint updates the customer's record and returns a success message with a JSON object containing the customer's ID and their updated information.

    NOTE: The endpoint accepts boolean fields emailSubscription and smsSubscription. If either of these fields is set to true, it will automatically override the privacy field to false. Both of these fields can modify customer references in Apparel21. However, this process requires mapping configuration within DotApparel Core. If you require assistance with this configuration, please reach out to [email protected]

    Create gift voucher in Apparel21

    post

    Scope: maintainer and above

    This endpoint allows you to create a gift voucher in Apparel21. The gift voucher is a digital voucher that can be sent to customers via email, containing a pin number that can be used for making purchases. Before using this endpoint, ensure that the necessary configurations are set up in both DotApparel and Apparel21.

    Requirements:

    1. Gift Card SKU IDX: Make sure the SKU IDX for the gift card has been set up in DotApparel. This ensures that the appropriate product is associated with the gift voucher.

    2. Voucher Type: Ensure that the voucher type has been configured in DotApparel. This specifies the specific type of gift voucher being created.

    3. Gift Voucher Function: Confirm with your merchant that the gift voucher function has been properly set up in Apparel21. This ensures that the system can automatically send out an email containing the digital gift voucher and pin number to the customer.

    Retrieve Apparel21 gift voucher information or validate Apparel21 gift voucher

    get

    Scope: visitor and above

    This endpoint retrieves information about Apparel21 gift voucher as well as validate the gift voucher.

    The endpoint must accept a voucher number and a pin.

    To validate a gift voucher, add 'amount' field as a query parameter.

    The endpoint returns gift voucher information such as voucher number, expiry date, balance, used amount and validation id.

    Authorizations
    Authorization

    Lock Apparel21 gift voucher

    put

    Scope: visitor and above

    This endpoint is used to lock Apparel21 gift voucher.

    The endpoint must accept a voucher number and a validation id.

    Validation id is retrieved from the response after validating a gift voucher.

    The endpoint returns a 200 status code if successful.

    Authorizations
    AuthorizationstringRequired

    Retrieves a list of reward program details

    get

    Scope: visitor and above

    This endpoint retrieves information about reward programs in the Apparel21.

    The endpoint returns a list of object that includes information such as reward program id, name, tiers, and gifts.

    Authorizations
    AuthorizationstringRequired

    Retrieves a single reward account details by reward account id

    get

    Scope: visitor and above

    This endpoint retrieves information about a single reward account in the Apparel21 system by accepting a required reward account id parameter.

    The endpoint returns an object that includes information such as the associated program id, tier, rewards list, gift list and etc.

    Authorizations
    Authorization

    Updates a person's tier information

    put

    Scope: maintainer and above

    This endpoint updates a person's tier information.

    The endpoint returns an object that includes information such as the reward account id, program id, program name, tier details that the person is associated with.

    Authorizations
    AuthorizationstringRequired

    Retrieves a history of all points and reward accruals and redemptions

    get

    Scope: visitor and above

    This endpoint retrieves transaction history of a single reward account in Apparel21.

    The endpoint returns an object that includes information such as the associated program id, tier, rewards list, gift list and etc.

    Authorizations
    Authorization

    Creates a reward account for a person

    post

    Scope: maintainer and above

    This endpoint adds a person to a rewards program.

    This creates a reward account for the person and marks the new account as active'

    The endpoint returns an object that includes information such as the reward account id, program id, program name, tier details that the person is associated with.

    Authorizations
    AuthorizationstringRequired

    Creates a new reward to a person's reward account

    post

    Scope: maintainer and above

    This endpoint creates a reward for a reward account.

    This endpoint must accept personId, description, and amount in the request body. The rest are optional.

    The endpoint returns 201 status code if request is successful.

    Authorizations
    Authorization

    Creates a new gift to a person's reward account

    post

    Scope: maintainer and above

    This endpoint creates a gift for a reward account.

    This endpoint must accept personId, description, and gift id in the request body. The rest are optional.

    The endpoint returns 201 status code if request is successful.

    Authorizations
    Authorization

    Add points to a person's reward account

    post

    Scope: maintainer and above

    This endpoint adds points to a person's reward account.

    This endpoint must accept personId, points, and description id in the request body. The rest are optional.

    The endpoint returns 201 status code if request is successful.

    Authorizations
    Authorization

    Redeems a reward from a person's reward account

    post

    Scope: maintainer and above

    This endpoint redeems a reward from a person's reward account.

    This endpoint must accept personId, description, spend amount, amount, reference and auto confirm as part of the request body.

    The endpoint returns a request id that can be used on confirm or reversed unconfirmed request endpoint.

    Authorizations

    Redeems a reward from a person's reward account

    post

    Scope: maintainer and above

    This endpoint redeems a reward from a person's reward account.

    This endpoint must accept personId, description, spend amount, amount, reference and auto confirm as part of the request body.

    The endpoint returns a request id that can be used on confirm or reversed unconfirmed request endpoint.

    Authorizations

    Confirms reward redemption

    post

    Scope: maintainer and above

    This endpoint confirms an unconfirmed request and commit the pending redemption of points or rewards.

    This endpoint must accept a request id which is obtained from redeem reward or gift endpoint.

    The endpoint returns 201 code if successful.

    Authorizations
    AuthorizationstringRequired

    Reverses reward redemption

    post

    Scope: maintainer and above

    This endpoint reverses an unconfirmed request. This can only be done within 24 hours of a redemption request

    This endpoint must accept a request id which is obtained from redeem reward or redeem gift endpoint.

    The endpoint returns 201 code if successful.

    Authorizations
    AuthorizationstringRequired

    Retrieve multiple stores

    get

    Scope: visitor and above

    This endpoint retrieves information about stores in the Apparel21.

    The endpoint can accept particular Shopify location ID. If a location ID is provided, the endpoint will only look up the stores that are associated with the location.

    The endpoint returns a list of object that includes information such as the store id, store number, address and contact details.

    Authorizations
    AuthorizationstringRequired

    Retrieve a single store by store number

    get

    Scope: visitor and above

    This endpoint retrieves information about a single store in the Apparel21 system by accepting a required store number parameter.

    The endpoint checks that the store number is valid and associated with an existing store record. If the store number is valid, the endpoint retrieves the store's ID, store number, address, and contact information.

    Authorizations
    Authorizationstring

    Retrieve multiple stores

    get

    Scope: visitor and above

    This endpoint retrieves information about stores in the Apparel21.

    The endpoint can accept particular Shopify location ID. If a location ID is provided, the endpoint will only look up the stores that are associated with the location.

    The endpoint returns a list of object that includes information such as the store id, store number, address and contact details.

    Authorizations
    AuthorizationstringRequired

    Retrieve all styles with pagination

    get

    Scope: visitor and above

    This endpoint retrieves all styles from the Apparel21 system with pagination.

    The endpoint may accept optional parameters such as limit and cursor to control the amount of data returned. If no parameters are provided, the endpoint may return a default number of styles per page.

    The returned data includes a list of styles with their associated information such as product code(style code), description, reference, custom data, colours and sizes.

    Authorizations
    Authorizationstring

    Retrieve a single styles by id

    get

    Scope: visitor and above

    This endpoint retrieves a single style from the Apparel21 system by accepting a required style ID parameter.

    The endpoint checks that the style ID is valid and associated with an existing style record. If the style ID is valid, the endpoint retrieves the information for that specific style, including product code(style code), description, reference, custom data, colours and sizes.

    Authorizations
    Authorization

    Returns all staff members or based on specific filters

    get

    Scope: visitor and above

    This endpoint retrieves staff details and implements pagination using a cursor-based approach.

    You can optionally include a email or code parameter to filter the results based on staff member records. If no filter is provided, all staff details are returned without any condition.

    The endpoint supports cursor pagination, where a cursor value is included in the response to facilitate navigation through the results. The maximum number of records per page is limited to 100.

    Authorizations
    AuthorizationstringRequired

    Retrieve staff member by member ID

    get

    Scope: visitor and above

    This endpoint retrieves staff member details by an associated member ID.

    If the ID is valid, the endpoint retrieves the staff member's record and returns a success message with a JSON object containing their information.

    Authorizations
    AuthorizationstringRequired
    Required
    Query parameters
    skustringRequired

    Shopify SKU number

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The SKU was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    404

    Not Found: The inventory with the specified SKU was not found.

    get
    /inventory
    Query parameters
    shopifyLocationIdnumberOptional

    The Shopify location ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    get
    /stores
    Required
    Path parameters
    store_numbernumberRequired

    The Apparel21 store number

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The store number was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    404

    Not Found: The store with the specified store number was not found.

    get
    /stores/{store_number}
    Query parameters
    shopifyLocationIdnumberOptional

    The Shopify location ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    get
    /stores
    Required
    Query parameters
    limitnumberOptional

    The maximum number of styles to return

    Example: 50
    cursornumberOptional

    The query cursor to return a subset of data

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    get
    /products
    string
    Required
    Path parameters
    shopify_idnumberRequired

    The numeric Shopify product ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The productId was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    404

    Not Found: The product with the specified productId was not found.

    get
    /products/{shopify_id}
    Query parameters
    emailstringOptional

    Look up staff members using their email address

    codestringOptional

    Look up staff members using their code

    after_cursorstringOptional

    Returns staff members that come after the specified cursor

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    get
    /staff
    Path parameters
    staff_member_idnumberRequired

    The staff member ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The ID was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    404

    Not Found: The staff member with the specified ID was not found.

    get
    /staff/{staff_member_id}
    GET /inventory?sku=text HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "id": "101-PRD001-BLK-S",
          "sku": "PRD001-BLK-S",
          "storeId": 101,
          "storeNumber": 123,
          "storeName": "Store ABC",
          "freeStock": 30,
          "shopifyBuffer": 1
        }
      ]
    }
    GET /stores HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "storeId": 1001,
          "storeNumber": 123,
          "code": "EXAMPLE_STORE_CODE",
          "address1": "111 Cecil St",
          "address2": "Level 5",
          "city": "South Melbourne",
          "state": "VIC",
          "country": "Australia",
          "postcode": 3205,
          "name": "Example Store",
          "email": "[email protected]",
          "shopifyLocationId": 1234567
        }
      ]
    }
    GET /stores/{store_number} HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": {
        "storeId": 1001,
        "storeNumber": 123,
        "code": "EXAMPLE_STORE_CODE",
        "address1": "111 Cecil St",
        "address2": "Level 5",
        "city": "South Melbourne",
        "state": "VIC",
        "country": "Australia",
        "postcode": 3205,
        "name": "Example Store",
        "email": "[email protected]",
        "shopifyLocationId": 1234567
      }
    }
    GET /stores HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "storeId": 1001,
          "storeNumber": 123,
          "code": "EXAMPLE_STORE_CODE",
          "address1": "111 Cecil St",
          "address2": "Level 5",
          "city": "South Melbourne",
          "state": "VIC",
          "country": "Australia",
          "postcode": 3205,
          "name": "Example Store",
          "email": "[email protected]",
          "shopifyLocationId": 1234567
        }
      ]
    }
    GET /products HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "id": 123,
          "productCode": "MTS001",
          "sizeRange": "S-XXL",
          "name": "Men's T-Shirt",
          "description": "This classic crew-neck t-shirt is made with 100% cotton and is perfect for casual wear.",
          "updatedAt": "2023-02-27T09:30:00",
          "references": {
            "brand": {
              "code": "EB",
              "name": "ExampleBrand",
              "referenceValueId": 123
            },
            "category": {
              "code": "Tshirt",
              "name": "T-Shirts",
              "referenceValueId": 123
            }
          },
          "notes": {
            "careInstructions": "Machine wash cold, tumble dry low. Do not bleach."
          },
          "customData": {
            "online": {
              "newArrival": "true",
              "onlineExclusive": "true",
              "productType": "Casual"
            }
          },
          "colours": {
            "id": 123,
            "shopifyProductId": 1234567890,
            "colour": {
              "code": "text",
              "name": "text"
            },
            "markdownStatus": "None",
            "colourType": {
              "code": "text",
              "name": "text"
            },
            "references": {
              "subCategory": {
                "code": "Men",
                "name": "Men's",
                "referenceValueId": 123
              }
            },
            "notes": {
              "colour": "White"
            },
            "customData": {
              "online": {
                "newArrival": "false",
                "onlineExclusive": "false",
                "productType": "Casual"
              }
            },
            "sizes": {
              "id": 123,
              "sizeCode": "S",
              "originalPrice": 300,
              "price": 100,
              "sequence": 1,
              "barcode": "1234567890"
            }
          }
        }
      ],
      "meta": {
        "cursor": 1
      }
    }
    GET /products/{shopify_id} HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": {
        "id": 123,
        "productCode": "MTS001",
        "sizeRange": "S-XXL",
        "name": "Men's T-Shirt",
        "description": "This classic crew-neck t-shirt is made with 100% cotton and is perfect for casual wear.",
        "updatedAt": "2023-02-27T09:30:00",
        "references": {
          "brand": {
            "code": "EB",
            "name": "ExampleBrand",
            "referenceValueId": 123
          },
          "category": {
            "code": "Tshirt",
            "name": "T-Shirts",
            "referenceValueId": 123
          }
        },
        "notes": {
          "careInstructions": "Machine wash cold, tumble dry low. Do not bleach."
        },
        "customData": {
          "online": {
            "newArrival": "true",
            "onlineExclusive": "true",
            "productType": "Casual"
          }
        },
        "colours": {
          "id": 123,
          "shopifyProductId": 1234567890,
          "colour": {
            "code": "text",
            "name": "text"
          },
          "markdownStatus": "None",
          "colourType": {
            "code": "text",
            "name": "text"
          },
          "references": {
            "subCategory": {
              "code": "Men",
              "name": "Men's",
              "referenceValueId": 123
            }
          },
          "notes": {
            "colour": "White"
          },
          "customData": {
            "online": {
              "newArrival": "false",
              "onlineExclusive": "false",
              "productType": "Casual"
            }
          },
          "sizes": {
            "id": 123,
            "sizeCode": "S",
            "originalPrice": 300,
            "price": 100,
            "sequence": 1,
            "barcode": "1234567890"
          }
        }
      }
    }
    GET /staff HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "id": 1349,
          "averageSale": 349,
          "code": "JOHNSM00",
          "email": "[email protected]",
          "firstName": "John",
          "surname": "Smith",
          "fullName": "John Smith",
          "jobTitle": "MR",
          "firstSale": "2021-10-19",
          "last30daysTransactions": 46,
          "last30DaysSales": 16092,
          "lastSale": "2024-03-01",
          "lastSaleStore": "Retail Store",
          "loginCode": "JohnR",
          "memidx": 1349,
          "service": "2.3 Years",
          "totalSales": 289814,
          "totalTransactions": 830,
          "uniqueCustomers": 549
        }
      ],
      "meta": {
        "hasNextPage": true,
        "endCursor": "string"
      }
    }
    GET /staff/{staff_member_id} HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": {
        "id": 1349,
        "averageSale": 349,
        "code": "JOHNSM00",
        "email": "[email protected]",
        "firstName": "John",
        "surname": "Smith",
        "fullName": "John Smith",
        "jobTitle": "MR",
        "firstSale": "2021-10-19",
        "last30daysTransactions": 46,
        "last30DaysSales": 16092,
        "lastSale": "2024-03-01",
        "lastSaleStore": "Retail Store",
        "loginCode": "JohnR",
        "memidx": 1349,
        "service": "2.3 Years",
        "totalSales": 289814,
        "totalTransactions": 830,
        "uniqueCustomers": 549
      }
    }
    {
      "data": {
        "email": "[email protected]",
        "hash": "hash",
        "role": "visitor"
      }
    }
    {
      "data": {
        "email": "[email protected]",
        "hash": "hash",
        "role": "visitor"
      }
    }
    POST /user HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 78
    
    {
      "email": "[email protected]",
      "password": "your_password",
      "role": "visitor"
    }
    PUT /user HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 51
    
    {
      "email": "text",
      "password": "text",
      "role": "visitor"
    }
    DELETE /user?email=text HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        "text"
      ]
    }
    GET /user/list HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "email": "[email protected]",
          "hash": "hash",
          "role": "visitor"
        }
      ]
    }
    AuthorizationstringRequired
    Query parameters
    updated_afterstringOptional

    To retrieve the list of retail transactions which have been changed after the timestamp (e.g. 2023-04-10T00:00:00)

    updated_beforestringOptional

    To retrieve the list of retail transactions which have been changed before the timestamp (e.g. 2023-04-10T00:00:00)

    after_cursorstringOptional

    Returns the retail transactions that come after the specified cursor

    ascbooleanOptional

    Sort the retail transactions in ascending order based on the saleDate field

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    get
    /orders/transactions/search
    ap21_person_idnumberRequired

    The Apparel21 Person ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The person id or order id was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    404

    Not Found: The customer with the specified ID was not found.

    get
    /orders/{ap21_person_id}
    Path parameters
    ap21_person_idnumberRequired

    The Apparel21 Person ID

    ap21_order_idnumberRequired

    The Apparel21 Order ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The person id or order id was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    404

    Not Found: The customer with the specified ID was not found.

    get
    /orders/{ap21_person_id}/order/{ap21_order_id}
    Authorizations
    AuthorizationstringRequired
    Path parameters
    ap21_person_idnumberRequired

    The Apparel21 Person ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The email was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    404

    Not Found: The customer with the specified email address was not found.

    get
    /orders/{ap21_person_id}/transactions
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    get
    /order/gateways
    AuthorizationstringRequired
    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    orderNumberstringRequiredExample: #1001
    personIdnumberRequiredExample: 73152
    orderDateTimestringOptional

    The date and time of the order

    Example: 2023-03-02T14:31:42
    deliveryInstructionsstringOptional

    Special instructions for the delivery

    pricesIncludeTaxbooleanOptional

    Indicates if the prices include tax

    Example: true
    unattendedDeliveryOptionstringOptional

    The field indicates the option for unattended delivery for the order. It can be set to either "AuthorityToLeave" or "None". If the field is not provided, it will default to "None".

    Example: AuthorityToLeave
    emailstringRequiredExample: [email protected]
    mobilestringRequiredExample: (04) 8375 9586
    pickupStoreIdnumberOptional

    The StoreId field represents the identifier of the store from which the product will either be picked up or despatched. This field is required when the customer chooses to collect the order from a retail store as a ClickAndCollect order. For DespatchFromStore orders, this field is optional.

    despatchTypestringOptional

    This field indicates the type of despatch method for an order. It could be set to one of the following values: ClickAndCollect, DespatchFromStore, DespatchFromWarehouse, or Blank. If the field is left blank, it will default to a normal warehouse despatch order. The DespatchType field is mandatory only when a pick-up location ID is provided.

    Example: DespatchFromWarehouse
    Responses
    201

    Successful response

    application/json
    400

    Bad Request: The request body was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The user does not have permission to perform this action.

    500

    Internal server error.

    post
    /orders
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    apparel21OrderIdnumberRequired

    The apparel21 order id

    Example: 100423
    apparel21PersonIdnumberRequired

    The apparel21 person id

    Example: 96996
    orderNumberstringOptional

    If an orderNumber is provided, it will be recognised as the Customer Order Number within the Apparel21. However, if the field is left empty, the API will automatically generate a unique order number.

    Example: #110096-R
    origOrderNumstringRequired

    The reference for the original order. All returns must be posted against an original web order.

    Example: #110096
    stockUpdatebooleanOptional

    Typically, this particular element is not frequently utilized. However, it can be provided with a value of "false" to indicate that the returned item will not be returned to the warehouse. In this case, an automatic customer refund will be initiated to complete the return process, and a stock adjustment will be made to account for the item not being sent back. If no value is provided, the default behavior is considered as "true". In other words, a pending return or exchange order will be created in Apparel21, awaiting the item's receipt in the warehouse.

    Example: true
    Responses
    201

    Successful response

    application/json
    400

    Bad Request: The request body was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The user does not have permission to perform this action.

    500

    Internal server error.

    post
    /returns
    string
    Required
    Query parameters
    updated_afterstringOptional

    To retrieve the list of customers which have been changed after the timestamp (e.g. 2023-04-10T00:00:00)

    after_cursorstringOptional

    Returns the customers that come after the specified cursor

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    get
    /customers/search
    AuthorizationstringRequired
    Query parameters
    emailstringOptional

    The email address of the customer

    updated_afterstringOptional

    To retrieve the list of customers which have been changed after the timestamp (e.g. 2023-04-10T00:00:00)

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The email was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    404

    Not Found: The customer with the specified email address was not found.

    get
    /customers
    Required
    Path parameters
    ap21_person_idnumberRequired

    The Apparel21 Person ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The ID was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    404

    Not Found: The customer with the specified ID was not found.

    get
    /customers/{ap21_person_id}
    Authorizations
    AuthorizationstringRequired
    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    firstnamestringRequiredExample: John
    surnamestringRequiredExample: Smith
    privacybooleanRequired

    The field will be set to false if either emailSubscription or smsSubscription is true.

    Example: false
    emailSubscriptionbooleanOptionalExample: false
    smsSubscriptionbooleanOptionalExample: false
    emailstringRequiredExample: [email protected]
    mobilestringOptionalExample: (04) 8375 9586
    dateOfBirthstringOptional
    Responses
    201

    Successful response

    application/json
    400

    Bad Request: The request body was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The user does not have permission to perform this action.

    post
    /customers
    Authorizations
    AuthorizationstringRequired
    Path parameters
    ap21_person_idnumberRequired

    The Apparel21 Person ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    firstnamestringRequiredExample: John
    surnamestringRequiredExample: Smith
    privacybooleanRequired

    The field will be set to false if either emailSubscription or smsSubscription is true.

    Example: false
    emailSubscriptionbooleanOptionalExample: false
    smsSubscriptionbooleanOptionalExample: false
    emailstringRequiredExample: [email protected]
    mobilestringOptionalExample: (04) 8375 9586
    dateOfBirthstringOptional
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The ID was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The user does not have permission to perform this action.

    404

    Not Found: The customer with the specified ID was not found.

    put
    /customers/{ap21_person_id}
    Authorizations
    AuthorizationstringRequired
    Header parameters
    X-DotApparel-NamestringRequired
    shopstringRequired
    Body
    gatewaystringRequired

    To obtain the names of all available payment gateways, you can make a GET request to the "/order/gateways" endpoint. In order to determine the appropriate gateway for this specific request, please get in touch with your merchant.

    Example: shopify
    messagestringOptional

    The message that are sent to receiver

    Example: Happy birthday!
    orderNumberstringOptional

    If an orderNumber is provided, it will be recognised as the Customer Order Number within the Apparel21. However, if the field is left empty, the API will automatically generate a unique order number.

    Example: #1001
    pricenumberRequired

    The unit price of the gift card

    Example: 100
    receiverEmailstringRequired

    The gift voucher receiver's email address

    Example: [email protected]
    receiverNamestringRequired

    The gift voucher receiver's name

    Example: Smith James
    senderEmailstringRequired

    The email field is mandatory.

    Example: [email protected]
    senderMobilestringOptional

    Mobile Phone

    Example: (04) 8375 9586
    senderNamestringRequired

    The gift voucher sender's name

    Example: John Williams
    subjectstringOptional

    The subject line of the email

    Example: My Gift Voucher
    Responses
    201

    Successful response

    application/json
    400

    Bad Request: If the required parameters are missing or invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The user does not have permission to perform this action.

    500

    Internal server error.

    post
    /vouchers
    string
    Required
    Path parameters
    voucher_numberstringRequired

    The Apparel21 voucher number

    Query parameters
    pinstringRequired

    The Apparel21 voucher pin

    amountstringOptional

    To validate gift voucher - Amount of the voucher that will be used – this is only used for checking that “give change” vouchers will be used in full

    "validationId" property will be included in the response

    Header parameters
    X-DotApparel-NamestringRequired
    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: Please enter a valid voucher number and pin

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The voucher does not exist

    Forbidden: The PIN is invalid

    get
    /vouchers/{voucher_number}
    Path parameters
    voucher_numberstringRequired

    The Apparel21 voucher number

    Query parameters
    validation_idstringRequired

    The validation id retrieved after validating gift voucher

    If invalid, obtain a new one by making a request to validate gift voucher

    lock_secondsnumberOptional

    Number of seconds that voucher is to be locked for (if not supplied, lock is applied for 3600 seconds = 1 hour).

    To unlock voucher, post another lock request with lock seconds of zero.

    Header parameters
    X-DotApparel-NamestringRequired
    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad request: Please enter a valid voucher number and validation id

    403

    Forbidden: Incorrect validation id

    put
    /vouchers/{voucher_number}
    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    get
    /rewards/programs
    string
    Required
    Path parameters
    reward_account_idnumberRequired

    The Apparel21 reward account id

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The reward account id must be a number.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The reward account with the specified id does not exist.

    get
    /rewards/accounts/{reward_account_id}
    Path parameters
    reward_account_idnumberRequired

    The Apparel21 Reward account ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    tierIdnumberRequiredExample: 2
    personIdnumberRequiredExample: 73152
    tierLockedUntilDatestringOptionalExample: 2019-09-01
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The request body was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The specified PersonId does not match the specified AccountId.

    Forbidden: Invalid Tier Id.

    Forbidden: The specified AccountId does not exist.

    put
    /rewards/accounts/{reward_account_id}
    string
    Required
    Path parameters
    reward_account_idnumberRequired

    The Apparel21 reward account id

    Query parameters
    from_datestringOptional

    (Optional) Earliest date to retrieve transaction from yyyy-MM-dd format

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    200

    Successful response

    application/json
    400

    Bad Request: The reward account id must be a number.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The reward account with the specified id does not exist.

    404

    Not Found: No data found

    get
    /rewards/accounts/{reward_account_id}/transactions
    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    programIdnumberRequiredExample: 1
    tierIdnumberRequiredExample: 2
    personIdnumberRequiredExample: 73152
    Responses
    201Success
    application/json
    400

    Bad Request: The request body was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: Account already exists for the specified PersonId and ProgramId.

    Forbidden: The specified TierId is not valid for the specified ProgramId.

    post
    /rewards/accounts
    string
    Required
    Path parameters
    reward_account_idnumberRequired

    The Apparel21 Reward account ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    personIdnumberRequiredExample: 73152
    descriptionstringRequiredExample: DotApparel Rewards TEST
    amountnumberRequiredExample: 50
    expiryDatestringRequiredExample: 2023-12-30
    issueReasonIdnumberRequiredExample: 17666
    referencestringRequiredExample: SM1
    Responses
    201

    Successful operation

    400

    Bad Request: The request body was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The specified person id does not match the specified account id

    Forbidden: The specified account id does not exist

    Forbidden: The specified issue reason id is invalid

    post
    /rewards/accounts/{reward_account_id}/rewards

    No content

    string
    Required
    Path parameters
    reward_account_idnumberRequired

    The Apparel21 Reward account ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    personIdnumberRequiredExample: 73152
    giftIdnumberRequiredExample: 2620
    descriptionstringRequiredExample: Test gift
    expiryDatestringRequiredExample: 2023-12-30
    issueReasonIdnumberRequiredExample: 17666
    referencestringRequiredExample: AUG123
    Responses
    201

    Successful operation

    400

    Bad Request: The request body was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The specified GiftId is not valid for the specified account id

    Forbidden: The specified PersonId does not match the specified account id

    Forbidden: The specified account id does not exist

    Forbidden: The specified issue reason id is invalid

    post
    /rewards/accounts/{reward_account_id}/gifts

    No content

    string
    Required
    Path parameters
    reward_account_idnumberRequired

    The Apparel21 Reward account ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    personIdnumberRequiredExample: 73152
    pointsnumberRequiredExample: 100
    descriptionstringRequiredExample: Test gift
    expiryDatestringRequiredExample: 2023-12-30
    referencestringRequiredExample: AUG123
    Responses
    201

    Successful operation

    400

    Bad Request: The request body was invalid.

    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The specified person id does not match the specified account id

    Forbidden: The specified account id does not exist

    post
    /rewards/accounts/{reward_account_id}/points

    No content

    AuthorizationstringRequired
    Path parameters
    reward_account_idnumberRequired

    The Apparel21 Reward account ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    personIdnumberRequiredExample: 73152
    descriptionstringRequiredExample: Redeem reward
    spendAmountnumberRequiredExample: 50
    amountnumberRequiredExample: 30
    referencestringRequiredExample: RED123
    autoConfirmbooleanRequiredExample: true
    Responses
    201

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The specified person id does not match the specified account id

    Forbidden: The specified account id does not exist

    post
    /rewards/accounts/{reward_account_id}/rewards/redemptions
    AuthorizationstringRequired
    Path parameters
    reward_account_idnumberRequired

    The Apparel21 Reward account ID

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Body
    personIdnumberRequiredExample: 73152
    descriptionstringRequiredExample: Redeem reward
    giftIdnumberRequiredExample: 2
    redeemedSkuIdnumberRequiredExample: 6821
    referencestringRequiredExample: RED123
    autoConfirmbooleanRequiredExample: true
    Responses
    201

    Successful response

    application/json
    401

    Unauthorized: The user is not authorized to perform this action.

    403

    Forbidden: The specified person id does not match the specified account id

    Forbidden: The specified account id does not exist

    Forbidden: The specified redeemed sku id is invalid for the specified gift id

    Forbidden: No gift with the specified gift id is available to redeem

    post
    /rewards/accounts/{reward_account_id}/gifts/redemptions
    Query parameters
    request_idstringRequired

    Request id obtained from redeem reward or gift endpoint

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    201

    Successful operation

    400

    Bad Request: Request id cannot be empty

    401

    Unauthorized: The user is not authorized to perform this action.

    500

    Internal Server Error: Request ID has already been posted

    post
    /rewards/confirmation

    No content

    Query parameters
    request_idstringRequired

    Request id obtained from redeem reward or gift endpoint

    Header parameters
    X-DotApparel-NamestringRequired

    An alias name that represents a particular brand that is using the API

    shopstringRequired
    Responses
    201

    Successful operation

    400

    Bad Request: Request id cannot be empty

    401

    Unauthorized: The user is not authorized to perform this action.

    500

    Internal Server Error: Request ID has already been posted

    post
    /rewards/reversal

    No content

    GET /orders/{ap21_person_id} HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "id": 1,
          "orderNumber": "#1001",
          "personId": 73152,
          "warehouseId": 5441,
          "orderDateTime": "2023-03-02T14:31:42",
          "totalQuantity": "1",
          "totalTax": "13.29",
          "totalDiscount": "56.97",
          "totalDue": "132.93",
          "totalPayment": "132.93",
          "deliveryInstructions": "",
          "pickupStoreId": null,
          "despatchType": "DespatchFromWarehouse",
          "addresses": {
            "billing": {
              "contactName": "DotApparel",
              "addressLine1": "Level 5",
              "addressLine2": "111 Cecil St",
              "city": "South Melbourne",
              "state": "VIC",
              "postcode": "3205",
              "country": "Australia"
            },
            "delivery": {
              "contactName": "DotApparel",
              "addressLine1": "Level 5",
              "addressLine2": "111 Cecil St",
              "city": "South Melbourne",
              "state": "VIC",
              "postcode": "3205",
              "country": "Australia"
            }
          },
          "contact": {
            "email": "[email protected]",
            "phones": {
              "home": "(03) 8375 9586",
              "mobile": "(04) 8375 9586",
              "work": "(03) 8375 9586"
            }
          },
          "deliveryContact": {
            "email": "[email protected]",
            "phones": {
              "home": "(03) 8375 9586",
              "mobile": "(04) 8375 9586",
              "work": "(03) 8375 9586"
            }
          },
          "orderDetails": [
            {
              "id": "32916920",
              "sequence": "1",
              "productId": "38664",
              "colourId": "79943",
              "skuId": "292544",
              "productCode": "CS21182",
              "productName": "Audrey Wool Coat",
              "colourCode": "BERRY",
              "colourName": "Berry",
              "sizeCode": "L",
              "quantity": "1",
              "price": "189.9",
              "discount": "56.97",
              "value": "132.93",
              "taxPercent": 10,
              "senderName": "John Williams",
              "receiverName": "Smith James",
              "carrier": "auspost_standard",
              "carrierUrl": "https://tracing.example.com?tracking_no=",
              "conNote": "DSL4900000000",
              "status": "Shipped",
              "quantityTaken": "0",
              "quantityPacked": "0",
              "nonReturnable": true
            }
          ],
          "selectedFreightOption": {
            "id": 1042,
            "value": 10,
            "taxPercent": 0
          },
          "payments": [
            {
              "id": 1441870,
              "origin": "CreditCard",
              "cardType": "VISA",
              "stan": 405555,
              "authCode": "512",
              "accountType": "Credit",
              "settlement": "20110625",
              "reference": "13525233_22255",
              "amount": "132.93",
              "message": "Purchased on Monday",
              "merchantId": "Shopify",
              "voucherNumber": "700125",
              "validationId": "cfde12b5-3b5c-4c3da089-aca58a8c44dd"
            }
          ],
          "currency": {
            "code": "AUD",
            "format": "#,##0.00 'Aud'"
          },
          "pricesIncludeTax": true,
          "pointsPartner": {
            "id": "",
            "name": "",
            "membershipNumber": ""
          },
          "unattendedDeliveryOption": "AuthorityToLeave"
        }
      ]
    }
    GET /orders/{ap21_person_id}/order/{ap21_order_id} HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": {
        "id": 1,
        "orderNumber": "#1001",
        "personId": 73152,
        "warehouseId": 5441,
        "orderDateTime": "2023-03-02T14:31:42",
        "totalQuantity": "1",
        "totalTax": "13.29",
        "totalDiscount": "56.97",
        "totalDue": "132.93",
        "totalPayment": "132.93",
        "deliveryInstructions": "",
        "pickupStoreId": null,
        "despatchType": "DespatchFromWarehouse",
        "addresses": {
          "billing": {
            "contactName": "DotApparel",
            "addressLine1": "Level 5",
            "addressLine2": "111 Cecil St",
            "city": "South Melbourne",
            "state": "VIC",
            "postcode": "3205",
            "country": "Australia"
          },
          "delivery": {
            "contactName": "DotApparel",
            "addressLine1": "Level 5",
            "addressLine2": "111 Cecil St",
            "city": "South Melbourne",
            "state": "VIC",
            "postcode": "3205",
            "country": "Australia"
          }
        },
        "contact": {
          "email": "[email protected]",
          "phones": {
            "home": "(03) 8375 9586",
            "mobile": "(04) 8375 9586",
            "work": "(03) 8375 9586"
          }
        },
        "deliveryContact": {
          "email": "[email protected]",
          "phones": {
            "home": "(03) 8375 9586",
            "mobile": "(04) 8375 9586",
            "work": "(03) 8375 9586"
          }
        },
        "orderDetails": [
          {
            "id": "32916920",
            "sequence": "1",
            "productId": "38664",
            "colourId": "79943",
            "skuId": "292544",
            "productCode": "CS21182",
            "productName": "Audrey Wool Coat",
            "colourCode": "BERRY",
            "colourName": "Berry",
            "sizeCode": "L",
            "quantity": "1",
            "price": "189.9",
            "discount": "56.97",
            "value": "132.93",
            "taxPercent": 10,
            "senderName": "John Williams",
            "receiverName": "Smith James",
            "carrier": "auspost_standard",
            "carrierUrl": "https://tracing.example.com?tracking_no=",
            "conNote": "DSL4900000000",
            "status": "Shipped",
            "quantityTaken": "0",
            "quantityPacked": "0",
            "nonReturnable": true
          }
        ],
        "selectedFreightOption": {
          "id": 1042,
          "value": 10,
          "taxPercent": 0
        },
        "payments": [
          {
            "id": 1441870,
            "origin": "CreditCard",
            "cardType": "VISA",
            "stan": 405555,
            "authCode": "512",
            "accountType": "Credit",
            "settlement": "20110625",
            "reference": "13525233_22255",
            "amount": "132.93",
            "message": "Purchased on Monday",
            "merchantId": "Shopify",
            "voucherNumber": "700125",
            "validationId": "cfde12b5-3b5c-4c3da089-aca58a8c44dd"
          }
        ],
        "currency": {
          "code": "AUD",
          "format": "#,##0.00 'Aud'"
        },
        "pricesIncludeTax": true,
        "pointsPartner": {
          "id": "",
          "name": "",
          "membershipNumber": ""
        },
        "unattendedDeliveryOption": "AuthorityToLeave"
      }
    }
    GET /order/gateways HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        "shopify"
      ]
    }
    POST /returns HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 277
    
    {
      "apparel21OrderId": 100423,
      "apparel21PersonId": 96996,
      "orderNumber": "#110096-R",
      "origOrderNum": "#110096",
      "stockUpdate": true,
      "orderDetails": [
        {
          "sku": "292544",
          "skuId": "12345",
          "quantity": -1,
          "returnReason": "The item is damaged",
          "carrier": "Australia Post",
          "conNote": "AA123456789AU"
        }
      ]
    }
    GET /customers/search HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "id": 65432,
          "code": "SMITJOHN22",
          "firstname": "John",
          "surname": "Smith",
          "startDate": "2021-03-25 00:00:00",
          "updateTimeStamp": "2023-03-06 10:50:16",
          "contact": {
            "email": "[email protected]",
            "phones": {
              "home": "(03) 8375 9586",
              "mobile": "(04) 8375 9586",
              "work": "(03) 8375 9586"
            }
          },
          "privacy": false,
          "dateOfBirth": "",
          "retailRep": "No",
          "retailCust": "Yes",
          "address": {
            "addressLine1": "Level 5",
            "addressLine2": "111 Cecil St",
            "city": "South Melbourne",
            "state": "VIC",
            "postcode": "3205",
            "country": "Australia"
          },
          "shopifyAdminId": "gid://shopify/Customer/6477890125896",
          "shopifyLegacyId": "6477890125896",
          "loyaltyCode": "99",
          "loyaltyName": "Example loyalty",
          "joinedStoreId": "4983",
          "joinedStoreCode": "Doncaster",
          "attributes": [
            {
              "key": "foo",
              "value": "bar"
            }
          ]
        }
      ],
      "meta": {
        "hasNextPage": true,
        "endCursor": "string"
      }
    }
    GET /customers HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "id": 65432,
          "code": "SMITJOHN22",
          "firstname": "John",
          "surname": "Smith",
          "title": "MR",
          "initials": "JJ",
          "sex": "M",
          "jobTitle": "Office Admin",
          "startDate": "2021-03-25 00:00:00",
          "updateTimeStamp": "2023-03-06 10:50:16",
          "references": [
            {
              "type": "foo",
              "value": "bar"
            }
          ],
          "isAgent": false,
          "currency": {
            "code": "AUD",
            "format": "#,##0.00 'Aud'"
          },
          "loyalties": [
            {
              "id": 1022,
              "loyaltyTypeId": 1022,
              "loyaltyType": "VIP Gold loyalty",
              "cardNo": "LM12345678",
              "expiry": "2015-10-29",
              "balance": 100,
              "creditStatus": "1321",
              "message": "Example message",
              "joinDate": "2014-10-01",
              "statusId": "1234"
            }
          ],
          "rewardsAccounts": [
            {
              "id": 1234,
              "programId": 1,
              "programName": "Loyalty Rewards",
              "tierId": 2,
              "tierName": "Tier 2"
            }
          ],
          "contact": {
            "email": "[email protected]",
            "phones": {
              "home": "(03) 8375 9586",
              "mobile": "(04) 8375 9586",
              "work": "(03) 8375 9586"
            }
          },
          "privacy": false,
          "addresses": [
            {
              "billing": {
                "contactName": "DotApparel",
                "companyName": "DotApparel",
                "addressLine1": "Level 5",
                "addressLine2": "111 Cecil St",
                "city": "South Melbourne",
                "state": "VIC",
                "postcode": "3205",
                "country": "Australia"
              },
              "delivery": {
                "contactName": "DotApparel",
                "companyName": "DotApparel",
                "addressLine1": "Level 5",
                "addressLine2": "111 Cecil St",
                "city": "South Melbourne",
                "state": "VIC",
                "postcode": "3205",
                "country": "Australia"
              }
            }
          ],
          "dateOfBirth": "",
          "shopifyAdminId": "gid://shopify/Customer/6477890125896",
          "shopifyLegacyId": "6477890125896"
        }
      ]
    }
    GET /customers/{ap21_person_id} HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": {
        "id": 65432,
        "code": "SMITJOHN22",
        "shopifyAdminId": "gid://shopify/Customer/6477890125896",
        "shopifyLegacyId": "6477890125896",
        "firstname": "John",
        "surname": "Smith",
        "title": "MR",
        "initials": "JJ",
        "sex": "M",
        "jobTitle": "Office Admin",
        "startDate": "2021-03-25 00:00:00",
        "updateTimeStamp": "2023-03-06 10:50:16",
        "references": [
          {
            "type": "foo",
            "value": "bar"
          }
        ],
        "isAgent": false,
        "currency": {
          "code": "AUD",
          "format": "#,##0.00 'Aud'"
        },
        "loyalties": [
          {
            "id": 1022,
            "loyaltyTypeId": 1022,
            "loyaltyType": "VIP Gold loyalty",
            "cardNo": "LM12345678",
            "expiry": "2015-10-29",
            "balance": 100,
            "creditStatus": "1321",
            "message": "Example message",
            "joinDate": "2014-10-01",
            "statusId": "1234"
          }
        ],
        "rewardsAccounts": [
          {
            "id": 1234,
            "programId": 1,
            "programName": "Loyalty Rewards",
            "tierId": 2,
            "tierName": "Tier 2"
          }
        ],
        "contact": {
          "email": "[email protected]",
          "phones": {
            "home": "(03) 8375 9586",
            "mobile": "(04) 8375 9586",
            "work": "(03) 8375 9586"
          }
        },
        "privacy": false,
        "addresses": [
          {
            "billing": {
              "contactName": "DotApparel",
              "companyName": "DotApparel",
              "addressLine1": "Level 5",
              "addressLine2": "111 Cecil St",
              "city": "South Melbourne",
              "state": "VIC",
              "postcode": "3205",
              "country": "Australia"
            },
            "delivery": {
              "contactName": "DotApparel",
              "companyName": "DotApparel",
              "addressLine1": "Level 5",
              "addressLine2": "111 Cecil St",
              "city": "South Melbourne",
              "state": "VIC",
              "postcode": "3205",
              "country": "Australia"
            }
          }
        ],
        "dateOfBirth": ""
      }
    }
    POST /vouchers HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 465
    
    {
      "billingAddress": {
        "contactName": "DotApparel",
        "addressLine1": "Level 5",
        "addressLine2": "111 Cecil St",
        "city": "South Melbourne",
        "state": "VIC",
        "postcode": "3205",
        "country": "Australia"
      },
      "gateway": "shopify",
      "message": "Happy birthday!",
      "orderNumber": "#1001",
      "price": 100,
      "receiverEmail": "[email protected]",
      "receiverName": "Smith James",
      "senderEmail": "[email protected]",
      "senderMobile": "(04) 8375 9586",
      "senderName": "John Williams",
      "subject": "My Gift Voucher"
    }
    GET /vouchers/{voucher_number}?pin=text HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": {
        "voucherNumber": "4000105",
        "expiryDate": "2026-05-11T00:00:00",
        "originalAmmount": "50",
        "usedAmount": "0",
        "availableAmount": "50",
        "validationId": "a9e3accc-addf-4ca9-94bc-3cd499c50af0"
      }
    }
    PUT /vouchers/{voucher_number}?validation_id=text HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": {}
    }
    GET /rewards/programs HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "id": 1,
          "name": "Retail Rewards",
          "description": "cs16200",
          "tiers": [
            {
              "id": 1,
              "name": "Cotton",
              "description": "Annual Spend $0 - $599",
              "sequence": 1,
              "accrualSpend": "1",
              "accrualPoints": 1,
              "autoRewardPointThreshold": 300,
              "autoRewardValue": 30,
              "autoRewardGiftId": null,
              "tierPointsBonus": 0,
              "tierRewardsBonus": 0,
              "tierGiftBonusId": null,
              "defaultPointsExpiry": {
                "months": 12,
                "days": 0
              },
              "defaultRewardExpiry": {
                "months": 0,
                "days": 60
              },
              "qualifySpend": "600",
              "qualifyPeriod": {
                "months": 12,
                "days": 0
              }
            }
          ],
          "gifts": [
            {
              "id": 1,
              "name": "Birthday Gift Cashmere",
              "description": "",
              "giftStyles": [
                {
                  "id": 6821,
                  "code": "CSC1016",
                  "name": "Block Colour Scarf"
                },
                {
                  "id": 6821,
                  "code": "CSC1016",
                  "name": "Empire Beanie"
                },
                {
                  "id": 8085,
                  "code": "PL21104",
                  "name": "Flinders Touch Gloves"
                }
              ]
            }
          ]
        }
      ]
    }
    GET /rewards/accounts/{reward_account_id} HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": {
        "id": 22672,
        "programId": 1,
        "programName": "Retail Rewards",
        "tierId": 2,
        "tierName": "Merino",
        "personId": 73152,
        "tierLockedUntilDate": "2023-09-01",
        "availablePoints": 0,
        "availableRewards": 200,
        "joinDate": "2021-05-03",
        "tierJoinDate": "2021-05-03",
        "pointsToNextReward": 300,
        "spendToNextReward": 300,
        "nextTierId": 3,
        "spendToNextTier": 1800,
        "pointsList": [
          {
            "createdDateTime": "2018-01-15",
            "description": "Social Media post",
            "total": 100,
            "redeemed": 20,
            "pendingRedemption": 10,
            "available": 70,
            "expiryDate": "2018-01-15"
          }
        ],
        "rewards": [
          {
            "total": 50,
            "expiryDate": "2023-12-30",
            "description": "DotApparel Rewards TEST",
            "redeemed": 0,
            "rewardId": 43923,
            "available": 50,
            "createdDateTime": "2023-04-13T13:19:36",
            "pendingRedemption": 0
          },
          {
            "total": 150,
            "expiryDate": "2023-12-30",
            "description": "DotApparel Rewards TEST",
            "redeemed": 0,
            "rewardId": 43924,
            "available": 150,
            "createdDateTime": "2023-04-13T13:19:45",
            "pendingRedemption": 0
          }
        ],
        "gifts": [
          {
            "giftName": "Welcome To Merino",
            "expiryDate": "2023-06-12",
            "description": "Merino Tier Bonus",
            "giftId": 4,
            "issueId": 38559,
            "createdDateTime": "2023-04-13T13:23:16"
          },
          {
            "giftName": "Birthday Gift Merino",
            "expiryDate": "2023-12-31",
            "description": "Test Gift 1",
            "giftId": 2,
            "issueId": 38560,
            "createdDateTime": "2023-04-13T13:24:35"
          }
        ]
      }
    }
    PUT /rewards/accounts/{reward_account_id} HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 64
    
    {
      "tierId": 2,
      "personId": 73152,
      "tierLockedUntilDate": "2019-09-01"
    }
    GET /rewards/accounts/{reward_account_id}/transactions HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "transactionDateTime": "2021-05-03T12:38:42",
          "description": "Birthday Reward",
          "source": "Retail API",
          "reference": "D0123455",
          "spend": 100,
          "points": 50,
          "rewardAmount": 10,
          "giftId": 4,
          "giftName": "Welcome To Merino",
          "newGift": true,
          "redeemedGiftSkuId": 1541,
          "confirmed": true
        }
      ]
    }
    POST /rewards/accounts HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 43
    
    {
      "programId": 1,
      "tierId": 2,
      "personId": 73152
    }
    POST /rewards/accounts/{reward_account_id}/rewards HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 136
    
    {
      "personId": 73152,
      "description": "DotApparel Rewards TEST",
      "amount": 50,
      "expiryDate": "2023-12-30",
      "issueReasonId": 17666,
      "reference": "SM1"
    }
    POST /rewards/accounts/{reward_account_id}/gifts HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 127
    
    {
      "personId": 73152,
      "giftId": 2620,
      "description": "Test gift",
      "expiryDate": "2023-12-30",
      "issueReasonId": 17666,
      "reference": "AUG123"
    }
    POST /rewards/accounts/{reward_account_id}/points HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 104
    
    {
      "personId": 73152,
      "points": 100,
      "description": "Test gift",
      "expiryDate": "2023-12-30",
      "reference": "AUG123"
    }
    POST /rewards/accounts/{reward_account_id}/rewards/redemptions HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 117
    
    {
      "personId": 73152,
      "description": "Redeem reward",
      "spendAmount": 50,
      "amount": 30,
      "reference": "RED123",
      "autoConfirm": true
    }
    POST /rewards/accounts/{reward_account_id}/gifts/redemptions HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 120
    
    {
      "personId": 73152,
      "description": "Redeem reward",
      "giftId": 2,
      "redeemedSkuId": 6821,
      "reference": "RED123",
      "autoConfirm": true
    }
    POST /rewards/confirmation?request_id=text HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    POST /rewards/reversal?request_id=text HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    GET /orders/transactions/search HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "personId": "30405",
          "email": "[email protected]",
          "transactionId": "100001",
          "transactionNumber": "D55500000135",
          "saleDate": "2023-03-26 00:00:00",
          "storeCode": "301",
          "storeName": "Warehouse",
          "items": [
            {
              "lineId": "15882",
              "productName": "Long Sleeve Shirt ",
              "productCode": "W00123",
              "colourName": "Black",
              "colourCode": "BLK",
              "sizeCode": "XL",
              "categories": "Shirt",
              "barcode": "XL",
              "quantity": "1",
              "price": "29.99",
              "value": "25.99",
              "discountReason": "VIP Discount",
              "discountAmount": "4",
              "shopifyVariantId": "gid://shopify/ProductVariant/42236213985460",
              "shopifyProductId": "gid://shopify/Product/7372168200372",
              "attributes": [
                {
                  "key": "foo",
                  "value": "bar"
                }
              ]
            }
          ]
        }
      ],
      "meta": {
        "hasNextPage": true,
        "endCursor": "string"
      }
    }
    GET /orders/{ap21_person_id}/transactions HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Accept: */*
    
    {
      "data": [
        {
          "id": "100001",
          "type": "Sale",
          "orderNumber": "W00001231",
          "transactionNumber": "D55500000135",
          "saleDate": "2023-03-26T00:00:00",
          "storeName": "Warehouse",
          "storeCode": "301",
          "currencyCode": "AUD",
          "carrier": "Australia Post",
          "carrierUrl": "http://auspost.com.au/track/track.html?id=",
          "conNote": "34AH12341234",
          "details": [
            {
              "id": 15882,
              "productName": "Long Sleeve Shirt ",
              "productCode": "W00123",
              "colourName": "Black",
              "colourCode": "BLK",
              "sizeCode": "XL",
              "quantity": "1",
              "price": "29.99",
              "value": "25.99",
              "taxPercentage": "12.5",
              "discounts": [
                {
                  "id": 15908,
                  "type": "Loyalty",
                  "reason": "Loyalty",
                  "amount": "4",
                  "percentage": "15"
                }
              ]
            }
          ]
        }
      ]
    }
    POST /orders HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 976
    
    {
      "orderNumber": "#1001",
      "personId": 73152,
      "orderDateTime": "2023-03-02T14:31:42",
      "deliveryInstructions": "",
      "pricesIncludeTax": true,
      "unattendedDeliveryOption": "AuthorityToLeave",
      "email": "[email protected]",
      "mobile": "(04) 8375 9586",
      "pickupStoreId": null,
      "despatchType": "DespatchFromWarehouse",
      "billingAddress": {
        "contactName": "DotApparel",
        "addressLine1": "Level 5",
        "addressLine2": "111 Cecil St",
        "city": "South Melbourne",
        "state": "VIC",
        "postcode": "3205",
        "country": "Australia"
      },
      "deliveryAddress": {
        "contactName": "DotApparel",
        "addressLine1": "Level 5",
        "addressLine2": "111 Cecil St",
        "city": "South Melbourne",
        "state": "VIC",
        "postcode": "3205",
        "country": "Australia"
      },
      "payments": [
        {
          "stan": 405555,
          "reference": "13525233_22255",
          "amount": "132.93",
          "gateway": "paypal"
        }
      ],
      "orderDetails": [
        {
          "price": "189.9",
          "value": "132.93",
          "taxPercent": 10,
          "sku": "292544",
          "skuId": "292544",
          "quantity": 1,
          "discount": 56.97
        }
      ],
      "freightOption": {
        "shippingTitle": "Standard shipping",
        "value": 10,
        "authorityToLeaveFreightOption": false
      }
    }
    {
      "data": {
        "id": 1,
        "orderNumber": "#1001",
        "personId": 73152,
        "warehouseId": 5441,
        "orderDateTime": "2023-03-02T14:31:42",
        "totalQuantity": "1",
        "totalTax": "13.29",
        "totalDiscount": "56.97",
        "totalDue": "132.93",
        "totalPayment": "132.93",
        "deliveryInstructions": "",
        "pickupStoreId": null,
        "despatchType": "DespatchFromWarehouse",
        "addresses": {
          "billing": {
            "contactName": "DotApparel",
            "addressLine1": "Level 5",
            "addressLine2": "111 Cecil St",
            "city": "South Melbourne",
            "state": "VIC",
            "postcode": "3205",
            "country": "Australia"
          },
          "delivery": {
            "contactName": "DotApparel",
            "addressLine1": "Level 5",
            "addressLine2": "111 Cecil St",
            "city": "South Melbourne",
            "state": "VIC",
            "postcode": "3205",
            "country": "Australia"
          }
        },
        "contact": {
          "email": "[email protected]",
          "phones": {
            "home": "(03) 8375 9586",
            "mobile": "(04) 8375 9586",
            "work": "(03) 8375 9586"
          }
        },
        "deliveryContact": {
          "email": "[email protected]",
          "phones": {
            "home": "(03) 8375 9586",
            "mobile": "(04) 8375 9586",
            "work": "(03) 8375 9586"
          }
        },
        "orderDetails": [
          {
            "id": "32916920",
            "sequence": "1",
            "productId": "38664",
            "colourId": "79943",
            "skuId": "292544",
            "productCode": "CS21182",
            "productName": "Audrey Wool Coat",
            "colourCode": "BERRY",
            "colourName": "Berry",
            "sizeCode": "L",
            "quantity": "1",
            "price": "189.9",
            "discount": "56.97",
            "value": "132.93",
            "taxPercent": 10,
            "senderName": "John Williams",
            "receiverName": "Smith James",
            "carrier": "auspost_standard",
            "carrierUrl": "https://tracing.example.com?tracking_no=",
            "conNote": "DSL4900000000",
            "status": "Shipped",
            "quantityTaken": "0",
            "quantityPacked": "0",
            "nonReturnable": true
          }
        ],
        "selectedFreightOption": {
          "id": 1042,
          "value": 10,
          "taxPercent": 0
        },
        "payments": [
          {
            "id": 1441870,
            "origin": "CreditCard",
            "cardType": "VISA",
            "stan": 405555,
            "authCode": "512",
            "accountType": "Credit",
            "settlement": "20110625",
            "reference": "13525233_22255",
            "amount": "132.93",
            "message": "Purchased on Monday",
            "merchantId": "Shopify",
            "voucherNumber": "700125",
            "validationId": "cfde12b5-3b5c-4c3da089-aca58a8c44dd"
          }
        ],
        "currency": {
          "code": "AUD",
          "format": "#,##0.00 'Aud'"
        },
        "pricesIncludeTax": true,
        "pointsPartner": {
          "id": "",
          "name": "",
          "membershipNumber": ""
        },
        "unattendedDeliveryOption": "AuthorityToLeave"
      }
    }
    {
      "data": {
        "id": 1,
        "orderNumber": "#1001",
        "personId": 73152,
        "warehouseId": 5441,
        "orderDateTime": "2023-03-02T14:31:42",
        "totalQuantity": "1",
        "totalTax": "13.29",
        "totalDiscount": "56.97",
        "totalDue": "132.93",
        "totalPayment": "132.93",
        "despatchType": "DespatchFromWarehouse",
        "orderDetails": [
          {
            "id": "32916920",
            "productId": "38664",
            "colourId": "79943",
            "skuId": "292544",
            "productCode": "CS21182",
            "productName": "Audrey Wool Coat",
            "colourCode": "BERRY",
            "colourName": "Berry",
            "sizeCode": "L",
            "quantity": "1",
            "returnReasonNotes": "It was damaged",
            "returnReasonId": "3030",
            "status": "Processing"
          }
        ],
        "returnAuthorisationNumber": 123456
      }
    }
    POST /customers HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 589
    
    {
      "firstname": "John",
      "surname": "Smith",
      "privacy": false,
      "emailSubscription": false,
      "smsSubscription": false,
      "email": "[email protected]",
      "mobile": "(04) 8375 9586",
      "billingAddress": {
        "contactName": "DotApparel",
        "companyName": "DotApparel",
        "addressLine1": "Level 5",
        "addressLine2": "111 Cecil St",
        "city": "South Melbourne",
        "state": "VIC",
        "postcode": "3205",
        "country": "Australia"
      },
      "deliveryAddress": {
        "contactName": "DotApparel",
        "companyName": "DotApparel",
        "addressLine1": "Level 5",
        "addressLine2": "111 Cecil St",
        "city": "South Melbourne",
        "state": "VIC",
        "postcode": "3205",
        "country": "Australia"
      },
      "dateOfBirth": ""
    }
    {
      "data": {
        "id": 65432,
        "code": "SMITJOHN22",
        "shopifyAdminId": "gid://shopify/Customer/6477890125896",
        "shopifyLegacyId": "6477890125896",
        "firstname": "John",
        "surname": "Smith",
        "title": "MR",
        "initials": "JJ",
        "sex": "M",
        "jobTitle": "Office Admin",
        "startDate": "2021-03-25 00:00:00",
        "updateTimeStamp": "2023-03-06 10:50:16",
        "references": [
          {
            "type": "foo",
            "value": "bar"
          }
        ],
        "isAgent": false,
        "currency": {
          "code": "AUD",
          "format": "#,##0.00 'Aud'"
        },
        "loyalties": [
          {
            "id": 1022,
            "loyaltyTypeId": 1022,
            "loyaltyType": "VIP Gold loyalty",
            "cardNo": "LM12345678",
            "expiry": "2015-10-29",
            "balance": 100,
            "creditStatus": "1321",
            "message": "Example message",
            "joinDate": "2014-10-01",
            "statusId": "1234"
          }
        ],
        "rewardsAccounts": [
          {
            "id": 1234,
            "programId": 1,
            "programName": "Loyalty Rewards",
            "tierId": 2,
            "tierName": "Tier 2"
          }
        ],
        "contact": {
          "email": "[email protected]",
          "phones": {
            "home": "(03) 8375 9586",
            "mobile": "(04) 8375 9586",
            "work": "(03) 8375 9586"
          }
        },
        "privacy": false,
        "addresses": [
          {
            "billing": {
              "contactName": "DotApparel",
              "companyName": "DotApparel",
              "addressLine1": "Level 5",
              "addressLine2": "111 Cecil St",
              "city": "South Melbourne",
              "state": "VIC",
              "postcode": "3205",
              "country": "Australia"
            },
            "delivery": {
              "contactName": "DotApparel",
              "companyName": "DotApparel",
              "addressLine1": "Level 5",
              "addressLine2": "111 Cecil St",
              "city": "South Melbourne",
              "state": "VIC",
              "postcode": "3205",
              "country": "Australia"
            }
          }
        ],
        "dateOfBirth": ""
      }
    }
    PUT /customers/{ap21_person_id} HTTP/1.1
    Host: 
    Authorization: Basic username:password
    X-DotApparel-Name: text
    shop: text
    Content-Type: application/json
    Accept: */*
    Content-Length: 589
    
    {
      "firstname": "John",
      "surname": "Smith",
      "privacy": false,
      "emailSubscription": false,
      "smsSubscription": false,
      "email": "[email protected]",
      "mobile": "(04) 8375 9586",
      "billingAddress": {
        "contactName": "DotApparel",
        "companyName": "DotApparel",
        "addressLine1": "Level 5",
        "addressLine2": "111 Cecil St",
        "city": "South Melbourne",
        "state": "VIC",
        "postcode": "3205",
        "country": "Australia"
      },
      "deliveryAddress": {
        "contactName": "DotApparel",
        "companyName": "DotApparel",
        "addressLine1": "Level 5",
        "addressLine2": "111 Cecil St",
        "city": "South Melbourne",
        "state": "VIC",
        "postcode": "3205",
        "country": "Australia"
      },
      "dateOfBirth": ""
    }
    {
      "data": {
        "id": 65432,
        "code": "SMITJOHN22",
        "shopifyAdminId": "gid://shopify/Customer/6477890125896",
        "shopifyLegacyId": "6477890125896",
        "firstname": "John",
        "surname": "Smith",
        "title": "MR",
        "initials": "JJ",
        "sex": "M",
        "jobTitle": "Office Admin",
        "startDate": "2021-03-25 00:00:00",
        "updateTimeStamp": "2023-03-06 10:50:16",
        "references": [
          {
            "type": "foo",
            "value": "bar"
          }
        ],
        "isAgent": false,
        "currency": {
          "code": "AUD",
          "format": "#,##0.00 'Aud'"
        },
        "loyalties": [
          {
            "id": 1022,
            "loyaltyTypeId": 1022,
            "loyaltyType": "VIP Gold loyalty",
            "cardNo": "LM12345678",
            "expiry": "2015-10-29",
            "balance": 100,
            "creditStatus": "1321",
            "message": "Example message",
            "joinDate": "2014-10-01",
            "statusId": "1234"
          }
        ],
        "rewardsAccounts": [
          {
            "id": 1234,
            "programId": 1,
            "programName": "Loyalty Rewards",
            "tierId": 2,
            "tierName": "Tier 2"
          }
        ],
        "contact": {
          "email": "[email protected]",
          "phones": {
            "home": "(03) 8375 9586",
            "mobile": "(04) 8375 9586",
            "work": "(03) 8375 9586"
          }
        },
        "privacy": false,
        "addresses": [
          {
            "billing": {
              "contactName": "DotApparel",
              "companyName": "DotApparel",
              "addressLine1": "Level 5",
              "addressLine2": "111 Cecil St",
              "city": "South Melbourne",
              "state": "VIC",
              "postcode": "3205",
              "country": "Australia"
            },
            "delivery": {
              "contactName": "DotApparel",
              "companyName": "DotApparel",
              "addressLine1": "Level 5",
              "addressLine2": "111 Cecil St",
              "city": "South Melbourne",
              "state": "VIC",
              "postcode": "3205",
              "country": "Australia"
            }
          }
        ],
        "dateOfBirth": ""
      }
    }
    {
      "data": {
        "id": 1,
        "orderNumber": "#1001",
        "personId": 73152,
        "warehouseId": 5441,
        "orderDateTime": "2023-03-02T14:31:42",
        "totalQuantity": "1",
        "totalTax": "10",
        "totalDiscount": "0",
        "totalDue": "100",
        "totalPayment": "100",
        "despatchType": "DespatchFromWarehouse",
        "addresses": {
          "billing": {
            "contactName": "DotApparel",
            "addressLine1": "Level 5",
            "addressLine2": "111 Cecil St",
            "city": "South Melbourne",
            "state": "VIC",
            "postcode": "3205",
            "country": "Australia"
          }
        },
        "contact": {
          "email": "[email protected]",
          "phones": {
            "home": "(03) 8375 9586",
            "mobile": "(04) 8375 9586",
            "work": "(03) 8375 9586"
          }
        },
        "orderDetails": [
          {
            "id": "32916920",
            "productId": "38664",
            "colourId": "79943",
            "skuId": "292544",
            "productCode": "GIFT",
            "productName": "Gift Voucher",
            "quantity": "1",
            "price": "100",
            "value": "100",
            "taxPercent": 10,
            "senderName": "John Williams",
            "receiverName": "Smith James",
            "status": "Shipped"
          }
        ],
        "payments": [
          {
            "id": 1441870,
            "origin": "CreditCard",
            "cardType": "VISA",
            "stan": 405555,
            "authCode": "512",
            "accountType": "Credit",
            "settlement": "20110625",
            "reference": "13525233_22255",
            "message": "Purchased on Monday",
            "merchantId": "Shopify",
            "amount": "100"
          }
        ],
        "pricesIncludeTax": true
      }
    }
    {
      "data": {
        "id": 22672,
        "programId": 1,
        "programName": "Retail Rewards",
        "tierId": 2,
        "tierName": "Merino",
        "personId": 73152,
        "tierLockedUntilDate": "2023-09-01"
      }
    }
    {
      "id": 22672,
      "programId": 1,
      "programName": "Retail Rewards",
      "tierId": 2,
      "tierName": "Merino",
      "personId": 73152,
      "tierLockedUntilDate": "2023-09-01"
    }
    {
      "data": {
        "requestId": "6b42837e-eee3-4d81-abb5-d4b26d202a40"
      }
    }
    {
      "data": {
        "requestId": "6b42837e-eee3-4d81-abb5-d4b26d202a40"
      }
    }