Customer to Customer Transfers

Customer to Customer Transfers allow you to move stock from a variant owned by customer A to a variant owned by customer B. The API supports creating, retrieving, and requesting these transfers.

Access needs to be granted. Without access, the API returns 403 Forbidden. You can request access via your eWarehousing contact.

How do I get a customer_id?

To create a Customer to Customer Transfer you need two customer IDs:

  • customer: the source customer (the context in which you create the transfer, this one is placed in the request header X-Customer-Code)
  • to_customer: the destination customer (who will receive the stock)

You can retrieve these IDs via the Customers API. See the Customers page for more details and examples.

  • List all customers: GET /wms/customers/
  • Retrieve a specific customer: GET /wms/customers/:id/

Go to the Customers documentation

The transfer model

Properties

  • Name
    id
    Type
    string
    Readonly
    readonly
    Description
  • Name
    to_customer
    Type
    uuid
    Description
  • Name
    created_at
    Type
    datetime
    Readonly
    readonly
    Description
  • Name
    external_reference
    Type
    string
    Description
  • Name
    status
    Type
    string
    Readonly
    readonly
    Description

    Possible statuses: created | requested | processing | denied | accepted | cancelled

  • Name
    customer_to_customer_transfer_lines
    Type
    array of transfer lines
    Description

The transfer line model

Properties

  • Name
    id
    Type
    string
    Readonly
    readonly
    Description
  • Name
    from_variant
    Type
    object
    Readonly
    readonly
    Description

    The resolved source variant object (matched from the article_code provided in the request)

  • Name
    to_variant
    Type
    object
    Readonly
    readonly
    Description

    The resolved destination variant object (created or matched for the destination customer)

  • Name
    quantity
    Type
    integer
    Description
  • Name
    finalized_quantity
    Type
    integer
    Readonly
    readonly
    Description

Expanding responses

New to the Expand header? See how it works, available groups, and request examples: Expanding responses.

The Expand header only influences the fields returned in the response. It is not required for requests themselves. You may include it on any endpoint if you want to expand the response payload.

Request Headers

Header NameTypeRequiredDescription
ExpandarrayNoComma-separated list of groups to include in the API response.

Available groups

Group NameDescription
customer_to_customer_transferBase transfer information (to_customer, created_at, external_reference, status).
customer_to_customer_transfer_linesInclude all transfer lines with from_variant, to_variant, to_customer, and quantities.
variantInclude variant information for from_variant and to_variant.

GET/wms/customer-to-customer-transfers/

List all transfers

Retrieve a collection of transfers. By default you get base information; expand the response using the Expand header.

Optional query parameters

Attribute NameTypeDescription
fromdate
Accepts a date in the format YYYY-MM-DD (2020-01-31).
todate
Accepts a date in the format YYYY-MM-DD (2020-01-31).
limitinteger
Limit the number of results.
Default: 50
pagestring
The page number to retrieve.
directionstring
The default sorting direction.
Options: asc, desc
Default: desc
sortstring
The default sorting direction.
Options: reference, createdAt
Default: reference

Request

GET
/wms/customer-to-customer-transfers/
curl https://eu-dev.middleware.ewarehousing-solutions.com/wms/customer-to-customer-transfers/
[
  {
    "id": "8a6f0bc3-5a3c-4e3a-9f7e-1e2b3c4d5e6f",
    "to_customer": "53b5a543-129a-403c-9a6e-3d9c525ffa5b",
    "created_at": "2025-01-10T12:45:00+00:00",
    "external_reference": "TEST-C2C-ROLE-001",
    "status": "requested"
  }
]

GET/wms/customer-to-customer-transfers/:id/

Retrieve a transfer

Retrieve details for a specific transfer. Use the Expand header to include lines in the response.

Request

GET
/wms/customer-to-customer-transfers/:id/
curl https://eu-dev.middleware.ewarehousing-solutions.com/wms/customer-to-customer-transfers/8a6f0bc3-5a3c-4e3a-9f7e-1e2b3c4d5e6f \
-H 'Expand: customer_to_customer_transfer_lines'
{
  "id": "8a6f0bc3-5a3c-4e3a-9f7e-1e2b3c4d5e6f",
  "to_customer": "53b5a543-129a-403c-9a6e-3d9c525ffa5b",
  "created_at": "2025-01-10T12:45:00+00:00",
  "external_reference": "TEST-C2C-ROLE-001",
  "status": "requested",
  "customer_to_customer_transfer_lines": [
    {
      "id": "2e7f2c3d-1c2b-4a5d-9e6f-7a8b9c0d1e2f",
      "from_variant": { "id": "f2894c16-399e-4ca1-9151-489775a6519c" },
      "to_variant": { "id": "87557e7a-4f4d-44eb-bbf1-c9d83df90099" },
      "quantity": 5,
      "finalized_quantity": 0
    }
  ]
}

