General

The CRM integration service allows a brand to integrate their customer and locations in the fashionTrade platform.

This data is used by fashionTrade to communicate back to the brand’s system using data their system would understand:

  • Reporting an order back to the brand using it’s internal customer ID.

  • Matching the fashionTrade retailers' locations with brand’s data and using this match to talk to the brand’s systems.

  • Etc.

The CRM service currently supports two endpoints:

  • Customers endpoint to manage brand’s customers.

  • Locations endpoint to manage brand’s customer locations.

Overview

Usage

Pagination

The following endpoints have a paginated response for the GET all requests:

  • /customers

  • /customers/{customerId}/locations

You can specify a limit and next parameters to request a specific results page of a specific page size.

If next is not passed as a request parameter, then the response will contain the first page results. The value for this parameter is taken as is from the previous request. No URL encoding is required.

If limit is not passed as a request parameter, then it will be set to default page size value which is 25.

Example requests:

GET /customers?limit=25
{
  "items": [ ... ],
  "next": "QHd7hNQ"
}

GET /customers?limit=25&next=QHd7hNQ
{
  "items": [ ... ],
  "next": null
}

You must check whether next is present in the response and use it if it is present. If it is null then there is no next page. If you send the next=null (not empty) you’ll get error 400 Bad Request.

Note: There is a total property in response always set to 0. You should ignore this property.

This service provides endpoints for brands to manage their customers within Fashiontrade platform.

URI scheme

Host : api.fashiontrade.com
BasePath : /crm
Schemes : HTTPS

Tags

  • customer locations

  • customers

Definitions

Address

Name Description Schema

address_line1
required

Address line 1

string

address_line2
optional

Address line 2

string

city
required

The city

string

country
required

The country. Countries are specified as ISO-3166-1 Alpha-2 codes (https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements)

string

disambiguation_result
optional

The disambiguation result of a location, read only

enum (NOT_MATCHED, DISAMBIGUATED, AMBIGUOUS, UNKNOWN)

location_id
required

The ID of the current location how it is known in the brand’s system to communicate back to the brand on the order

string

location_types
required

Type of this location

name
optional

The name of the address

string

zipcode
optional

The zipcode or postal code

string

ApiLocationTypes

Defines what type of location is it, at lest one should be set

Name Description Schema

is_delivery_location
optional

Specifies whether this location is the delivery address

boolean

is_invoice_location
optional

Specifies whether this location is the invoice address

boolean

is_shop_location
optional

Specifies whether this location is the shop address

boolean

Customer

Name Description Schema

customer_id
required

The brand’s internal ID for this customer to be used to communicate back to the brand on the order

string

disambiguation_result
optional

The disambiguation result of a customer, read only

enum (NOT_MATCHED, DISAMBIGUATED, AMBIGUOUS, UNKNOWN)

email_address
required

The main email of the customer

string

name
required

The name of the customer

string

organization_id
required

The ID of an organisation to which this customer belongs, used to group customer by it

string

phone_number
optional

The phone number of the customer

string

price_groups
optional

The retailer group name used for the pricing

< string > array

vat_number
optional

The VAT number of this customer

string

website
optional

The website of the customer

string

CustomerArrayWrapper

Name Schema

items
required

< Customer > array

next
optional

string

total
required

integer (int32)

Error

Name Schema

message
optional

string

JsonNode

Name Schema

array
optional

boolean

big_decimal
optional

boolean

big_integer
optional

boolean

binary
optional

boolean

boolean
optional

boolean

container_node
optional

boolean

double
optional

boolean

float
optional

boolean

floating_point_number
optional

boolean

int
optional

boolean

integral_number
optional

boolean

long
optional

boolean

missing_node
optional

boolean

node_type
optional

enum (ARRAY, BINARY, BOOLEAN, MISSING, NULL, NUMBER, OBJECT, POJO, STRING)

null
optional

boolean

number
optional

boolean

object
optional

boolean

pojo
optional

boolean

short
optional

boolean

textual
optional

boolean

value_node
optional

boolean

LocationArrayWrapper

Name Schema

items
required

< Address > array

next
optional

string

total
required

integer (int32)

Resources

Customer Locations

Get all locations for a given customer

GET /customers/{customerId}/locations
Parameters
Type Name Schema Default

Path

customerId
required

string

Query

limit
optional

integer (int32)

