# Get Operation

**Endpoint**

`GET/v2/billing/operation/{id}`

**Link**

{% embed url="<https://stagep.tst-apidmndelss.com/openapi/v2.html#/operations/Billing_GetOperation>" %}

### **Request**

#### **Path Parameters**

| Parameter | Type     | Description                   | Required | Example      |
| --------- | -------- | ----------------------------- | -------- | ------------ |
| **`id`**  | `string` | **Operation ID** to retrieve. | Yes      | `"op_12345"` |

#### **Headers**

| Key             | Value              | Required |
| --------------- | ------------------ | -------- |
| `Authorization` | `Bearer <JWT>`     | Yes      |
| `Accept`        | `application/json` | Yes      |

***

### **Response (200 OK)**

Returns the complete operation object with all details.

#### **Response Fields**

**Operation Object**

| Field                      | Type      | Description                                                                                                                                                                                                                                                   | Example                  |
| -------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| **`opid`**                 | `string`  | **Unique operation ID**.                                                                                                                                                                                                                                      | `"op_12345"`             |
| **`isVisible`**            | `boolean` | **Visibility status**.                                                                                                                                                                                                                                        | `true`                   |
| **`status`**               | `string`  | <p><strong>Current status</strong>:<br>- <code>NEW</code>: Created<br>- <code>PENDING</code>: Under review<br>- <code>WORKING</code>: Processing<br>- <code>SUCCESS</code>: Completed<br>- <code>FAIL</code>: Failed<br>- <code>CANCELED</code>: Canceled</p> | `"SUCCESS"`              |
| **`type`**                 | `string`  | <p><strong>Operation type</strong>:<br>- <code>NOTSET</code><br>- <code>DEPOSIT</code><br>- <code>TRANSFER</code><br>- <code>WITHDRAW</code><br>- <code>COMMISSION</code><br>- <code>EXCHANGE</code><br>- <code>CORRECTING</code></p>                         | `"TRANSFER"`             |
| **`paymentType`**          | `string`  | <p><strong>Payment method</strong>:<br>- <code>EMPTY</code><br>- <code>ACH</code><br>- <code>FEDWIRE</code><br>- <code>SWIFT</code><br>- <code>CRYPTO</code><br>- <code>EFT</code><br>- <code>SEPA\_CT</code><br>- <code>IMPS</code></p>                      | `"SWIFT"`                |
| **`createdAt`**            | `string`  | Creation timestamp (ISO 8601).                                                                                                                                                                                                                                | `"2024-05-20T10:30:00Z"` |
| **`updatedAt`**            | `string`  | Last update timestamp (ISO 8601).                                                                                                                                                                                                                             | `"2024-05-20T14:45:00Z"` |
| **`source`**               | `object`  | **Source account details**.                                                                                                                                                                                                                                   | -                        |
| **`destination`**          | `object`  | **Destination account details**.                                                                                                                                                                                                                              | -                        |
| **`sourceAmount`**         | `object`  | **Source amount** with currency.                                                                                                                                                                                                                              | -                        |
| **`destinationAmount`**    | `object`  | **Destination amount** with currency.                                                                                                                                                                                                                         | -                        |
| **`commissionAmount`**     | `object`  | **Commission amount** with currency.                                                                                                                                                                                                                          | -                        |
| **`currentBalanceAmount`** | `object`  | **Current balance** after operation.                                                                                                                                                                                                                          | -                        |
| **`comment`**              | `string`  | **Operation comment/notes**.                                                                                                                                                                                                                                  | `"Supplier payment"`     |
| **`isParent`**             | `boolean` | **Parent operation flag**.                                                                                                                                                                                                                                    | `true`                   |
| **`reference`**            | `string`  | **Reference number**.                                                                                                                                                                                                                                         | `"REF202405201234"`      |
| **`customer`**             | `object`  | **Customer details**.                                                                                                                                                                                                                                         | -                        |
| **`documents`**            | `array`   | **Associated documents**.                                                                                                                                                                                                                                     | -                        |

**Source/Destination Objects**

Contains nested objects for:

* **`account`**: Account details (id, name, number, customer)
* **`counterpartyAccount`**: Counterparty details with bank information
* **`customer`**: Customer information (cuid, name)

**Money Object**

Used in amount fields:

