Developer Guides
  • Introduction
    • Welcome
  • Core
    • Overview
    • Frontend
      • Implementation & Testing
      • Using the API endpoints
      • Gift cards
        • Gift Card validation API (Optional)
      • Check stock
      • Sibling products
      • Rewards program
      • Customer signatures
      • Retail transactions
      • Shopify Local Pick-up
  • API
    • Overview
    • Quick Start
    • Accounts
    • Changelog
    • Reference
      • Customers
      • Inventory
      • Orders
      • Products
      • Rewards
      • Stores
      • Vouchers
      • Staff
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. API
  2. Reference

Customers

PreviousReferenceNextInventory

Last updated 1 year ago

Was this helpful?

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

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
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
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": "info@example.com",
        "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"
  }
}

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
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
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": "info@example.com",
        "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"
    }
  ]
}

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
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
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": "info@example.com",
      "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": ""
  }
}
  • GETReturns some or all customers based on timestamp filters
  • GETRetrieve customers by email or after a specific timestamp
  • GETRetrieve customer by Apparel21 Person ID
  • POSTCreate customer in Apparel21
  • PUTUpdate customer in Apparel21

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 support@dotapparel.com.au

Authorizations
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: info@example.com
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
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": "info@example.com",
  "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": "info@example.com",
      "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": ""
  }
}

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 support@dotapparel.com.au

Authorizations
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: info@example.com
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
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": "info@example.com",
  "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": "info@example.com",
      "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": ""
  }
}