v1

latestOpenAPI 3.0.12026-07-2428103163.2 KB
Organisations
Pay Runs

Create pay run

Creates a single pay run containing one or more payables scheduled for a given date. All payables within a a pay run are paid from a single payer account. Each payable can be for a different recipient.

post/organisations/{organisationId}/pay-runs

Path parameters

organisationIdstring uuid required

The unique Crezco ID for an organisation

Headers

Crezco-Versionstring

The requested API version

Request body

payRunIdstring uuid
organisationIdstring uuid
partnerEntityIdstring required

Globally Unique Id of this pay run in the partner system

scheduledExecutionDatestring date nullable
<p> The date that this pay run is scheduled to be paid represented in ISO 8601 complete date delimited format (e.g. 2022-05-12 would be 12th May 2022) </p> <p> If omitted, payment will be instructed as soon as it is authorised </p>
payerBankAccountIdstring uuid nullable

The bank account to pay from. For backwards compatibility, this field is still supported. New integrations should use PaymentSourceType and PaymentSourceId instead.

paymentSourceType'BankAccount' | 'Card'
paymentSourceIdstring uuid nullable

ID of the payment source. The type is derived automatically when PaymentSourceType is omitted. Required for Bank payment sources. Optional if PaymentSourceType is Card (for stored cards).

status'Unknown' | 'Open' | 'UserInitiationInProgress' | 'Processing' | 'Cancelling' | 'Processed' | 'Concluded' | 'Cancelled' | 'Draft'

Mapping for https://crezco.readme.io/reference/statuses so we don't expose internal statuses

checkoutUristring uri

Example request

{
  "partnerEntityId": "Your-Unique-ID",
  "scheduledExecutionDate": "2023-07-17",
  "paymentSourceId": "C86FC455-3D2C-484C-9B8A-1996B2C6DB5E",
  "payables": [
    {
      "fundingAmount": {
        "currencyCode": "GBP",
        "amountInMinorUnits": 1275
      },
      "reference": "My-Ref-1234",
      "reversedAmount": {
        "currencyCode": "GBP",
        "amountInMinorUnits": 1275
      },
      "paymentSourceId": "C86FC455-3D2C-484C-9B8A-1996B2C6DB5E"
    }
  ],
  "groups": [
    {
      "partnerEntityId": "Your-Unique-ID",
      "partnerPayableIds": [
        {
          "partnerEntityId": "Your-Unique-ID"
        }
      ],
      "reference": "My-Ref-1234"
    }
  ],
  "batches": [
    {
      "groups": [
        {
          "partnerEntityId": "Your-Unique-ID"
        }
      ],
      "payables": [
        {
          "partnerEntityId": "Your-Unique-ID"
        }
      ]
    }
  ]
}

Response

Created

payRunIdstring uuid
organisationIdstring uuid
partnerEntityIdstring required

Globally Unique Id of this pay run in the partner system

scheduledExecutionDatestring date nullable
<p> The date that this pay run is scheduled to be paid represented in ISO 8601 complete date delimited format (e.g. 2022-05-12 would be 12th May 2022) </p> <p> If omitted, payment will be instructed as soon as it is authorised </p>
payerBankAccountIdstring uuid nullable

The bank account to pay from. For backwards compatibility, this field is still supported. New integrations should use PaymentSourceType and PaymentSourceId instead.

paymentSourceType'BankAccount' | 'Card'
paymentSourceIdstring uuid nullable

ID of the payment source. The type is derived automatically when PaymentSourceType is omitted. Required for Bank payment sources. Optional if PaymentSourceType is Card (for stored cards).

status'Unknown' | 'Open' | 'UserInitiationInProgress' | 'Processing' | 'Cancelling' | 'Processed' | 'Concluded' | 'Cancelled' | 'Draft'

Mapping for https://crezco.readme.io/reference/statuses so we don't expose internal statuses

checkoutUristring uri

Example response

{
  "partnerEntityId": "Your-Unique-ID",
  "scheduledExecutionDate": "2023-07-17",
  "paymentSourceId": "C86FC455-3D2C-484C-9B8A-1996B2C6DB5E",
  "payables": [
    {
      "fundingAmount": {
        "currencyCode": "GBP",
        "amountInMinorUnits": 1275
      },
      "reference": "My-Ref-1234",
      "reversedAmount": {
        "currencyCode": "GBP",
        "amountInMinorUnits": 1275
      },
      "paymentSourceId": "C86FC455-3D2C-484C-9B8A-1996B2C6DB5E"
    }
  ],
  "groups": [
    {
      "partnerEntityId": "Your-Unique-ID",
      "partnerPayableIds": [
        {
          "partnerEntityId": "Your-Unique-ID"
        }
      ],
      "reference": "My-Ref-1234"
    }
  ],
  "batches": [
    {
      "groups": [
        {
          "partnerEntityId": "Your-Unique-ID"
        }
      ],
      "payables": [
        {
          "partnerEntityId": "Your-Unique-ID"
        }
      ]
    }
  ]
}