# Get specific wallet charge details

GET https://services.leadconnectorhq.com/marketplace/billing/charges/{chargeId}

Get specific wallet charge details

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token only (Private Integration Tokens are not accepted).** Scopes: `charges.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `chargeId` | string | Yes | ID of the charge to retrieve |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "LeadConnector API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/marketplace/billing/charges/{chargeId}": {
      "get": {
        "summary": "Get specific wallet charge details",
        "operationId": "getSpecificWalletChargeDetails",
        "description": "Get specific wallet charge details",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "required": true,
            "description": "API Version",
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          },
          {
            "name": "chargeId",
            "required": true,
            "in": "path",
            "description": "ID of the charge to retrieve",
            "schema": {
              "example": "charge_123",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns charge details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSpecificWalletChargeDetailsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Charge not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSpecificWalletChargeDetailsError404"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "Location-Access-Only": [
              "charges.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "GetSpecificWalletChargeDetailsResponse": {
        "type": "object",
        "properties": {
          "refunded": {
            "type": "boolean",
            "description": "Value is 'true' if the charge has subsequently been refunded.",
            "example": false
          },
          "currency": {
            "type": "string",
            "description": "Currency of the transaction. We currently support USD only.",
            "example": "USD"
          },
          "appId": {
            "type": "string",
            "description": "App ID",
            "example": "6578278e879ad2646715ba9c"
          },
          "meterId": {
            "type": "string",
            "description": "Billing Meter ID (you can find this on your app's pricing page)",
            "example": "680b97022b4a34420f5f9b93"
          },
          "chargeId": {
            "type": "string",
            "description": "Charge ID",
            "example": "charge_123"
          },
          "entityType": {
            "type": "string",
            "description": "Indicates who was charged? Currently, we support charges for 'location' only",
            "example": "location"
          },
          "entityId": {
            "type": "string",
            "description": "If the entityType is Location, entityld would be locationld.",
            "example": "ve9EPM428h8vShlRW1KT"
          },
          "amountCharged": {
            "type": "number",
            "description": "Total amount charged",
            "example": 0.1
          },
          "pricePerUnit": {
            "type": "number",
            "description": "Price per unit for the charge",
            "example": 0.01
          },
          "transactionType": {
            "type": "string",
            "description": "This can be one of two values - 'charge' or 'refund'",
            "example": "charge"
          },
          "units": {
            "type": "number",
            "description": "Number of units that the sub-account was charged for",
            "example": 10
          },
          "meta": {
            "type": "object",
            "description": "meta object contains details that were sent while creating the charge via the API - eventID, description, eventTime, userld",
            "example": {
              "eventId": "evt_abc123",
              "description": "Charge for 10 SMS messages"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the charge was created in our system",
            "example": "2025-03-26T00:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the charge was last updated in our system",
            "example": "2025-03-26T00:00:00.000Z"
          }
        }
      },
      "GetSpecificWalletChargeDetailsError404": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message describing why the charge was not found",
            "example": "Charge not found"
          },
          "statusCode": {
            "type": "number",
            "description": "HTTP status code",
            "example": 404
          }
        }
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/marketplace/billing/charges/<chargeId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/marketplace/billing/charges/<chargeId>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/marketplace/billing/charges/{chargeId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

response = requests.get(url, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/marketplace/billing/charges/<chargeId>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/marketplace/billing/charges/<chargeId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/marketplace/billing/charges/<chargeId>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/marketplace/billing/charges/<chargeId>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/marketplace/billing/charges/<chargeId>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
