# 1. Create (Wallet)

## Create Gift Balance with Wallet 'Id'

<mark style="color:yellow;">`POST`</mark>`{{WalletUrl}}/api/v1/balance/gift`&#x20;

{% hint style="info" %}
**Note:** To use this service, it is mandatory to include the **apikeypublic** and **apiclientpublic** parameters in the Header field.

\
[<mark style="color:green;">**WalletAPI Address**</mark>](https://developer.paywall.one/payment-orchestration-integration-document/environment)
{% endhint %}

**The parameters that need to be sent to the service are as follows:**

<table><thead><tr><th width="162">Parameter</th><th width="79">Type</th><th width="107">Required</th><th width="403">Description</th></tr></thead><tbody><tr><td>apikeypublic</td><td>string</td><td>Yes</td><td>It is the shared key information that provides general access to the API services.</td></tr><tr><td>apiclientpublic</td><td>string</td><td>Yes</td><td>It is the public client key information that defines the client application.</td></tr></tbody></table>

{% tabs %}
{% tab title="Service Reguest - JSON" %}
{% code lineNumbers="true" %}

```json
{
  "WalletId": "30bac1c0-ad6b-4c50-a52e-1b34f9b487a7",
  "Amount": 1000,
  "ExpirationDate": "2026-04-29T02:00:34.426Z",
  "Description": "KUPON100"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Service Request

| Parameter      | Type      | Description                                                                                                                                                                                                                                                                                                                                                       |
| -------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| WalletId       | Guid      | The identity information of the wallet where the gift balance will be assigned.                                                                                                                                                                                                                                                                                   |
| Amount         | decimal   | The gift balance to be assigned.                                                                                                                                                                                                                                                                                                                                  |
| ExpirationDate | DateTime? | <p>If you want the gift balance to be valid until a specific date, you can specify a date.<br><br><mark style="color:purple;">If a date is provided</mark>, the amount will automatically become inactive if not spent by that date.<br><br><mark style="color:orange;">If no date is provided</mark>, the amount will remain in the wallet until it is used.</p> |
| Description    | string    | <p>The description of the given gift balance.</p><p></p><p>Example: "Birthday"</p>                                                                                                                                                                                                                                                                                |

{% tabs %}
{% tab title="Service Reguest - JSON" %}
{% code lineNumbers="true" %}

```json
{
    "Value": {
        "Id": "6a623f97-c376-44ea-8995-09dfacd0ddcf",
        "WalletId": "30bac1c0-ad6b-4c50-a52e-1b34f9b487a7",
        "Amount": 1000,
        "RemainingAmount": 1000,
        "ExpirationDate": "2026-04-29T02:00:34.426Z",
        "IsUnlimited": false,
        "Description": "KUPON100",
        "IsUsed": false,
        "IsFullyUsed": false,
        "IsPartiallyUsed": false,
        "LastTransactionId": null,
        "CreatedAt": "2025-04-30T11:11:07.516534Z",
        "UpdatedAt": null
    },
    "Errors": [],
    "IsSuccess": true,
    "IsFailure": false
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## **Service Response**

<table><thead><tr><th width="192">Parameter</th><th width="147.89192708333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>IsFailure</td><td>bool</td><td>Returns <strong>true</strong> if the operation is successful, <strong>false</strong> otherwise.</td></tr><tr><td>IsSuccess</td><td>bool</td><td>Returns <strong>true</strong> if the operation is successful, <strong>false</strong> otherwise.</td></tr><tr><td>Errors</td><td>Array</td><td>It is an array structure containing the details of the encountered errors.</td></tr><tr><td>Value</td><td>Array</td><td>Contains a list of items with the result data.</td></tr></tbody></table>

## **Service Response** (Value)

<table><thead><tr><th width="234.05859375">Parameter</th><th width="162.38671875">Type</th><th width="348.94140625">Description</th></tr></thead><tbody><tr><td>Id</td><td>Guid</td><td>A unique identifier for this entity within the system.</td></tr><tr><td>WalletId</td><td>Guid</td><td>The unique ID of the wallet associated with the record.</td></tr><tr><td>Amount</td><td>string</td><td>Holds the total amount defined as a textual value.</td></tr><tr><td>RemainingAmount</td><td>decimal</td><td>Represents the remaining unused portion of the current balance.</td></tr><tr><td>ExpirationDate</td><td>decimal</td><td>Represents the expiration date of the amount in timestamp format.</td></tr><tr><td>IsUnlimited</td><td>string</td><td>Indicates whether the balance has an unlimited validity period ("true"/"false").</td></tr><tr><td>Description</td><td>string</td><td>A description of the amount or transaction, providing information to the user.</td></tr><tr><td>IsUsed</td><td>DateTime</td><td>Indicates the time when this amount was used at least once.</td></tr><tr><td>IsFullyUsed</td><td>DateTime</td><td>The date when the amount was fully consumed.</td></tr><tr><td>IsPartiallyUsed</td><td>decimal</td><td>Shows the amount that was only partially used.</td></tr><tr><td>LastTransactionId</td><td>Guid</td><td>The ID of the last transaction that used this balance.</td></tr><tr><td>CreatedAt</td><td>Guid</td><td>The creation date of the record (likely data type should be DateTime).</td></tr><tr><td>UpdatedAt</td><td>int</td><td>A UNIX timestamp indicating when the record was last updated.</td></tr></tbody></table>
