Creating pay demands to request payments for your users

Once you have configured Webhooks and onboarded your users, you can collect payments there are two ways to achieve this:

Add new Pay Demand for a User

To initiate a pay demand for an individual payment, you should specify a reference to clarify the payment's purpose for the payee. Additionally, you have the option to attach custom metadata, which will be included in the webhook events related to this payment.

{
  "request": {
    "currency": "GBP",
    "metadata": {
      "amount": "4242",
      "organisationId": "bad65947-f9af-40a5-b799-edaea3602acf"
    },
    "reference": "INV-00042",
    "amount": "42.42"
  },
  "idempotencyId": "a7835447-2bba-4012-9988-8336b141a09e"
}

{
  "payDemandId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "payeeName": "John Doe",
  "reference": "INV-00042",
  "currency": "GBP",
  "amount": "42.42",
  "paymentUri": "https://app.sandbox.crezco.com/payment/pIkRoi0240uVFKydXKeyqA",
	"metadata": {
      "amount": "4242",
      "organisationId": "bad65947-f9af-40a5-b799-edaea3602acf"
    }
}

If the request is successful, you can then either redirect the payer to the paymentUri where they will be able to pay your user. Or alternatively if you wish to add custom redirect parameters, you can create a custom redirect payment link and then forward the payer to the redirect uri in the response.

Create a standing order pay demand for a User

For recurring payments or standing orders, you can configure the frequency to be weekly or monthly. Note that not all banks support standing orders, and payers can only cancel these via their bank's dashboard.

{
  "request": {
    "reference": "Shipment 12345Z308",
    "currency": "GBP",
    "amount": "176.53",
    "metadata": {
      "amount": "4242",
      "organisationId": "bad65947-f9af-40a5-b799-edaea3602acf",
      "standingOrder": true
    },
    "firstPaymentDate": "2024-01-01T00:00:00.000Z",
    "lastPaymentDate": "2024-01-01T00:00:00.000Z",
    "numberOfPayments": 12,
    "frequency": "Monthly"
  },
  "idempotencyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
{
  "payDemandId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "payeeName": "John Doe",
  "reference": "Shipment 12345Z308",
  "currency": "GBP",
  "amount": "176.53",
  "paymentUri": "https://app.sandbox.crezco.com/payment/pIkRoi0240uVFKydXKeyqA",
    "metadata": {
      "amount": "4242",
      "organisationId": "bad65947-f9af-40a5-b799-edaea3602acf"
    },
}

Similar to the single pay demand, upon successful request completion, you can redirect the payer to the paymentUri. For custom redirects, create a custom redirect payment link and guide the payer to the redirect URI in the response.