Skip to main content
Create Pay By Link
curl --request POST \
  --url https://api.yapily.com/hosted/payment-requests/links \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json;charset=UTF-8' \
  --data '
{
  "userId": "3ddf5dd0-aa48-4d0f-baa7-fa057e9e911d",
  "applicationUserId": "string",
  "institutionIdentifiers": {
    "institutionId": "modelo-sandbox",
    "institutionCountryCode": "GB"
  },
  "userSettings": {
    "language": "en",
    "location": "GB"
  },
  "redirectUrl": "https://tpp-application.com/",
  "paymentRequestDetails": {
    "amountDetails": {
      "amountToPay": 1,
      "currency": "GBP"
    },
    "reference": "Test Payment",
    "contextType": "OTHER",
    "type": "DOMESTIC_PAYMENT",
    "payee": {
      "name": "Jane Doe",
      "accountIdentifications": [
        {
          "type": "SORT_CODE",
          "identification": "123456"
        },
        {
          "type": "ACCOUNT_NUMBER",
          "identification": "12345678"
        }
      ]
    },
    "payer": {
      "name": "John Doe",
      "accountIdentifications": [
        {
          "type": "SORT_CODE",
          "identification": "121212"
        },
        {
          "type": "ACCOUNT_NUMBER",
          "identification": "87654321"
        }
      ]
    }
  }
}
'
{
  "meta": {
    "tracingId": "2dbfd85b4f2940c6a206e96dd90e52d0"
  },
  "data": {
    "paymentRequestId": "eb39f8ae-aeff-4ffa-a23d-d4a5b3eff406",
    "userId": "3ddf5dd0-aa48-4d0f-baa7-fa057e9e911d",
    "applicationUserId": "string",
    "applicationId": "64949de6-6510-4d70-9500-d4aa094c506c",
    "institutionIdentifiers": {
      "institutionId": "modelo-sandbox",
      "institutionCountryCode": "GB"
    },
    "userSettings": {
      "language": "en",
      "location": "GB"
    },
    "redirectUrl": "https://tpp-application.com/",
    "paymentRequestDetails": {
      "amountDetails": {
        "amountToPay": 10,
        "currency": "GBP"
      },
      "reference": "Test Payment",
      "contextType": "OTHER",
      "type": "DOMESTIC_PAYMENT",
      "payee": {
        "name": "Jane Doe",
        "accountIdentifications": [
          {
            "type": "SORT_CODE",
            "identification": "123456"
          },
          {
            "type": "ACCOUNT_NUMBER",
            "identification": "12345678"
          }
        ]
      },
      "payer": {
        "name": "John Doe",
        "accountIdentifications": [
          {
            "type": "SORT_CODE",
            "identification": "121212"
          },
          {
            "type": "ACCOUNT_NUMBER",
            "identification": "87654321"
          }
        ]
      }
    },
    "hostedUrl": "https://prototypes.yapily.com/auth-link1.html",
    "authToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
    "createdAt": "2021-06-10T11:26:54.887Z",
    "authorisationExpiresAt": "2021-06-10T11:36:54.887Z",
    "status": "ACTIVE"
  }
}
Learn more: Pay By Link

Authorizations

Authorization
string
header
required

Use HTTP Basic Authentication with your Application ID as username and Application Secret as password. Manage credentials in the Yapily Console. See Authentication for details.

Body

application/json;charset=UTF-8
institutionIdentifiers
object
required

Specifies the institution requirements for making the payment. Skips the bank selection screen in payment flow if the institutionId and institutionCountryCode are provided.

redirectUrl
string
required

URL of your server to redirect the user after completion of the payment flow.

Example:

"https://tpp-application.com"

paymentRequestDetails
object
required
userId
string<uuid>

Conditional. Yapily Identifier for the User returned by the create user step POST /users. You must either provide userId or applicationUserId.

applicationUserId
string

Conditional. Your own User reference. If you want to work with their own unique references for individual PSUs then you can use the applicationUserId property to provide that value. Where Yapily does not already have a Yapily userId that matches the supplied applicationUserId, then a new Yapily userId is created automatically and linked to the applicationUserId value. You must either provide userId or applicationUserId.

userSettings
object

Specifies the language and location preferences of the user.

authorisationExpiresAt
string<date-time>

The date and time that the authorisation expires. Must be between 10 minutes and 30 days in the future. If not specified, the authorisation URL will expire 10 minutes after creation.

Response

Created

meta
object
data
object