| Field              | Type      | Description               | Example               |
| ------------------ | --------- | ------------------------- | --------------------- |
| **`currencyCode`** | `string`  | Currency code (ISO 4217). | `"USD"`               |
| **`units`**        | `string`  | Whole units.              | `"1000"`              |
| **`nanos`**        | `integer` | Fractional units (10^-9). | `500000000` (= $0.50) |

**Document Object**

| Field          | Type      | Description                               | Example                  |
| -------------- | --------- | ----------------------------------------- | ------------------------ |
| **`guid`**     | `string`  | **Document unique ID**.                   | `"doc_abc123"`           |
| **`fileName`** | `string`  | **Original filename**.                    | `"invoice.pdf"`          |
| **`size`**     | `integer` | **File size in bytes**.                   | `1024000`                |
| **`mime`**     | `string`  | **MIME type**.                            | `"application/pdf"`      |
| **`docType`**  | `string`  | **Document type** (see values in sample). | `"BANK_STATEMENT"`       |
| **`createAt`** | `string`  | **Upload timestamp**.                     | `"2024-05-20T11:00:00Z"` |

**Example Response (Successful Transfer):**

```json
{
  "item": {
    "opid": "op_12345",
    "isVisible": true,
    "status": "SUCCESS",
    "type": "TRANSFER",
    "paymentType": "SWIFT",
    "createdAt": "2024-05-20T10:30:00Z",
    "updatedAt": "2024-05-20T14:45:00Z",
    "source": {
      "account": {
        "id": "acc_12345",
        "name": "Business USD Account",
        "number": "ACC001",
        "customer": {
          "cuid": "cust_12345",
          "name": "Acme Inc."
        }
      }
    },
    "destination": {
      "counterpartyAccount": {
        "id": "cpa_78901",
        "name": "Supplier Account",
        "number": "IBAN123456789",
        "counterparty": {
          "suid": "suid_abc123",
          "name": "Global Suppliers Ltd",
          "bankName": "International Bank",
          "bankAddress": {
            "addressLine1": "123 Main Street",
            "city": "London",
            "countryIso": "GB",
            "postalCode": "SW1A 1AA"
          }
        },
        "customer": {
          "cuid": "cust_12345",
          "name": "Acme Inc."
        }
      }
    },
    "sourceAmount": {
      "sum": {
        "currencyCode": "USD",
        "units": "5000",
        "nanos": 0
      }
    },
    "destinationAmount": {
      "sum": {
        "currencyCode": "EUR",
        "units": "4600",
        "nanos": 0
      }
    },
    "commissionAmount": {
      "sum": {
        "currencyCode": "USD",
        "units": "25",
        "nanos": 0
      }
    },
    "currentBalanceAmount": {
      "sum": {
        "currencyCode": "USD",
        "units": "45000",
        "nanos": 0
      }
    },
    "comment": "Q2 supplier payment",
    "isParent": true,
    "reference": "REF202405201234",
    "customer": {
      "cuid": "cust_12345",
      "name": "Acme Inc."
    },
    "documents": [
      {
        "guid": "doc_abc123",
        "fileName": "invoice_2024_q2.pdf",
        "size": 1024000,
        "mime": "application/pdf",
        "docType": "OPERATION_DOCUMENT",
        "createAt": "2024-05-20T11:00:00Z"
      }
    ]
  }
}
```

**Example Response (Pending Withdrawal):**

```json
{
  "item": {
    "opid": "op_67890",
    "isVisible": true,
    "status": "PENDING",
    "type": "WITHDRAW",
    "paymentType": "CRYPTO",
    "createdAt": "2024-05-21T09:15:00Z",
    "updatedAt": "2024-05-21T09:15:00Z",
    "source": {
      "account": {
        "id": "acc_btc123",
        "name": "BTC Wallet",
        "number": "BTC001",
        "customer": {
          "cuid": "cust_12345",
          "name": "Acme Inc."
        }
      }
    },
    "destination": {
      "counterpartyAccount": {
        "id": "cpa_crypto456",
        "name": "External Wallet",
        "number": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
        "counterparty": {
          "suid": "suid_crypto789",
          "name": "External BTC Wallet"
        },
        "customer": {
          "cuid": "cust_12345",
          "name": "Acme Inc."
        }
      }
    },
    "sourceAmount": {
      "sum": {
        "currencyCode": "BTC",
        "units": "1",
        "nanos": 500000000
      }
    },
    "destinationAmount": {
      "sum": {
        "currencyCode": "BTC",
        "units": "1",
        "nanos": 500000000
      }
    },
    "commissionAmount": {
      "sum": {
        "currencyCode": "BTC",
        "units": "0",
        "nanos": 10000000
      }
    },
    "currentBalanceAmount": {
      "sum": {
        "currencyCode": "BTC",
        "units": "5",
        "nanos": 250000000
      }
    },
    "comment": "BTC withdrawal to external wallet",
    "isParent": true,
    "reference": "BTC20240521001",
    "customer": {
      "cuid": "cust_12345",
      "name": "Acme Inc."
    },
    "documents": []
  }
}
```

