curl --request PUT \
--url https://api.sandbox.cheqpay.mx/lps/payment-links/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"merchantId": "<string>",
"name": "<string>",
"products": [
{
"name": "<string>",
"qty": 2,
"price": 1,
"total": 1,
"id": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"isQtyAdjustable": true,
"minQty": 123,
"maxQty": 123
}
],
"plans": [
{
"id": "<string>"
}
],
"currency": "<string>",
"numberOfPayments": 2,
"paymentMethods": [],
"isDraft": true,
"isEnabled": true,
"redirectUrl": "<string>",
"invoiceNumber": "<string>",
"description": "<string>",
"cancelUrl": "<string>",
"options": {
"collectShippingAddress": true
},
"customFields": [
{
"label": "<string>",
"required": false,
"options": [
"<string>"
]
}
],
"defaults": {
"persistPaymentMethod": false,
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isSameAsShipping": true
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>"
}
},
"metadata": {},
"expiresAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.sandbox.cheqpay.mx/lps/payment-links/{id}"
payload = {
"merchantId": "<string>",
"name": "<string>",
"products": [
{
"name": "<string>",
"qty": 2,
"price": 1,
"total": 1,
"id": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"isQtyAdjustable": True,
"minQty": 123,
"maxQty": 123
}
],
"plans": [{ "id": "<string>" }],
"currency": "<string>",
"numberOfPayments": 2,
"paymentMethods": [],
"isDraft": True,
"isEnabled": True,
"redirectUrl": "<string>",
"invoiceNumber": "<string>",
"description": "<string>",
"cancelUrl": "<string>",
"options": { "collectShippingAddress": True },
"customFields": [
{
"label": "<string>",
"required": False,
"options": ["<string>"]
}
],
"defaults": {
"persistPaymentMethod": False,
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isSameAsShipping": True
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>"
}
},
"metadata": {},
"expiresAt": "2023-11-07T05:31:56Z"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '<string>',
name: '<string>',
products: [
{
name: '<string>',
qty: 2,
price: 1,
total: 1,
id: '<string>',
description: '<string>',
imageUrl: '<string>',
isQtyAdjustable: true,
minQty: 123,
maxQty: 123
}
],
plans: [{id: '<string>'}],
currency: '<string>',
numberOfPayments: 2,
paymentMethods: [],
isDraft: true,
isEnabled: true,
redirectUrl: '<string>',
invoiceNumber: '<string>',
description: '<string>',
cancelUrl: '<string>',
options: {collectShippingAddress: true},
customFields: [{label: '<string>', required: false, options: ['<string>']}],
defaults: {
persistPaymentMethod: false,
billingAddress: {
firstName: '<string>',
lastName: '<string>',
organizationName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
addressLine1: '<string>',
addressLine2: '<string>',
city: '<string>',
state: '<string>',
postalCode: '<string>',
country: '<string>',
isSameAsShipping: true
},
shippingAddress: {
firstName: '<string>',
lastName: '<string>',
organizationName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
addressLine1: '<string>',
addressLine2: '<string>',
city: '<string>',
state: '<string>',
postalCode: '<string>',
country: '<string>'
}
},
metadata: {},
expiresAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.sandbox.cheqpay.mx/lps/payment-links/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.cheqpay.mx/lps/payment-links/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'merchantId' => '<string>',
'name' => '<string>',
'products' => [
[
'name' => '<string>',
'qty' => 2,
'price' => 1,
'total' => 1,
'id' => '<string>',
'description' => '<string>',
'imageUrl' => '<string>',
'isQtyAdjustable' => true,
'minQty' => 123,
'maxQty' => 123
]
],
'plans' => [
[
'id' => '<string>'
]
],
'currency' => '<string>',
'numberOfPayments' => 2,
'paymentMethods' => [
],
'isDraft' => true,
'isEnabled' => true,
'redirectUrl' => '<string>',
'invoiceNumber' => '<string>',
'description' => '<string>',
'cancelUrl' => '<string>',
'options' => [
'collectShippingAddress' => true
],
'customFields' => [
[
'label' => '<string>',
'required' => false,
'options' => [
'<string>'
]
]
],
'defaults' => [
'persistPaymentMethod' => false,
'billingAddress' => [
'firstName' => '<string>',
'lastName' => '<string>',
'organizationName' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'addressLine1' => '<string>',
'addressLine2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postalCode' => '<string>',
'country' => '<string>',
'isSameAsShipping' => true
],
'shippingAddress' => [
'firstName' => '<string>',
'lastName' => '<string>',
'organizationName' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'addressLine1' => '<string>',
'addressLine2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postalCode' => '<string>',
'country' => '<string>'
]
],
'metadata' => [
],
'expiresAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.cheqpay.mx/lps/payment-links/{id}"
payload := strings.NewReader("{\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"products\": [\n {\n \"name\": \"<string>\",\n \"qty\": 2,\n \"price\": 1,\n \"total\": 1,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"isQtyAdjustable\": true,\n \"minQty\": 123,\n \"maxQty\": 123\n }\n ],\n \"plans\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"numberOfPayments\": 2,\n \"paymentMethods\": [],\n \"isDraft\": true,\n \"isEnabled\": true,\n \"redirectUrl\": \"<string>\",\n \"invoiceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"options\": {\n \"collectShippingAddress\": true\n },\n \"customFields\": [\n {\n \"label\": \"<string>\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"defaults\": {\n \"persistPaymentMethod\": false,\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isSameAsShipping\": true\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"metadata\": {},\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.sandbox.cheqpay.mx/lps/payment-links/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"products\": [\n {\n \"name\": \"<string>\",\n \"qty\": 2,\n \"price\": 1,\n \"total\": 1,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"isQtyAdjustable\": true,\n \"minQty\": 123,\n \"maxQty\": 123\n }\n ],\n \"plans\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"numberOfPayments\": 2,\n \"paymentMethods\": [],\n \"isDraft\": true,\n \"isEnabled\": true,\n \"redirectUrl\": \"<string>\",\n \"invoiceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"options\": {\n \"collectShippingAddress\": true\n },\n \"customFields\": [\n {\n \"label\": \"<string>\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"defaults\": {\n \"persistPaymentMethod\": false,\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isSameAsShipping\": true\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"metadata\": {},\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/lps/payment-links/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"products\": [\n {\n \"name\": \"<string>\",\n \"qty\": 2,\n \"price\": 1,\n \"total\": 1,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"isQtyAdjustable\": true,\n \"minQty\": 123,\n \"maxQty\": 123\n }\n ],\n \"plans\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"numberOfPayments\": 2,\n \"paymentMethods\": [],\n \"isDraft\": true,\n \"isEnabled\": true,\n \"redirectUrl\": \"<string>\",\n \"invoiceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"options\": {\n \"collectShippingAddress\": true\n },\n \"customFields\": [\n {\n \"label\": \"<string>\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"defaults\": {\n \"persistPaymentMethod\": false,\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isSameAsShipping\": true\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"metadata\": {},\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"merchantId": "<string>",
"type": "products_subscriptions",
"currency": "<string>",
"totals": {
"total": 1,
"taxes": 1,
"shipping": 1,
"fees": 1,
"discounts": 1
},
"paymentMethods": [
"card"
],
"isDraft": true,
"isEnabled": true,
"_id": "<string>",
"name": "<string>",
"url": "<string>",
"products": [
{
"name": "<string>",
"qty": 2,
"price": 1,
"total": 1,
"id": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"isQtyAdjustable": true,
"minQty": 123,
"maxQty": 123
}
],
"plans": [
{
"id": "<string>",
"merchantId": "<string>",
"externalId": "<string>",
"name": "<string>",
"description": "<string>",
"amount": 123,
"currency": "MXN",
"interval": "DAY",
"intervalCount": 123,
"trialDays": 123,
"active": true,
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"options": {
"collectShippingAddress": false,
"taxIdCollection": {
"enabled": true,
"required": false
}
},
"customFields": [
{
"type": "text",
"label": "<string>",
"required": false,
"options": [
"<string>"
]
}
],
"numberOfPayments": 2,
"redirectUrl": "<string>",
"cancelUrl": "<string>",
"reference": "<string>",
"invoiceNumber": "<string>",
"description": "<string>",
"externalId": "<string>",
"defaults": {
"persistPaymentMethod": false,
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isSameAsShipping": true
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>"
}
},
"metadata": {},
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "Validation failed"
}{
"message": "Unauthorized"
}{
"message": "Resource not found"
}{
"message": "Internal server error"
}Update payment link
Update an existing payment link
curl --request PUT \
--url https://api.sandbox.cheqpay.mx/lps/payment-links/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"merchantId": "<string>",
"name": "<string>",
"products": [
{
"name": "<string>",
"qty": 2,
"price": 1,
"total": 1,
"id": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"isQtyAdjustable": true,
"minQty": 123,
"maxQty": 123
}
],
"plans": [
{
"id": "<string>"
}
],
"currency": "<string>",
"numberOfPayments": 2,
"paymentMethods": [],
"isDraft": true,
"isEnabled": true,
"redirectUrl": "<string>",
"invoiceNumber": "<string>",
"description": "<string>",
"cancelUrl": "<string>",
"options": {
"collectShippingAddress": true
},
"customFields": [
{
"label": "<string>",
"required": false,
"options": [
"<string>"
]
}
],
"defaults": {
"persistPaymentMethod": false,
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isSameAsShipping": true
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>"
}
},
"metadata": {},
"expiresAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.sandbox.cheqpay.mx/lps/payment-links/{id}"
payload = {
"merchantId": "<string>",
"name": "<string>",
"products": [
{
"name": "<string>",
"qty": 2,
"price": 1,
"total": 1,
"id": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"isQtyAdjustable": True,
"minQty": 123,
"maxQty": 123
}
],
"plans": [{ "id": "<string>" }],
"currency": "<string>",
"numberOfPayments": 2,
"paymentMethods": [],
"isDraft": True,
"isEnabled": True,
"redirectUrl": "<string>",
"invoiceNumber": "<string>",
"description": "<string>",
"cancelUrl": "<string>",
"options": { "collectShippingAddress": True },
"customFields": [
{
"label": "<string>",
"required": False,
"options": ["<string>"]
}
],
"defaults": {
"persistPaymentMethod": False,
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isSameAsShipping": True
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>"
}
},
"metadata": {},
"expiresAt": "2023-11-07T05:31:56Z"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantId: '<string>',
name: '<string>',
products: [
{
name: '<string>',
qty: 2,
price: 1,
total: 1,
id: '<string>',
description: '<string>',
imageUrl: '<string>',
isQtyAdjustable: true,
minQty: 123,
maxQty: 123
}
],
plans: [{id: '<string>'}],
currency: '<string>',
numberOfPayments: 2,
paymentMethods: [],
isDraft: true,
isEnabled: true,
redirectUrl: '<string>',
invoiceNumber: '<string>',
description: '<string>',
cancelUrl: '<string>',
options: {collectShippingAddress: true},
customFields: [{label: '<string>', required: false, options: ['<string>']}],
defaults: {
persistPaymentMethod: false,
billingAddress: {
firstName: '<string>',
lastName: '<string>',
organizationName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
addressLine1: '<string>',
addressLine2: '<string>',
city: '<string>',
state: '<string>',
postalCode: '<string>',
country: '<string>',
isSameAsShipping: true
},
shippingAddress: {
firstName: '<string>',
lastName: '<string>',
organizationName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
addressLine1: '<string>',
addressLine2: '<string>',
city: '<string>',
state: '<string>',
postalCode: '<string>',
country: '<string>'
}
},
metadata: {},
expiresAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.sandbox.cheqpay.mx/lps/payment-links/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.cheqpay.mx/lps/payment-links/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'merchantId' => '<string>',
'name' => '<string>',
'products' => [
[
'name' => '<string>',
'qty' => 2,
'price' => 1,
'total' => 1,
'id' => '<string>',
'description' => '<string>',
'imageUrl' => '<string>',
'isQtyAdjustable' => true,
'minQty' => 123,
'maxQty' => 123
]
],
'plans' => [
[
'id' => '<string>'
]
],
'currency' => '<string>',
'numberOfPayments' => 2,
'paymentMethods' => [
],
'isDraft' => true,
'isEnabled' => true,
'redirectUrl' => '<string>',
'invoiceNumber' => '<string>',
'description' => '<string>',
'cancelUrl' => '<string>',
'options' => [
'collectShippingAddress' => true
],
'customFields' => [
[
'label' => '<string>',
'required' => false,
'options' => [
'<string>'
]
]
],
'defaults' => [
'persistPaymentMethod' => false,
'billingAddress' => [
'firstName' => '<string>',
'lastName' => '<string>',
'organizationName' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'addressLine1' => '<string>',
'addressLine2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postalCode' => '<string>',
'country' => '<string>',
'isSameAsShipping' => true
],
'shippingAddress' => [
'firstName' => '<string>',
'lastName' => '<string>',
'organizationName' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'addressLine1' => '<string>',
'addressLine2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postalCode' => '<string>',
'country' => '<string>'
]
],
'metadata' => [
],
'expiresAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.cheqpay.mx/lps/payment-links/{id}"
payload := strings.NewReader("{\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"products\": [\n {\n \"name\": \"<string>\",\n \"qty\": 2,\n \"price\": 1,\n \"total\": 1,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"isQtyAdjustable\": true,\n \"minQty\": 123,\n \"maxQty\": 123\n }\n ],\n \"plans\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"numberOfPayments\": 2,\n \"paymentMethods\": [],\n \"isDraft\": true,\n \"isEnabled\": true,\n \"redirectUrl\": \"<string>\",\n \"invoiceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"options\": {\n \"collectShippingAddress\": true\n },\n \"customFields\": [\n {\n \"label\": \"<string>\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"defaults\": {\n \"persistPaymentMethod\": false,\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isSameAsShipping\": true\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"metadata\": {},\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.sandbox.cheqpay.mx/lps/payment-links/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"products\": [\n {\n \"name\": \"<string>\",\n \"qty\": 2,\n \"price\": 1,\n \"total\": 1,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"isQtyAdjustable\": true,\n \"minQty\": 123,\n \"maxQty\": 123\n }\n ],\n \"plans\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"numberOfPayments\": 2,\n \"paymentMethods\": [],\n \"isDraft\": true,\n \"isEnabled\": true,\n \"redirectUrl\": \"<string>\",\n \"invoiceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"options\": {\n \"collectShippingAddress\": true\n },\n \"customFields\": [\n {\n \"label\": \"<string>\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"defaults\": {\n \"persistPaymentMethod\": false,\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isSameAsShipping\": true\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"metadata\": {},\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/lps/payment-links/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"merchantId\": \"<string>\",\n \"name\": \"<string>\",\n \"products\": [\n {\n \"name\": \"<string>\",\n \"qty\": 2,\n \"price\": 1,\n \"total\": 1,\n \"id\": \"<string>\",\n \"description\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"isQtyAdjustable\": true,\n \"minQty\": 123,\n \"maxQty\": 123\n }\n ],\n \"plans\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"currency\": \"<string>\",\n \"numberOfPayments\": 2,\n \"paymentMethods\": [],\n \"isDraft\": true,\n \"isEnabled\": true,\n \"redirectUrl\": \"<string>\",\n \"invoiceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"cancelUrl\": \"<string>\",\n \"options\": {\n \"collectShippingAddress\": true\n },\n \"customFields\": [\n {\n \"label\": \"<string>\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"defaults\": {\n \"persistPaymentMethod\": false,\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"isSameAsShipping\": true\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"organizationName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"metadata\": {},\n \"expiresAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"merchantId": "<string>",
"type": "products_subscriptions",
"currency": "<string>",
"totals": {
"total": 1,
"taxes": 1,
"shipping": 1,
"fees": 1,
"discounts": 1
},
"paymentMethods": [
"card"
],
"isDraft": true,
"isEnabled": true,
"_id": "<string>",
"name": "<string>",
"url": "<string>",
"products": [
{
"name": "<string>",
"qty": 2,
"price": 1,
"total": 1,
"id": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"isQtyAdjustable": true,
"minQty": 123,
"maxQty": 123
}
],
"plans": [
{
"id": "<string>",
"merchantId": "<string>",
"externalId": "<string>",
"name": "<string>",
"description": "<string>",
"amount": 123,
"currency": "MXN",
"interval": "DAY",
"intervalCount": 123,
"trialDays": 123,
"active": true,
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"options": {
"collectShippingAddress": false,
"taxIdCollection": {
"enabled": true,
"required": false
}
},
"customFields": [
{
"type": "text",
"label": "<string>",
"required": false,
"options": [
"<string>"
]
}
],
"numberOfPayments": 2,
"redirectUrl": "<string>",
"cancelUrl": "<string>",
"reference": "<string>",
"invoiceNumber": "<string>",
"description": "<string>",
"externalId": "<string>",
"defaults": {
"persistPaymentMethod": false,
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isSameAsShipping": true
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>"
}
},
"metadata": {},
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "Validation failed"
}{
"message": "Unauthorized"
}{
"message": "Resource not found"
}{
"message": "Internal server error"
}Authorizations
API key for merchant authentication
Path Parameters
Payment link ID
Body
Request to update a payment link
Merchant identifier, only for internal use
Payment link type
products_subscriptions, customer_choice, products, subscription Payment link name
255Products in the payment link
Show child attributes
Show child attributes
Subscription plans (required when type is subscription, max 1)
1Show child attributes
Show child attributes
Currency code
^[A-Z]{3}$Payment link totals
Show child attributes
Show child attributes
Number of payments for subscription
x >= 1Available payment methods
1card, spei, cie_cash_net, paycash Whether the payment link is a draft
Whether the payment link is enabled
URL to redirect after payment completion
Merchant-provided invoice number shown to customers instead of the system order number when present. Free-form, not unique. Forwarded to the payment order on charge.
64Payment link description. Forwarded to the payment order on charge unless overridden in the charge request.
500URL the customer returns to when cancelling the checkout
Payment link options
Show child attributes
Show child attributes
Additional questions to ask the customer at checkout
1 - 20 elementsShow child attributes
Show child attributes
Default values for customer choice payment links
Show child attributes
Show child attributes
Additional metadata
Expiration date
Response
Payment link updated successfully
Payment link entity
Unique payment link identifier
Merchant identifier
Payment link type
products_subscriptions, customer_choice, products, subscription Currency code (3 letters)
^[A-Z]{3}$Payment link totals
Show child attributes
Show child attributes
Available payment methods
1card, spei, cie_cash_net, paycash Whether the payment link is a draft
Whether the payment link is enabled
MongoDB ObjectId
Payment link name
255Payment link URL
Products in the payment link
Show child attributes
Show child attributes
Subscription plans (required when type is subscription, max 1)
1Show child attributes
Show child attributes
Payment link options
Show child attributes
Show child attributes
Additional questions to ask the customer at checkout
1 - 20 elementsShow child attributes
Show child attributes
Number of payments for subscription
x >= 1URL to redirect after payment completion
URL the customer returns to when cancelling the checkout
Merchant reference for the payment link
128Merchant-provided invoice number shown to customers instead of the system order number when present. Free-form, not unique. Forwarded to the payment order on charge.
64Payment link description. Forwarded to the payment order on charge unless overridden in the charge request.
500External identifier for idempotent payment link creation
128Default values for customer choice payment links
Show child attributes
Show child attributes
Additional metadata
Expiration date
Creation timestamp
Last update timestamp