---
updatedAt: 2025-10-10T00:06:30.000Z
agentTools:
  projectIndex: https://docs.deuna.com/llms.txt
---

# Create payment link

This endpoint creates a payment link associated to an order or to more than one orders.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Payment Links API",
    "version": "1.0",
    "description": "",
    "contact": {
      "name": "Developers",
      "email": "developers@deuna.com"
    }
  },
  "servers": [
    {
      "url": "https://api.sandbox.deuna.io",
      "description": "Sandbox"
    },
    {
      "url": "https://api.deuna.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/merchants/payments-links": {
      "post": {
        "description": "Este endpoint permite crear un enlace de pago para asociarla a una o varias órdenes.",
        "operationId": "createPaymentLink",
        "parameters": [
          {
            "$ref": "#/components/parameters/X-API-key"
          },
          {
            "$ref": "#/components/parameters/X-Merchant-ID"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentLink"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/PaymentLink"
          },
          "400": {
            "$ref": "#/components/responses/Bad-request"
          },
          "500": {
            "$ref": "#/components/responses/Internal-Server-Error"
          }
        },
        "security": [
          {
            "Authorization": [
              "Bearer"
            ]
          },
          {
            "X-API-key": []
          }
        ],
        "summary": "Create payment Link",
        "tags": [
          "Payment Links"
        ]
      },
      "x-deuna-order": 1
    }
  },
  "components": {
    "schemas": {
      "PaymentLink": {
        "properties": {
          "checkout_modules": {
            "description": "List of checkout modules",
            "items": {
              "properties": {
                "name": {
                  "description": "Name of the checkout module",
                  "example": "Payment Gateway",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "configuration": {
            "description": "Configuration settings",
            "properties": {
              "expires_at": {
                "description": "Expiration date and time (ISO 8601)",
                "example": "2022-07-25T14:30:00.000Z",
                "type": "string"
              },
              "max_completed_purchases": {
                "description": "Maximum number of completed purchases allowed",
                "example": 10,
                "type": "integer"
              },
              "max_payment_retries": {
                "description": "Maximum number of payment retries allowed",
                "example": 3,
                "type": "integer"
              },
              "payment_link_name": {
                "description": "Name of the payment link",
                "example": "Pay Now",
                "type": "string"
              }
            },
            "type": "object"
          },
          "order": {
            "description": "Order details",
            "properties": {
              "currency": {
                "description": "Currency code (ISO 4217)",
                "example": "USD",
                "type": "string"
              },
              "is_paid": {
                "description": "Whether the order is paid",
                "example": true,
                "type": "boolean"
              },
              "items": {
                "description": "List of order items",
                "items": {
                  "properties": {
                    "description": {
                      "description": "Item description",
                      "example": "This is a product description",
                      "type": "string"
                    },
                    "id": {
                      "description": "Item ID",
                      "example": "ITEM-12345",
                      "type": "string"
                    },
                    "image_url": {
                      "description": "URL of the item image",
                      "example": "https://example.com/image.jpg",
                      "type": "string"
                    },
                    "name": {
                      "description": "Item name",
                      "example": "Product A",
                      "type": "string"
                    },
                    "quantity": {
                      "description": "Quantity of the item",
                      "example": 2,
                      "type": "integer"
                    },
                    "tax_amount": {
                      "properties": {
                        "currency": {
                          "description": "Currency code (ISO 4217)",
                          "example": "USD",
                          "type": "string"
                        },
                        "currency_symbol": {
                          "description": "Currency symbol",
                          "example": "$",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "total_amount": {
                      "properties": {
                        "amount": {
                          "description": "Total amount of the item",
                          "example": 50,
                          "type": "integer"
                        },
                        "currency": {
                          "description": "Currency code (ISO 4217)",
                          "example": "USD",
                          "type": "string"
                        },
                        "currency_symbol": {
                          "description": "Currency symbol",
                          "example": "$",
                          "type": "string"
                        },
                        "discount_amount": {
                          "description": "Discount amount applied to the item",
                          "example": 10,
                          "type": "integer"
                        },
                        "original_amount": {
                          "description": "Original amount of the item before discount",
                          "example": 60,
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "unit_price": {
                      "properties": {
                        "amount": {
                          "description": "Unit price of the item",
                          "example": 20,
                          "type": "integer"
                        },
                        "currency": {
                          "description": "Currency code (ISO 4217)",
                          "example": "USD",
                          "type": "string"
                        },
                        "currency_symbol": {
                          "description": "Currency symbol",
                          "example": "$",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "items_total_amount": {
                "description": "Total amount of all items",
                "example": 100.99,
                "type": "number"
              },
              "order_id": {
                "description": "Unique order ID",
                "example": "ORD-12345",
                "type": "string"
              },
              "store_code": {
                "description": "Store code",
                "example": "STORE-001",
                "type": "string"
              },
              "sub_total": {
                "description": "Subtotal amount",
                "example": 90,
                "type": "integer"
              },
              "total_amount": {
                "description": "Total amount including tax",
                "example": 100,
                "type": "integer"
              },
              "total_tax_amount": {
                "description": "Total tax amount",
                "example": 10,
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      }
    },
    "responses": {
      "Bad-request": {
        "content": {
          "application/json": {
            "examples": {
              "x-api-key-not-found": {
                "value": {
                  "data": null,
                  "error": {
                    "code": "EMA-1000",
                    "description": "x-api-key"
                  }
                }
              }
            },
            "schema": {
              "properties": {
                "error": {
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              },
              "type": "object"
            }
          },
          "application/xml": {
            "schema": {
              "properties": {},
              "type": "object"
            }
          }
        },
        "description": "Respuesta de un bad request"
      },
      "Internal-Server-Error": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "code": {
                  "description": "Código de error.",
                  "example": "INTERNAL_SERVER_ERROR",
                  "type": "string"
                },
                "message": {
                  "description": "Detalle del error.",
                  "example": "Ocurrió un error inesperado en el servidor.",
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "Error interno del servidor."
      },
      "PaymentLink": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "configuration": {
                  "description": "Configuration settings",
                  "properties": {
                    "expires_at": {
                      "description": "Expiration date and time (ISO 8601)",
                      "example": "2025-11-07 03:40:11.054707389 +0000 UTC",
                      "type": "string"
                    },
                    "max_completed_purchases": {
                      "description": "Maximum number of completed purchases allowed",
                      "example": 1,
                      "type": "integer"
                    },
                    "max_payment_retries": {
                      "description": "Maximum number of payment retries allowed",
                      "example": 2,
                      "type": "integer"
                    },
                    "payment_link_name": {
                      "description": "Name of the payment link",
                      "example": "creacion payment link + impuestos",
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "order": {
                  "description": "Order details",
                  "properties": {
                    "billing_address": {
                      "description": "Billing address",
                      "properties": {
                        "email": {
                          "description": "Email address",
                          "example": "",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "currency": {
                      "description": "Currency code (ISO 4217)",
                      "example": "MXN",
                      "type": "string"
                    },
                    "items": {
                      "description": "List of order items",
                      "items": {
                        "properties": {
                          "description": {
                            "description": "Item description",
                            "example": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet.",
                            "type": "string"
                          },
                          "id": {
                            "description": "Item ID",
                            "example": "789012345",
                            "type": "string"
                          },
                          "image_url": {
                            "description": "URL of the item image",
                            "example": "https://cdn.stg.deuna.io/explore-deuna/assets/ticketevent.png",
                            "type": "string"
                          },
                          "name": {
                            "description": "Item name",
                            "example": "Event Ticket",
                            "type": "string"
                          },
                          "quantity": {
                            "description": "Quantity of the item",
                            "example": 1,
                            "type": "integer"
                          },
                          "tax_amount": {
                            "properties": {
                              "amount": {
                                "description": "Tax amount",
                                "example": 0,
                                "type": "integer"
                              },
                              "currency": {
                                "description": "Currency code (ISO 4217)",
                                "example": "PEN",
                                "type": "string"
                              },
                              "currency_symbol": {
                                "description": "Currency symbol",
                                "example": "S/",
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "total_amount": {
                            "properties": {
                              "amount": {
                                "description": "Total amount of the item",
                                "example": 7220,
                                "type": "integer"
                              },
                              "currency": {
                                "description": "Currency code (ISO 4217)",
                                "example": "PEN",
                                "type": "string"
                              },
                              "currency_symbol": {
                                "description": "Currency symbol",
                                "example": "S/",
                                "type": "string"
                              },
                              "original_amount": {
                                "description": "Original amount of the item before discount",
                                "example": 0,
                                "type": "integer"
                              },
                              "total_discount": {
                                "description": "Total discount amount",
                                "example": 0,
                                "type": "integer"
                              }
                            },
                            "type": "object"
                          },
                          "unit_price": {
                            "properties": {
                              "amount": {
                                "description": "Unit price of the item",
                                "example": 7220,
                                "type": "integer"
                              },
                              "currency": {
                                "description": "Currency code (ISO 4217)",
                                "example": "PEN",
                                "type": "string"
                              },
                              "currency_symbol": {
                                "description": "Currency symbol",
                                "example": "S/",
                                "type": "string"
                              }
                            },
                            "type": "object"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "items_total_amount": {
                      "description": "Total amount of all items",
                      "example": 7000,
                      "type": "integer"
                    },
                    "order_id": {
                      "description": "Unique order ID",
                      "example": "",
                      "type": "string"
                    },
                    "payer_info": {
                      "description": "Payer information",
                      "type": null
                    },
                    "redirect_urls": {
                      "description": "Redirect URLs",
                      "properties": {
                        "success": {
                          "description": "Success redirect URL",
                          "example": "https://example.com/success",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "store_code": {
                      "description": "Store code",
                      "example": "all",
                      "type": "string"
                    },
                    "sub_total": {
                      "description": "Subtotal amount",
                      "example": 7000,
                      "type": "integer"
                    },
                    "total_amount": {
                      "description": "Total amount including tax",
                      "example": 7220,
                      "type": "integer"
                    },
                    "total_tax_amount": {
                      "description": "Total tax amount",
                      "example": 220,
                      "type": "integer"
                    }
                  },
                  "type": "object"
                },
                "payment_link": {
                  "description": "URL of the payment link",
                  "example": "https://api.stg.deuna.io/payment-link/a1063733-fdec-446d-8d1f-a1799deab951",
                  "type": "string"
                },
                "payment_link_id": {
                  "description": "ID of the payment link",
                  "example": "a1063733-fdec-446d-8d1f-a1799deab951",
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        },
        "description": "Payment link creada"
      }
    },
    "parameters": {
      "X-API-key": {
        "description": "<a href=\"https://docs.deuna.com/reference/checkout-deuna#autenticaci%C3%B3n\" target=\"_blank\">Llave privada</a> del comercio ",
        "in": "header",
        "name": "X-API-KEY",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "X-Merchant-ID": {
        "description": "referencia del merchant",
        "in": "header",
        "name": "x-merchant-id",
        "required": false,
        "schema": {
          "description": "Only needed if the Auth type is bearer token",
          "example": "1b753a67-ed2c-4cdb-9f8e-431e75960a4f",
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "Authorization": {
        "description": "**Bearer** token",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://test.dev",
            "refreshUrl": "",
            "scopes": {
              "Bearer": "123456889"
            }
          }
        },
        "type": "oauth2"
      },
      "X-API-key": {
        "description": "Llave secreta del comercio",
        "in": "header",
        "name": "API Key",
        "type": "apiKey"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}
```