***

### **Examples**

#### **Request**

```bash
curl -X GET 'https://stagep.tst-apidmndelss.com/v2/billing/operation/op_12345' \
  -H 'Authorization: Bearer eyJhbGci...wNLGA' \
  -H 'Accept: application/json'
```

***

### **Error Responses**

1. **Operation Not Found**:

   ```json
   { "error": "Operation not found: op_99999" }
   ```
2. **Unauthorized**:

   ```json
   { "error": "Unauthorized" }
   ```

***

### **Notes**

* **Status Tracking**: Use to monitor operation progress through status changes
* **Audit Trail**: Provides complete transaction history for compliance
* **Document Management**: Shows all documents associated with the operation
* **Balance Information**: Includes current balance reflecting the operation's impact
* **Real-time Data**: Reflects the most current operation state

**Common Use Cases**:

* Operation status monitoring
* Transaction details for customer support
* Audit and compliance reporting
* Document verification

Request sample

```postman_json
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE2NCwiZXhwIjoxNzYxNjU0MTQ3LCJrZXkiOiI1Y2ZiOGZjN2RmYjk4ZjVkYmIyZTgwNTVkZWFhN2U2Zjk4MzEyYmE3Iiwib3RwX3ZlcmlmaWVkIjpmYWxzZX0.uTzFrsUHSQp0zdU86OnQVlbWafLlJi3tSvx0bKzBRjk
id*: 8248956e-a002-4404-aafc-be8fd8dc16b6

```

Response sample

```postman_json
{
  "item": {
    "operationId": "8248956e-a002-4404-aafc-be8fd8dc16b6",
    "isVisible": true,
    "status": "PENDING",
    "type": "EXCHANGE",
    "paymentType": "EMPTY",
    "createdAt": "2025-10-28T12:09:33Z",
    "updatedAt": "2025-10-28T12:11:33Z",
    "source": {
      "counterpartyAccount": {
        "id": "string",
        "name": "",
        "number": "",
        "counterparty": null,
        "customer": null
      }
    },
    "destination": {
      "counterpartyAccount": {
        "id": "string",
        "name": "",
        "number": "",
        "counterparty": null,
        "customer": null
      }
    },
    "sourceAmount": {
      "sum": {
        "currencyCode": "USD",
        "units": "98",
        "nanos": 0
      },
      "default": {
        "currencyCode": "USD",
        "units": "98",
        "nanos": 0
      }
    },
    "destinationAmount": {
      "sum": {
        "currencyCode": "USDT_ERC20",
        "units": "98",
        "nanos": 0
      },
      "default": {
        "currencyCode": "USD",
        "units": "98",
        "nanos": 0
      }
    },
    "commissionAmount": {
      "sum": {
        "currencyCode": "USD",
        "units": "2",
        "nanos": 0
      },
      "default": {
        "currencyCode": "USD",
        "units": "2",
        "nanos": 0
      }
    },
    "currentBalanceAmount": {
      "sum": {
        "currencyCode": "USD",
        "units": "835",
        "nanos": 800000002
      },
      "default": {
        "currencyCode": "USD",
        "units": "835",
        "nanos": 800000002
      }
    },
    "comment": "testapi",
    "isParent": false,
    "reference": "string",
    "customer": {
      "id": "D7k3xbc-ERrj-lde9k1t3XuaE",
      "name": ""
    },
    "documents": []
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.delos.financial/operations/get-operation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
