Request a one-time payment

Create a one-time payment request

POST /v1/checkout_preferences

Headers

Name
Value

x-api-key

<your api key>

x-api-secret

<your api secret>

Body

Name
Type
Required
Description

type

string

required ✳️

PAYMENT

amount

float

required ✳️

The amount must be between 0.1 and 3000 USD

currency

string

required ✳️

The currency of the payment

title

string

required ✳️

Description of checkout_preference ie. "Introductory course to Blockchain"

origin

string

required ✳️

if use api integration use "API"

external_id

string

optional

Your ID

expiration_date

string

optional

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.

payer

Object

optional

If you provide the payer's details, we won't request them during the checkout process.

payer.email

string

optional

Payer email ie. johndou@gmail.com

payer.name

string

optional

Payer name ie. John

payer.last_name

string

optional

Payer last_name ie. Doe

payer.phone

string

optional

Payer phone ie. +542615985699

payment_method_types

string[]

optional

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.

selected_payment_method_id

string

optional

If you provide the ID of a specific payment method, we won't ask to select a payment method during the checkout process

custom_urls

Object

optional

This object defines custom URLs used during the payment flow.

custom_urls.status_changes_webhook

string

optional

URL of your server that will receive notifications whenever a payment status changes

custom_urls.success_payment_redirect

string

optional

URL where the customer will be redirected after a successful payment

custom_urls.error_payment_redirect

string

optional

URL where the customer will be redirected if an error occurs or the payment fails

Example

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"
    },
}'

Last updated