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

Orders

PreviousInventoryNextProducts

Last updated 1 year ago

Was this helpful?

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

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
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
GET /orders/transactions/search HTTP/1.1
Host: 
Authorization: Basic username:password
X-DotApparel-Name: text
shop: text
Accept: */*
{
  "data": [
    {
      "personId": "30405",
      "email": "john@example.com",
      "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"
  }
}

Retrieve all order of a customer in Apparel21

get

Scope: visitor and above

Retrieve all order of a customer in Apparel21

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 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
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": "info@example.com",
        "phones": {
          "home": "(03) 8375 9586",
          "mobile": "(04) 8375 9586",
          "work": "(03) 8375 9586"
        }
      },
      "deliveryContact": {
        "email": "info@example.com",
        "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"
    }
  ]
}

Retrieve a single order in Apparel21

get

Scope: visitor and above

Retrieve a single order in Apparel21

Authorizations
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
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": "info@example.com",
      "phones": {
        "home": "(03) 8375 9586",
        "mobile": "(04) 8375 9586",
        "work": "(03) 8375 9586"
      }
    },
    "deliveryContact": {
      "email": "info@example.com",
      "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"
  }
}

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.

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 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 /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"
            }
          ]
        }
      ]
    }
  ]
}

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
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 /order/gateways HTTP/1.1
Host: 
Authorization: Basic username:password
X-DotApparel-Name: text
shop: text
Accept: */*
{
  "data": [
    "shopify"
  ]
}
  • GETReturns some or all retail transactions based on timestamp filters
  • GETRetrieve all order of a customer in Apparel21
  • GETRetrieve a single order in Apparel21
  • GETRetrieve sales history for a person
  • GETList all payment gateway names
  • POSTCreate order in Apparel21
  • POSTCreate return in Apparel21

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
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: info@example.com
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
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": "info@example.com",
  "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": "info@example.com",
      "phones": {
        "home": "(03) 8375 9586",
        "mobile": "(04) 8375 9586",
        "work": "(03) 8375 9586"
      }
    },
    "deliveryContact": {
      "email": "info@example.com",
      "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"
  }
}

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
Header parameters
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
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"
    }
  ]
}
{
  "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
  }
}