Create a Payment Link
curl --request POST \
--url https://api.simplepay.mx/v1/payment-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amount": 2,
"currency": "<string>",
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 2, currency: '<string>', name: '<string>'})
};
fetch('https://api.simplepay.mx/v1/payment-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.simplepay.mx/v1/payment-links"
payload = {
"amount": 2,
"currency": "<string>",
"name": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "<unknown>",
"checkout_session": {
"id": "<string>",
"url": "<string>"
},
"pricing_snapshot": {},
"status": "<string>",
"url": "<string>"
}Create a Payment Link
Referencia detallada para POST /v1/payment-links.
POST
https://api.simplepay.mx
/
v1
/
payment-links
Create a Payment Link
curl --request POST \
--url https://api.simplepay.mx/v1/payment-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amount": 2,
"currency": "<string>",
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 2, currency: '<string>', name: '<string>'})
};
fetch('https://api.simplepay.mx/v1/payment-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.simplepay.mx/v1/payment-links"
payload = {
"amount": 2,
"currency": "<string>",
"name": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "<unknown>",
"checkout_session": {
"id": "<string>",
"url": "<string>"
},
"pricing_snapshot": {},
"status": "<string>",
"url": "<string>"
}Uso
Usalo para cobros asincronos, invoices, ventas manuales o links reutilizables con limites y expiracion.Antes de llamar
| Tema | Detalle |
|---|---|
| Metodo | POST |
| Ruta | /v1/payment-links |
| Auth | Bearer API key del ambiente correcto. |
| Scope | No hay scope explicito en la spec publica; aplica el acceso del tenant y ambiente. |
| Idempotencia | Recomendada para cualquier retry. Usa una key deterministica por operacion de negocio. |
| Guia relacionada | Payment Links |
Patron recomendado
- Ejecuta este endpoint desde backend o job seguro, nunca desde frontend con API keys.
- Manda
Idempotency-Keycuando el endpoint cree, convierta, reprograme, cancele, capture o reembolse estado. - Persiste IDs SimplePay (
spcs_...,sppi_...,splink_..., refund IDs o booking IDs) para reconciliacion. - Consulta el bloque OpenAPI de esta pagina para el shape exacto de parametros, body y respuestas.
Ejemplo minimo
terminal
curl -sS -X POST "https://api.simplepay.mx/v1/payment-links" \
-H "Authorization: Bearer $SIMPLEPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: create-payment-link_v1" \
-d '{ ... }'
Errores a manejar
400indica payload, parametros o estado invalido.401o403indican API key, ambiente o scopes incorrectos.409suele indicar conflicto de estado, duplicado o idempotencia incompatible.429y5xxse pueden reintentar con backoff; en writes conserva la misma idempotency key.
Contrato OpenAPI
El playground, parametros, body y respuestas de abajo salen de/openapi.json. Si el contrato cambia, actualiza la spec y regenera esta pagina.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required string length:
8 - 255Body
application/json
Required range:
x >= 1Pattern:
^[a-z]{3}$Minimum string length:
1Maximum string length:
255Maximum string length:
500Hide child attributes
Hide child attributes
Required range:
x >= 0Available options:
3, 6, 9, 12, 18 Available options:
merchant_absorbed, payer_transparent, blended_price, pass_through_plus_margin Required range:
x >= 1Minimum array length:
1Available options:
card, oxxo, spei Available options:
light, dark, system Response
200 - application/json
Payment Link created
Pattern:
^splink_[a-z0-9]{32}$Example:
"https://link.simplepay.mx/splink_0123456789abcdef0123456789abcdef"
Last modified on June 24, 2026
⌘I