> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zodia-custody.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Instruct a Transfer

> How to instruct a transfer from a wallet to a whitelisted address

This section describes an end-to-end flow to create a transaction to beneficiary.

Please retreive this payload template using the [List Products API](#operation/getv3servicedeskproducts).

Here is an example :

### 1. Create transfer instruction

We assumed the wallet has been funded prior to initiating the transfer.

#### Request

```shell theme={null}
curl --request POST 'https://hostname.zodia.io/v3/api/servicedesk/create'
--header 'company-identifier: ' \
--header 'submitter-id: ' \
--header 'request-identifier: ' \
--header 'request-timestamp: ' \
--header 'Content-Type: application/json' \
--header 'signature: ' \
--data-raw 
'{
  "serviceId": "0x0014-007",
  "payload": {
    "sender": {
      "type": "WALLETID",
      "value": "ZODCS-NOBENF-E3WB8MB4EI"
    },
    "destination": {
      "type": "BENEFICIARYADDRESSID",
      "value": "467f0fbf-7cd0-4196-b8be-7a33ac66f4f6"
    },
    "amount": "50000",
    "subtractFee": false
  }
}'

```

#### Response

`HTTP 200`

```json theme={null}
{
  "requestId": "SERV-REQ-A02R2928OC",
  "pluginDetail": {
    "entityId": "TRO-LUXOR-P01HT6O1UT",
    "details": [
      {
        "sender": {
          "type": "WALLETID",
          "value": "ZODCS-NOBENF-E3WB8MB4EI"
        },
        "destination": {
          "type": "BENEFICIARYADDRESSID",
          "value": "467f0fbf-7cd0-4196-b8be-7a33ac66f4f6"
        },
        "amount": "50000",
        "subtractFee": false
      }
    ]
  }
}

```

### 2. Submit service request

Use the request id obtained in the previous request to submit the instruction.

#### Request

```shell theme={null}
curl --request POST 'https://hostname.zodia.io/v3/api/servicedesk/submit' \
--header 'company-identifier: ' \
--header 'submitter-id: ' \
--header 'request-identifier: ' \
--header 'request-timestamp: ' \
--header 'Content-Type: application/json' \
--header 'signature: ' \
--data '{
  "requestId": "SERV-REQ-A02R2928OC"
}'

```

#### Response

`HTTP 200`

### 3. Retrieve instruction to sign as maker

Retrieve the HSM instruction to be signed by the maker

#### Request

```shell theme={null}
curl --request POST 'https://hostname.zodia.io/v3/api/servicedesk/pending' \
--header 'company-identifier: ' \
--header 'submitter-id: ' \
--header 'request-identifier: ' \
--header 'request-timestamp: ' \
--header 'Content-Type: application/json' \
--header 'signature: ' \
--data '{
  "requestId": "SERV-REQ-A02R2928OC",
}'

```

#### Response

`HTTP 200`

```json theme={null}
{
  "request": {
    ...
  },
  "signature": "$$REPLACE$$"
}

```

### 4. Confirm transfer instruction as maker

Sign the 'request' element with the API maker private key, insert the string in 'signature'

#### Request

```shell theme={null}
curl --request POST 'https://hostname.zodia.io/v3/api/servicedesk/approve'
--header 'company-identifier: ' \
--header 'submitter-id: ' \
--header 'request-identifier: ' \
--header 'request-timestamp: ' \
--header 'Content-Type: application/json' \
--header 'signature: ' \
--data-raw 
{
  "requestId": "SERV-REQ-A02R2928OC",
  "request": {
    ...
  },
  "signature": "MEYCIQDgag6BsAjQoKe7BPObXUsCC09X2gk0yrLYtxp8qg+R9QIhAJOT+fD3MrjmHHOKD1PO9nLcKhnUrQYSx/w022fO1z9p"
}

```

#### Response

`HTTP 200`

### 5. Retrieve instruction to sign as authoriser

#### Request

```shell theme={null}
curl --location 'https://hostname.zodia.io/v3/api/servicedesk/pending' \
--header 'company-identifier: ' \
--header 'submitter-id: ' \
--header 'request-identifier: ' \
--header 'request-timestamp: ' \
--header 'Content-Type: application/json' \
--header 'signature: ' \
--data '{
  "requestId": "SERV-REQ-A02R2928OC"
}'

```

#### Response

```json theme={null}
{
  "requestId": "SERV-REQ-A02R2928OC",
  "request": {
    ...,
    "type": "Approve|Reject"
  },
  "signature": "MEQCIA/KgOFOxWQzeTpyZerRjcxucXBgdWBFzBdcczEqurkOAiAwcTIFg2XLgE5pfvV+decUKLEzejk1zYe/DFVxW55pdg=="
}

```

### 6a. Approve transfer instruction as authoriser

To approve an instruction set `type` to `Approve`. To reject an instruction, set `type` to `Reject` and set a `rejectReason`.

#### Request

```shell theme={null}
curl --request POST 'https://hostname.zodia.io/v3/api/servicedesk/approve'
--header 'company-identifier: ' \
--header 'submitter-id: ' \
--header 'request-identifier: ' \
--header 'request-timestamp: ' \
--header 'Content-Type: application/json' \
--header 'signature: ' \
--data-raw 
{
  "requestId": "SERV-REQ-A02R2928OC",
  "request": {
    ...,
    "type": "Approve"
  },
   "signature": "MEQCID0XsCYDvVpo2eLD88LH4CpygowzUVAQGpkqhjbMZuMNAiB6rypnraKaKwRsarWSKJGYnx31NfrBQGekUj6yc7wfTg=="
}

```

#### Response

`HTTP 200`

### 6b. Reject transfer instruction as authoriser

To reject any type of instruction, set `type` to `Reject` and specify a `rejectReason`

#### Request

```shell theme={null}
curl --request POST 'https://hostname.zodia.io/v3/api/servicedesk/approve'
--header 'company-identifier: ' \
--header 'submitter-id: ' \
--header 'request-identifier: ' \
--header 'request-timestamp: ' \
--header 'Content-Type: application/json' \
--header 'signature: ' \
--data-raw 
{
  "requestId": "SERV-REQ-A02R2928OC",
  "request": {
    ...,
    "type": "Reject",
    "rejectReason": "Unknown request"
  },
   "signature": "MEQCID0XsCYDvVpo2eLD88LH4CpygowzUVAQGpkqhjbMZuMNAiB6rypnraKaKwRsarWSKJGYnx31NfrBQGekUj6yc7wfTg=="
}

```

#### Response

`HTTP 200`
