transferOrderUpdate
Updates an existing transfer order. The transfer order must be in DRAFT state to be updated.
Provide the id field in the input to identify the transfer order, and set only the fields you want to change.
Required scope: edit_transfer_orders
Mutation
graphql
mutation TransferOrderUpdate($input: TransferOrderInput!) {
transferOrderUpdate(input: $input) {
id
fulfillmentOrderId
type
state
date
}
}Return type: FulfillmentActionType
| Field | Description |
|---|---|
id | Unique identifier of this update action |
fulfillmentOrderId | The transfer order UUID |
type | Action type — UPDATE for this mutation |
state | Processing state of the action (ACCEPTED, REJECTED) |
date | Timestamp of the action |
Input: TransferOrderInput
The same TransferOrderInput type used in transferOrderCreate. Provide the id field to target the transfer order to update, and set only the fields you want to change.
| Field | Type | Required | Description |
|---|---|---|---|
id | String | ✅ | Internal transfer order UUID to update |
organizationId | String | ❌ | Organization UUID |
locationId | String | ❌ | Destination fulfillment location UUID |
reference | String | ❌ | Internal reference for the transfer |
supplierId | String | ❌ | Supplier UUID |
externalReference | String | ❌ | External system reference |
containerNumber | Int | ❌ | Number of containers |
containerType | TransferOrderContainerTypeEnum | ❌ | BOX, PALLET, or CONTAINER |
expectedDate | DateTime | ❌ | Expected delivery date at the warehouse |
organizationAcronym | String | ❌ | Organization short code |
lines | [TransferOrderLineInput!] | ❌ | Updated transfer order lines |
shippingDate | DateTime | ❌ | Shipping date |
carrier | String | ❌ | Carrier name |
tracking | String | ❌ | Tracking number |
comment | String | ❌ | Free-text comment |
issuedAt | DateTime | ❌ | Issue date |
emergency | Boolean | ❌ | Emergency flag |
TransferOrderLineInput
| Field | Type | Required | Description |
|---|---|---|---|
id | String | ❌ | Line ID — required when updating an existing line |
stockReferenceId | String | ❌ | Stock reference UUID |
sku | String | ✅ | SKU identifier |
reference | String | ✅ | Product reference or label |
limitUsageDate | String | ❌ | Expiry or use-by date |
batchNumber | String | ❌ | Batch or lot number |
expectedQuantity | Int | ✅ | Expected quantity to receive |
receivedQuantity | Int | ❌ | Received quantity |
restockedQuantity | Int | ❌ | Restocked quantity |
garbageQuantity | Int | ❌ | Garbage or damaged quantity |
meta | JSON | ❌ | Additional metadata |
Example Variables
json
{
"input": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"expectedDate": "2024-02-20T08:00:00Z",
"containerNumber": 5,
"carrier": "FedEx",
"tracking": "794644790100",
"comment": "Updated delivery — new carrier",
"lines": [
{
"id": "line-uuid-001",
"sku": "WIDGET-A-100",
"reference": "Widget Alpha",
"expectedQuantity": 750
},
{
"sku": "GADGET-C-300",
"reference": "Gadget Gamma",
"expectedQuantity": 100
}
]
}
}Example Response
json
{
"data": {
"transferOrderUpdate": {
"id": "action-uuid-001",
"fulfillmentOrderId": "550e8400-e29b-41d4-a716-446655440000",
"type": "UPDATE",
"state": "ACCEPTED",
"date": "2024-02-11T10:00:00.000Z"
}
}
}Code Examples
bash
curl -X POST https://api-v3.happycolis.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"query": "mutation TransferOrderUpdate($input: TransferOrderInput!) { transferOrderUpdate(input: $input) { id fulfillmentOrderId type state date } }",
"variables": {
"input": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"expectedDate": "2024-02-20T08:00:00Z",
"containerNumber": 5,
"comment": "Updated delivery — new carrier"
}
}
}'js
const mutation = `
mutation TransferOrderUpdate($input: TransferOrderInput!) {
transferOrderUpdate(input: $input) {
id
fulfillmentOrderId
type
state
date
}
}
`;
const response = await fetch('https://api-v3.happycolis.com/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.ACCESS_TOKEN}`,
},
body: JSON.stringify({
query: mutation,
variables: {
input: {
id: '550e8400-e29b-41d4-a716-446655440000',
expectedDate: '2024-02-20T08:00:00Z',
containerNumber: 5,
comment: 'Updated delivery — new carrier',
},
},
}),
});
const { data } = await response.json();
console.log(data.transferOrderUpdate);python
import os
import requests
mutation = """
mutation TransferOrderUpdate($input: TransferOrderInput!) {
transferOrderUpdate(input: $input) {
id
fulfillmentOrderId
type
state
date
}
}
"""
response = requests.post(
'https://api-v3.happycolis.com/graphql',
headers={'Authorization': f'Bearer {os.environ["ACCESS_TOKEN"]}'},
json={
'query': mutation,
'variables': {
'input': {
'id': '550e8400-e29b-41d4-a716-446655440000',
'expectedDate': '2024-02-20T08:00:00Z',
'containerNumber': 5,
'comment': 'Updated delivery — new carrier',
}
},
},
)
data = response.json()['data']
print(data['transferOrderUpdate'])php
<?php
$mutation = <<<'GQL'
mutation TransferOrderUpdate($input: TransferOrderInput!) {
transferOrderUpdate(input: $input) {
id
fulfillmentOrderId
type
state
date
}
}
GQL;
$ch = curl_init('https://api-v3.happycolis.com/graphql');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
'query' => $mutation,
'variables' => [
'input' => [
'id' => '550e8400-e29b-41d4-a716-446655440000',
'expectedDate' => '2024-02-20T08:00:00Z',
'containerNumber' => 5,
'comment' => 'Updated delivery — new carrier',
],
],
]),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer ' . getenv('ACCESS_TOKEN'),
],
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($result['data']['transferOrderUpdate']);go
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
)
func main() {
mutation := `
mutation TransferOrderUpdate($input: TransferOrderInput!) {
transferOrderUpdate(input: $input) {
id
fulfillmentOrderId
type
state
date
}
}`
body, _ := json.Marshal(map[string]any{
"query": mutation,
"variables": map[string]any{
"input": map[string]any{
"id": "550e8400-e29b-41d4-a716-446655440000",
"expectedDate": "2024-02-20T08:00:00Z",
"containerNumber": 5,
"comment": "Updated delivery — new carrier",
},
},
})
req, _ := http.NewRequest("POST", "https://api-v3.happycolis.com/graphql", bytes.NewBuffer(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("ACCESS_TOKEN"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var result map[string]any
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["data"])
}