MedicalTrace

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

ParameterInRequiredTypeDescription
AuthorizationheaderYesstringBearer token from POST /auth/login. The sample value demo.local.jwt is a placeholder.
X-Organization-IdheaderYesstringCurrent custodian. Demo Manufacturer at registration.
equipmentIdbodyYesstringEquipment to hand over.
receiverOrgIdbodyYesstringOrganization that must accept. Demo Hospital in the sample.
expiresAtbodyNostringOptional 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

FieldTypeDescriptionExample
idstringTransfer id for accept or reject.66666666-6666-4666-8666-666666666666
statestringREQUESTED, ACCEPTED, REJECTED, CANCELLED, or EXPIRED.REQUESTED
expectedVersionnumberCustody version at request time. A mismatch on accept returns 409.1