# Subscription

Subscription is the process of recurring payments by a interval.

Subscription is useful for charging consumers a fixed sum of money, e.g. $10.99 per month, or any kind of future payments with a chosen sum.

## Create a Subscription

<mark style="color:green;">`POST`</mark> `https://api.sensepass.com/api/transactions/init`

#### Request Body

| Name                                         | Type   | Description                                                                                                                                             |
| -------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| timeOut                                      | number | 600                                                                                                                                                     |
| amount                                       | number | 1000                                                                                                                                                    |
| deviceId<mark style="color:red;">\*</mark>   | string | 2ooeww5ufzg3nkuf8a10g15i5epu8o58jv1rznif3o1tr6xsb1rm                                                                                                    |
| methodType<mark style="color:red;">\*</mark> | string | subscription                                                                                                                                            |
| callbackURL                                  | string | <p><https://your-domain.com/some-post-method-callback-endpoint>  </p><p>See <a href="subscription/subscription-callbacks">Subsciption callbacks</a></p> |
| subscription.interval                        | string | <p>Examples: 1day, 14day, 1month, 3month, 1year. </p><p>Default value: 1month</p>                                                                       |
| subscription.expiration                      | string | 2024-01-01T12:00:00Z                                                                                                                                    |
| subscription.dueDate                         | string | 2023-01-01T12:00:00Z                                                                                                                                    |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "TransactionNumber": "5f3275249792ee75b41322e636617ee039e2e1a49cc80c11f2177233",
    "date": "2022-08-14T10:09:05.810Z",
    "status": 0,
    "statusName": "Initialize",
    "timeoutDate": "2022-08-14T10:19:05.872Z",
    "paymentCommit": {
        "messsage": "Payment commit is enabled for this transaction"
    },
    "businessId": "339978940107456",
    "businessName": "Coffee Bar",
    "pos": "POS 1",
    "businessOwnerPhone": "3587292",
    "businessCountry": "US",
    "businessCity": "Virginia Beach",
    "businessStreet": "123 Street",
    "businessAddress": "123 Street, Virginia Beach",
    "branchNumber": "1",
    "branchId": "1",
    "subscription": {
        "id": "bf8b7e01-466d-4996-b9a2-fc0880923359",
        "active": true,
        "created": "2023-05-30T14:35:13.698Z",
        "updated": "2023-05-30T14:35:13.698Z",
        "expires": null,
        "start_date": "2023-01-01T12:00:00.000Z",
        "interval": "1month",
        "status": "active",
        "customer": {}
    },
    "transactionPage": {
        "iOSLink": "https://pay.sandbox.sensepass.com/orderSummary/5f3275249792ee75b41322e636617ee039e2e1a49cc80c27f2177233",
        "androidLink": "https://pay.sandbox.sensepass.com/orderSummary/5f3275249792ee75b41322e636617ee039e2e1a49cc80c27f2177233",
        "qrURL": "https://pay.sandbox.sensepass.com/orderSummary/5f3275249792ee75b41322e636617ee039e2e1a49cc80c27f2177233"
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Refer to the Subscritption entity at [subscription-model](https://docs.sensepass.com/sensepay/transaction-api/models/subscription-model "mention") for additional information.
{% endhint %}
