# Create a Subscription request

For managing subscriptions, the first step is to create one through our [Dashboard](https://dashboard.one.lat/), specifically in the **Subscriptions** section. When creating the subscription, you’ll need to specify details such as the amount per period and the duration. Once the subscription is set up, you can use the ID to create subsequent Checkout Preferences, allowing new users to subscribe easily.

1. Go to ONE dashboard and create a subscription in **Subscriptions** section
2. Copy the Subscription ID to be send in the `payment_link_id` request's field.

<figure><img src="https://3771488238-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FysdUbUhqFAVSkdnkDhbU%2Fuploads%2F4vEwfVMprVQNoNadmJSC%2FScreenshot_2025-07-10_at_6_05_39%E2%80%AFPM.png?alt=media&#x26;token=ef2bd0a8-0331-4bc0-bd3b-4091df16a592" alt=""><figcaption></figcaption></figure>

Now you’re ready to make the request.

## Create a subscription

<mark style="color:green;">`POST`</mark> `/v1/checkout_preferences`

**Headers**

| Name         | Value               |
| ------------ | ------------------- |
| x-api-key    | `<your api key>`    |
| x-api-secret | `<your api secret>` |

**Body**

<table><thead><tr><th width="180">Name</th><th width="94">Type</th><th width="119.19921875">Required</th><th>Description</th></tr></thead><tbody><tr><td>type </td><td>string</td><td>required ✳️</td><td><strong>SUBSCRIPTION</strong></td></tr><tr><td>payment_link_id</td><td>string</td><td>required ✳️</td><td>You must include the <strong>Subscription ID</strong> from your Dashboard as the <strong>payment_link_id</strong></td></tr><tr><td>origin</td><td>string</td><td>required ✳️</td><td>Use "<strong>API</strong>" here</td></tr><tr><td>external_id</td><td>string</td><td>optional</td><td>Your business entity ID</td></tr><tr><td>expiration_date</td><td>string</td><td>optional</td><td>Date in RFC3339 format: <code>yyyy-MM-dd'T'HH:mm:ss'Z'</code> (e.g., <code>2016-11-01T20:44:39Z</code>). The <code>expiration_date</code> must be no more than one week from the current date. If you don't provide an <code>expiration_date</code>, it will default to 15 minutes.</td></tr><tr><td>payer</td><td>Object</td><td>optional</td><td>If you provide the payer’s details in advance, they won’t be asked again at checkout</td></tr><tr><td>payer.email</td><td>string</td><td>optional</td><td>Payer's email ie. johndoe@gmail.com</td></tr><tr><td>payer.name</td><td>string</td><td>optional</td><td>Payer's name</td></tr><tr><td>payer.last_name</td><td>string</td><td>optional</td><td>Payer's last name</td></tr><tr><td>payer.phone</td><td>string</td><td>optional</td><td>Payer's phone number</td></tr><tr><td>payment_method_types</td><td>[]string</td><td>optional</td><td>List of available payment methods to include in your checkout preference. If none are specified, all payment methods will be enabled by default.</td></tr><tr><td>selected_payment_method_id</td><td>string</td><td>optional</td><td>If you provide the ID of a specific payment method, the customer won’t need to choose one at checkout</td></tr></tbody></table>

**Example**

{% tabs %}
{% tab title="Request" %}

```json
curl 'https://api.one.lat/v1/checkout_preferences' \
--header 'x-api-key: MY_API_KEY' \
--header 'x-api-secret: MY_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
    "payment_link_id": ID,
    "origin": "API",
    "external_id": "external_id_1234",
    "type: "SUBCRIPTION",
    "custom_urls": {
        "status_changes_webhook": "https://api.mycompany.io/webhook",
	"success_payment_redirect": "https://mycompany.io/success.html",
	"error_payment_redirect": "https://mycompany.io/error.html"
    },
    "payer": {
        "email": "luca@test.com",
	"phone_number": "+521142567689",
        "first_name": "Luca",
        "last_name": "Dorain"
    },
}'
```

{% endtab %}
{% endtabs %}