POST/wms/customer-to-customer-transfers/

Create a transfer

Create a new customer-to-customer transfer.

Required attributes

  • Name
    customer
    Type
    uuid
    Description

    The (source) customer in whose context the transfer is created.

  • Name
    external_reference
    Type
    string
    Description
  • Name
    customer_to_customer_transfer_lines
    Type
    array of transfer lines
    Description

    At least 1 line.

Transfer line attributes (request)

  • Name
    article_code
    Type
    string
    Description

    Universal identifier that matches against variant article_code, EAN, or SKU to identify the source variant. The API will resolve this to from_variant and to_variant objects in the response.

  • Name
    quantity
    Type
    integer
    Description
    Quantity to transfer

Request vs Response: You send article_code in the request, but the API returns resolved from_variant and to_variant objects in the response. The article_code is used to match and identify the appropriate variants for both source and destination customers.

Expand is only used to control the response body. It is not required to send Expand for creating a transfer.

Request

POST
/wms/customer-to-customer-transfers/
curl -X POST 'https://eu-dev.middleware.ewarehousing-solutions.com/wms/customer-to-customer-transfers/' \
-H 'Content-Type: application/json' \
--data-raw '{
  "customer": "53b5a543-129a-403c-9a6e-3d9c525ffa5b",
  "external_reference": "TEST-C2C-ROLE-001",
  "to_customer": "53b5a543-129a-403c-9a6e-3d9c525ffa5b",
  "customer_to_customer_transfer_lines": [
    {
      "article_code": "VBP_A",
      "quantity": 5
    }
  ]
}'
{
  "id": "8a6f0bc3-5a3c-4e3a-9f7e-1e2b3c4d5e6f",
  "to_customer": "53b5a543-129a-403c-9a6e-3d9c525ffa5b",
  "created_at": "2025-01-10T12:45:00+00:00",
  "external_reference": "TEST-C2C-ROLE-001",
  "status": "created",
  "customer_to_customer_transfer_lines": [
    {
      "id": "2e7f2c3d-1c2b-4a5d-9e6f-7a8b9c0d1e2f",
      "from_variant": { "id": "f2894c16-399e-4ca1-9151-489775a6519c" },
      "to_variant": { "id": "87557e7a-4f4d-44eb-bbf1-c9d83df90099" },
      "quantity": 5,
      "finalized_quantity": 0
    }
  ]
}

PATCH/wms/customer-to-customer-transfers/:id/

Update a transfer

Update transfer metadata as long as the transfer has not been requested yet.

After performing the request action, a transfer can no longer be updated. Attempts will result in HTTP 412 Precondition Failed.

Example payload

  • Name
    external_reference
    Type
    string
    Description

Request

PATCH
/wms/customer-to-customer-transfers/:id/
curl -X PATCH https://eu-dev.middleware.ewarehousing-solutions.com/wms/customer-to-customer-transfers/8a6f0bc3-5a3c-4e3a-9f7e-1e2b3c4d5e6f/ \
-H 'Content-Type: application/json' \
--data-raw '{
  "external_reference": "TEST-C2C-ROLE-001-UPDATED"
}'

PUT/wms/customer-to-customer-transfers/:id/request

Request a transfer

Moves the transfer to status requested.

Request

PUT
/wms/customer-to-customer-transfers/:id/request
curl -X PUT https://eu-dev.middleware.ewarehousing-solutions.com/wms/customer-to-customer-transfers/8a6f0bc3-5a3c-4e3a-9f7e-1e2b3c4d5e6f/request

PUT/wms/customer-to-customer-transfers/:id/cancel

Cancel a transfer

Cancels the transfer.

Payload

  • Name
    note
    Type
    string
    Description
    Cancellation note

Request

PUT
/wms/customer-to-customer-transfers/:id/cancel
curl -X PUT https://eu-dev.middleware.ewarehousing-solutions.com/wms/customer-to-customer-transfers/8a6f0bc3-5a3c-4e3a-9f7e-1e2b3c4d5e6f/cancel \
-H 'Content-Type: application/json' \
--data-raw '{"note": "Cancel for testing"}'

Status codes

  • 200 OK: Successfully executed (read, request, cancel)
  • 201 Created: Successfully created (create)
  • 403 Forbidden: Missing role for the requested action
  • 404 Not Found: Transfer not found
  • 412 Precondition Failed: Transfer cannot be updated after it has been requested

When you want to enrich responses with variants or lines, use the Expand header with the groups customer_to_customer_transfer_lines and/or variant.