Request a custody transfer
Ask another organization to accept custody.
Requires transfer:initiate. Only the current custodian can request. The transfer stays REQUESTED until the receiver accepts. Acceptance is not a transfer of legal title. expiresAt is optional.
1. Request URL
POST https://api.medicaltrace.net/v1/custody/transfers
2. Request parameters
| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
Authorization | header | Yes | string | Bearer token from POST /auth/login. The sample value demo.local.jwt is a placeholder. |
X-Organization-Id | header | Yes | string | Current custodian. Demo Manufacturer at registration. |
equipmentId | body | Yes | string | Equipment to hand over. |
receiverOrgId | body | Yes | string | Organization that must accept. Demo Hospital in the sample. |
expiresAt | body | No | string | Optional ISO-8601 expiry. Expiry leaves custody where it was. |
3. Request example
curl -s -X POST 'https://api.medicaltrace.net/v1/custody/transfers' \
-H 'content-type: application/json' \
-H 'authorization: Bearer demo.local.jwt' \
-H 'x-organization-id: 11111111-1111-4111-8111-111111111111' \
-d '{"equipmentId":"44444444-4444-4444-8444-444444444444","receiverOrgId":"22222222-2222-4222-8222-222222222222"}'4. Response data
HTTP 201. The body below uses the fictional DEMO-BED-001 fixtures.
{
"id": "66666666-6666-4666-8666-666666666666",
"equipmentId": "44444444-4444-4444-8444-444444444444",
"senderOrgId": "11111111-1111-4111-8111-111111111111",
"receiverOrgId": "22222222-2222-4222-8222-222222222222",
"expectedVersion": 1,
"state": "REQUESTED"
}5. Response fields
| Field | Type | Description | Example |
|---|---|---|---|
id | string | Transfer id for accept or reject. | 66666666-6666-4666-8666-666666666666 |
state | string | REQUESTED, ACCEPTED, REJECTED, CANCELLED, or EXPIRED. | REQUESTED |
expectedVersion | number | Custody version at request time. A mismatch on accept returns 409. | 1 |