25

Query

next
optional

string

Responses
HTTP Code Description Schema

200

Success.

401

Request lacks valid authentication.

string

403

Request is not authorized for the authenticated user.

string

404

Customer with given ID does not exist

string

406

Not acceptable.

string

Consumes
  • application/json

Produces
  • application/json

Get a location by ID for a given customer

GET /customers/{customerId}/locations/{id}
Parameters
Type Name Schema

Path

customerId
required

string

Path

id
required

string

Responses
HTTP Code Description Schema

200

Success.

401

Request lacks valid authentication.

string

403

Request is not authorized for the authenticated user.

string

404

No location found for the requested ID and customer.

406

Not acceptable.

string

Consumes
  • application/json

Produces
  • application/json

Update an existing or create a new location

PUT /customers/{customerId}/locations/{id}
Parameters
Type Name Schema

Path

customerId
required

string

Path

id
required

string

Body

body
optional

Responses
HTTP Code Description Schema

200

The location was updated.

201

The location was created.

400

Invalid location provided

401

Request lacks authentication.

string

403

Request is not authorized for the authenticated user.

string

404

No customer found for the requested customer ID.

Consumes
  • application/json

Produces
  • application/json

Delete a location

DELETE /customers/{customerId}/locations/{id}
Parameters
Type Name Schema

Path

customerId
required

string

Path

id
required

string

Responses
HTTP Code Description Schema

204

The location was successfully deleted.

No Content

401

Request lacks valid authentication.

string

403

Request is not authorized for the authenticated user.

string

404

No location or customer found for the requested ID.

Consumes
  • application/json

Produces
  • application/json

Partially update an existing location

PATCH /customers/{customerId}/locations/{id}
Parameters
Type Name Schema

Path

customerId
required

string

Path

id
required

string

Body

body
optional

Responses
HTTP Code Description Schema

200

Success.

400

Invalid location data provided

401

Request lacks valid authentication.

string

403

Request is not authorized for the authenticated user.

string

404

No location or customer found for the requested ID.

Consumes
  • application/json

Produces
  • application/json

Customers

Get all customers

GET /customers
Parameters
Type Name Schema Default

Query

Organization ID to filter customers
optional

string

Query

limit
optional

integer (int32)

25

Query

next
optional

string

Responses
HTTP Code Description Schema

200

Success.

401

Request lacks valid authentication.

string

403

Request is not authorized for the authenticated user.

string

406

Not acceptable.

string

Consumes
  • application/json

Produces
  • application/json

Get a customer by ID

GET /customers/{id}
Parameters
Type Name Schema

Path

id
required

string

Responses
HTTP Code Description Schema

200

Success.

401

Request lacks valid authentication.

string

403

Request is not authorized for the authenticated user.

string

404

No customer found for the requested ID.

406

Not acceptable.

string

Consumes
  • application/json

Produces
  • application/json

Update an existing or create a new customer

PUT /customers/{id}
Parameters
Type Name Schema

Path

id
required

string

Body

body
optional

Responses
HTTP Code Description Schema

200

The customer was updated.

201

The customer was created.

400

Invalid customer provided

401

Request lacks authentication.

string

403

Request is not authorized for the authenticated user.

string

Consumes
  • application/json

Produces
  • application/json

Delete a customer

DELETE /customers/{id}
Description

This deletes the customer and all it’s locations.

Parameters
Type Name Schema

Path

id
required

string

Responses
HTTP Code Description Schema

204

The customer was successfully deleted.

No Content

401

Request lacks valid authentication.

string

403

Request is not authorized for the authenticated user.

string

404

No customer found for the requested ID.

Consumes
  • application/json

Produces
  • application/json

Partially update an existing customer

PATCH /customers/{id}
Parameters
Type Name Schema

Path

id
required

string

Body

body
optional

Responses
HTTP Code Description Schema

200

Success.

400

Invalid customer data provided

401

Request lacks valid authentication.

string

403

Request is not authorized for the authenticated user.

string

404

No customer found for the requested ID.

Consumes
  • application/json

Produces
  • application/json

Security

api_key

An API key is provided to you by FashionTrade.com. In order to use it, supply the key as a bearer token using the Authorization header in a request. E.g. 'Authorization: Bearer <YOUR_API_KEY>'.

Type : apiKey
Name : Authorization
In : HEADER