Pay By Link

Create a payment link

Changed on

Generates a link that takes customers straight to a secure and ready-to-pay checkout.

Coming soon: for now, payment links only support single payments. Frequent and subscription payments through Pay By Link will be available soon.

Required scope: <code style="background:#e8f0fe;color:#1a73e8;padding:2px 8px;border-radius:12px;font-size:0.85em">link:create</code>

post/link

Request

  • Base URL
    https://api.test.easypay.pt/2.0
  • Auth
    API key in header AccountId and API key in header ApiKey

Request body

object required
expiration_time, string date-time required

RFC3339 formatted time for the link expiration date. It has to be in the future and can't go past the year 2037. Once subscription links are available, it also can't be later than the subscription's own expiration_time.

type, 'SINGLE' | 'FREQUENT' | 'SUBSCRIPTION' required

Specifies the type of payment being performed. Possible values are "Single" (One-time transactions that will let your customers pay an amount of money to you), "Frequent" (Are repeatable transactions of varying sums without the client having to enter their payment details again), and "Subscription" (periodic payments of the same amount of money, configured through Checkout or our Payments API).

For now, Pay By Link only supports SINGLE payments. FREQUENT and SUBSCRIPTION links are coming soon, and until then requests using them answer with a 501.

customer, CustomerRequest required

The Customer object contains detailed information about the customer involved in the transaction.

communication_channels, string[]

The communication channels specifies where the final customer link should be forwarded. Optional, leave it out and we won't send the link anywhere, so it is up to you to hand it to your customer. Asking for EMAIL requires the customer email, and asking for SMS requires the customer phone.

payment, object required

Payment object with the payment method, capture object and payment type object (Single, Frequent, Subscription). Send exactly one of single, frequent or subscription, and make it match the type you asked for. Only single is available for now, frequent and subscription links answer with a 501.

notification, NotificationRequest

Opt-in notification preferences for the link. When enabled, the customer receives an email with the payment instructions after choosing the method on the Pay by Link page. You can only set this when you create the link. It isn't returned with the link and you can't change it later.

Example request

{
  "expiration_time": "2026-06-10T09:27:55.339Z",
  "customer": {
    "name": "Jonh Doe",
    "email": "example@easypay.pt",
    "phone": "+351911234567"
  },
  "communication_channels": [
    "SMS"
  ],
  "payment": {
    "methods": [
      "MBW"
    ],
    "single": {
      "requested_amount": "10.45"
    },
    "subscription": {
      "maximum_captures": 100,
      "start_time": "2025-01-15",
      "expiration_time": "2030-01-15"
    }
  }
}

Response

Created

LinkResponseObject required
id, string uuid required

A unique identifier for the resource. While typically formatted as a UUID (Universally Unique Identifier), it can also be in other formats as defined by the user. This field ensures the resource can be distinctly recognized and referenced.

created_at, string date-time required

String with the date on which this Pay By Link was created.

modified_at, string date-time

String with the date on which this Pay By Link was modified. Omitted while the link has never been modified.

expiration_time, string date-time required

The last possible time to make the payment.

type, 'SINGLE' | 'FREQUENT' | 'SUBSCRIPTION' required

Specifies the type of payment being performed. Possible values are "Single" (One-time transactions that will let your customers pay an amount of money to you), "Frequent" (Are repeatable transactions of varying sums without the client having to enter their payment details again), and "Subscription" (periodic payments of the same amount of money, configured through Checkout or our Payments API). For now, Pay By Link only supports SINGLE payments, FREQUENT and SUBSCRIPTION links are coming soon.

customer, CustomerResponse required

The Customer object contains detailed information about the customer required to create a pay-by-link.

communication_channels, string[] required

The communication channels the final customer link was forwarded to. Always present, and empty when the link was created without any channel.

payment, object required

Payment object with the payment methods, capture object and payment type object. Only the payment type you asked for is present.

url, string uri required

Link that redirects to the Easypay checkout payment page.

image, string uri required

Link that redirects to a QR code to access the payment checkout page.

status, 'ACTIVE' | 'EXPIRED' | 'FINALIZED' | 'CANCELLED' required

Current lifecycle state of the link. This is separate from the status of the payment made through it.

Example response

{
  "created_at": "2025-06-16T13:32:32Z",
  "modified_at": "2025-06-16T13:32:32Z",
  "expiration_time": "2026-06-10T09:27:55Z",
  "customer": {
    "name": "Jonh Doe",
    "email": "example@easypay.pt",
    "phone": "+351911234567"
  },
  "communication_channels": [
    "SMS"
  ],
  "payment": {
    "methods": [
      "MBW"
    ],
    "single": {
      "requested_amount": "10.45"
    },
    "frequent": {
      "minimum_amount": "5",
      "maximum_amount": "10"
    },
    "subscription": {
      "maximum_captures": 100,
      "start_time": "2025-01-15"
    }
  },
  "url": "https://easypay.pt/s/XStDvnMKZaN",
  "image": "https://cdn.easypay.pt/images/qr/XStDvnMKZaN"
}

Changes

    • breaking

      request property customer/language was restricted to a list of enum values

    • breaking

      the request property expiration_time became required

    • breaking

      the payment/methods request property's minItems was increased to 1

    56 more changes in this revision