> For the complete documentation index, see [llms.txt](https://docs.udara360.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.udara360.io/udara360-docs-1/bills-payments/bill-payments/get-token.md).

# Get Token

The "Get Token" endpoint allows customers to retrieve the prepaid electricity token generated from a previous Vend transaction.

<mark style="color:green;">`GET`</mark> `/api/Bills/v1/GetToken`

{% hint style="info" %}
This endpoint applies to electricity billers only.
{% endhint %}

To retrieve a token, you need to provide the query parameters `PostingReference` and `PaymentReference.`

**Headers**

| Name                                            | Value                |
| ----------------------------------------------- | -------------------- |
| Content-Type<mark style="color:red;">\*</mark>  | `application/json`   |
| Authorization<mark style="color:red;">\*</mark> | `Bearer`             |
| Request-Reference                               | `{unique_reference}` |

**Query Params**

| Name               | Description                                             |
| ------------------ | ------------------------------------------------------- |
| `PostingReference` | The posting reference of the original Vend transaction. |
| `PaymentReference` | The payment reference of the original Vend transaction. |

Here is an example request and response with a sample payload sent to the endpoint in Curl format.

<details>

<summary>Sample Request</summary>

```json
curl --location -g '{{baseurl}}/api/Bills/v1/GetToken?PostingRefernce=&PaymentReference=' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--data ''
```

</details>

<details>

<summary>Response: <code>200</code></summary>

```json
{
  "status": true,
  "message": "string",
  "data": {
    "token": "string",
    "tokenUnits": 0,
    "customerId": "string",
    "packageName": "string",
    "billerIdentifier": "string",
    "billType": "string"
  }
}
```

</details>
