Skip to content

Create payment link

To create a payment link, you can use the following endpoint:

POST https://[base_url]/v2/links/schedule/

Body parameters

PARAMETER TYPE REQ. DESCRIPTION
hotel_id Integer Yes Hotel ID associated with the reservation. Refer to List hotels
guest_name String Yes Guest's full name
email String Yes Guest's email
phone String Yes Guest's phone
amount String Yes Amount to be paid by the guest
booking_dates String No Booking dates in format "YYYY-MM-DD - YYYY-MM-DD"
description String Yes Payment link description
available_hours Integer Yes Validity of the payment link in hours
source String No Payment link source. Please contact [email protected] to get your source string
external_ref_id String No External identification ID for future payment references
temp_webhook_url String No Url of the webhook to which the payment notification will be sent by Autocore. It must be an endpoint that receives POST requests.
redirect.success_url String No URL to which the redirect is made when the payment is successful.
redirect.failure_url String No URL to which the redirect is made when the payment fails.
agency_id Integer Yes Agency ID that is creating the payment link.

Body example

{
    "hotel_id": 5,
    "guest_name": "Laura Pelaez",
    "email": "[email protected]",
    "phone": "3012104512",
    "amount": 1200100,
    "booking_dates": "2024-12-31 - 2020-01-29",
    "description": "Reserva de 3 dias en Hotel A",
    "available_hours": 100,
    "source": "Booking Connect",
    "external_ref_id": "#45645",
    "temp_webhook_url":"https://195.ngrok-free.app/payment",
    "redirect": {
        "success_url": "https://app-dev.autocore.pro/main/link/success",
        "failure_url": "https://app-dev.autocore.pro/main/link/failure"
    },
    "agency_id":12
}

Webhook body:

After the payment attempt, the webhook will return a response body like this:

{
    "payment_status":"Aplicado",
    "amount": 1200100,
    "payment_date": "2025-01-27 08:10:05.184977",
    "company": "Company name",
    "hotel": "Hotel Name",
    "voucher_url": "v1/bookings/996647/vouchers?hotel_id=11111&portal_code=booking",
    "transaction_id": "df8g8ufg890",
    "external_ref_id": "#45645"
}

Status code: 200

{
    "msg": "Link de pago generado exitosamente",
    "url": "https://app-dev.autocore.pro/payment/azuan/61eu9b1z424j",
    "code": "61eu9b1z424j"
}

Endpoint response

Status code: 200

{
    "msg": "Link de pago generado exitosamente",
    "url": "https://app-dev.autocore.pro/payment?id=2267b24f-49db-4ea3-94c1-de40ed98370f"
}

Status code: 401, 403, 404

{
 "code": "Status code",
 "message":"Error description",
 "detail": "Error details"
}