# Request a one-time payment

## Create a one-time payment request

<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="321.078125">Name</th><th width="91">Type</th><th width="111">Required</th><th>Description</th></tr></thead><tbody><tr><td>type</td><td>string</td><td>required ✳️</td><td><strong>PAYMENT</strong></td></tr><tr><td>amount</td><td>float</td><td>required ✳️</td><td>The amount must be between 0.1 and 3000 USD</td></tr><tr><td>currency</td><td>string</td><td>required ✳️</td><td><a href="../../resources/currencies">The currency</a> of the payment</td></tr><tr><td>title</td><td>string</td><td>required ✳️</td><td>Description of checkout_preference ie. "Introductory course to Blockchain"</td></tr><tr><td>origin</td><td>string</td><td>required ✳️</td><td>if use api integration use "API"</td></tr><tr><td>external_id</td><td>string</td><td>optional</td><td>Your ID</td></tr><tr><td>expiration_date</td><td>string</td><td>optional</td><td>Date with format RFC3339: yyyy-MM-dd'T'HH:mm:ss'Z' Ex: 2016-11-01T20:44:39Z, The expiration_date must be at most one week from the current date. If you don’t send any the expiration_date will be in 15 min.</td></tr><tr><td>payer</td><td>Object</td><td>optional</td><td>If you provide the payer's details, we won't request them during the checkout process.</td></tr><tr><td>payer.email</td><td>string</td><td>optional</td><td>Payer email ie. johndou@gmail.com</td></tr><tr><td>payer.name</td><td>string</td><td>optional</td><td>Payer name ie. John</td></tr><tr><td>payer.last_name</td><td>string</td><td>optional</td><td>Payer last_name ie. Doe</td></tr><tr><td>payer.phone</td><td>string</td><td>optional</td><td>Payer phone ie. +542615985699</td></tr><tr><td>payment_method_types</td><td>string[]</td><td>optional</td><td>List of available payment methods you want to use in your checkout preference. If you don’t send any, all payment methods will be used.</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, we won't ask to select a payment method during the checkout process</td></tr><tr><td>custom_urls</td><td>Object</td><td>optional</td><td>This object defines <strong>custom URLs</strong> used during the payment flow.</td></tr><tr><td>custom_urls.status_changes_webhook</td><td>string</td><td>optional</td><td>URL of your server that will receive <a href="../../webhooks/notifications">notifications</a> whenever a payment status changes</td></tr><tr><td>custom_urls.success_payment_redirect</td><td>string</td><td>optional</td><td>URL where the customer will be redirected after a successful payment</td></tr><tr><td>custom_urls.error_payment_redirect</td><td>string</td><td>optional</td><td>URL where the customer will be redirected if an error occurs or the payment fails</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 '{
    "amount": 85807.04,
    "currency": "COP",
    "origin": "API",
    "external_id": "external_id_1234",
    "title": "Mastering Junior-Level Programming Languages",
    "type: "PAYMENT",
    "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 %}
