Skip to main content
Create Hosted payment request
curl --request POST \
  --url https://api.yapily.com/hosted/payment-requests \
  --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": {
    "paymentIdempotencyId": "4289457hd38djoa783jw9qag3",
    "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"
        }
      ]
    }
  }
}
'
{
  "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": {
      "paymentIdempotencyId": "4289457hd38djoa783jw9qag3",
      "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"
          }
        ]
      }
    },
    "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"
  }
}

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.

Headers

sub-application
string<uuid>

The sub-application ID to which event type is being subscribed to

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

Details of the payment.

userId
string<uuid>

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

applicationUserId
string

Conditional. Your own User reference. This field allows you to use your own unique references for individual users. Where the User reference doesn't have an associated Yapily userId, a new userId is created and linked to it. You must provide either a userId or applicationUserId.

userSettings
object

Specifies the language and location preferences of the user.

Response

Created

meta
object
data
object