Request

Create payment request

post/api/v1.0/pis/Request/Create

Request

  • Base URL: https://sandbox.tryspare.com
  • URL: https://sandbox.tryspare.com/api/v1.0/pis/Request/Create
  • Auth: API key in header Authorization

Headers

x-signaturestring required

Json web signature (JWS: RFC7519) of the payment initiation consent request payload in detached mode. <see href="https://datatracker.ietf.org/doc/html/rfc7519" />

Request body

type'SINGLE_DOMESTIC' | 'RECURRENT' required
descriptionstring nullable

Free-text description.

externalReferencestring nullable

Your own reference, echoed back for reconciliation.

redirectionFlow'WEB' | 'DECOUPLED'
successRedirectUrlstring uri nullable

URL to redirect the customer to after a successful authorization.

failureRedirectUrlstring uri nullable

URL to redirect the customer to after a failed or cancelled authorization.

autoRedirectboolean nullable

When true, redirect the customer automatically after authorization.

amountstring required

Monetary amount as a decimal value.

currencystring required

ISO 4217 currency code (e.g. AED, SAR, BHD).

providerIdstring uuid nullable

Identifier of the open banking provider. Format: UUID.

countryCodestring required

ISO 3166 alpha-2 country code (e.g. AE, SA, BH).

paymentConsentType'SingleInstantPayment' required
purpose'SELF' | 'ONLP' | 'LORP' | 'BIL' | 'DONA' | 'DUES' | 'GOPT' | 'PERS' | 'PERL' required
notestring nullable

Optional free-text note.

Example request

{
  "successRedirectUrl": "https://example.com",
  "failureRedirectUrl": "https://example.com",
  "currency": "BHD",
  "providerId": "00000000-0000-0000-0000-000000000000",
  "countryCode": "BH"
}

Response

error'INVALID_DATA' | 'INVALID_SIGNATURE' | 'RESOURCE_LOCKED' | 'COUNTRY_NOT_FOUND' | 'CURRENCY_NOT_FOUND' | 'PROVIDER_NOT_FOUND' | 'CONNECTION_NOT_FOUND' | 'INSUFFICIENT_CONSENT_PERMISSIONS' | 'CONSENT_EXPIRED' | 'CONSENT_REVOKED' | 'CONSENT_UNAUTHORIZED' | 'CONSENT_NOT_FOUND' | 'RISK_REPORT_NOT_FOUND' | 'ACCOUNT_INFORMATION_REPORT_NOT_FOUND' | 'MULTIPLE_CURRENCY_NOT_ALLOWED' | 'MULTIPLE_CONSENT_DATE_NOT_ALLOWED' | 'PAYMENT_NOT_FOUND' | 'CONSENT_REJECTED' | 'PAYMENT_REQUEST_NOT_FOUND' | 'CUSTOMER_NOT_FOUND' | 'CUSTOMER_ALREADY_EXISTS' | 'BANK_ACCOUNT_NOT_FOUND' | 'SERVER_ERROR' | 'PROVIDER_CONNECTION_FAILURE' | 'TRANSACTION_NOT_FOUND' | 'ACCOUNT_INFORMATION_ACCESS_REQUEST_NOT_FOUND' | 'CONSENT_REVOCATION_FAILED' | 'CONSENT_REVOKED_OR_EXPIRED' | 'SUBSCRIPTION_EXPIRED' | 'NOT_SUBSCRIBED_TO_SERVICE' | 'BENEFICIARY_NOT_FOUND' | 'PARTIES_NOT_FOUND' | 'DIRECT_DEBIT_NOT_FOUND' | 'SCHEDULED_PAYMENT_NOT_FOUND' | 'DEBTOR_ACCOUNT_NOT_FOUND' | 'CREDITOR_ACCOUNT_NOT_FOUND' | 'UNAUTHORIZED_IP_ADDRESS'
errorDescriptionobject nullable

Example response

{
  "data": {
    "paymentRequestId": "00000000-0000-0000-0000-000000000000",
    "amount": {
      "currency": {
        "id": "00000000-0000-0000-0000-000000000000"
      }
    },
    "consent": {
      "connection": {
        "provider": {
          "id": "00000000-0000-0000-0000-000000000000",
          "country": {
            "id": "00000000-0000-0000-0000-000000000000",
            "createdAt": "2025-01-01T00:00:00Z",
            "updatedAt": "2025-01-01T00:00:00Z",
            "currency": {
              "id": "00000000-0000-0000-0000-000000000000"
            }
          },
          "logo": "https://example.com"
        },
        "id": "00000000-0000-0000-0000-000000000000",
        "createdAt": "2025-01-01T00:00:00Z",
        "updatedAt": "2025-01-01T00:00:00Z"
      },
      "executionDateTime": "2025-01-01T00:00:00Z",
      "id": "00000000-0000-0000-0000-000000000000",
      "customerId": "00000000-0000-0000-0000-000000000000",
      "createdAt": "2025-01-01T00:00:00Z"
    },
    "country": {
      "id": "00000000-0000-0000-0000-000000000000",
      "createdAt": "2025-01-01T00:00:00Z",
      "updatedAt": "2025-01-01T00:00:00Z",
      "currency": {
        "id": "00000000-0000-0000-0000-000000000000"
      }
    },
    "debtorAccount": {
      "provider": {
        "id": "00000000-0000-0000-0000-000000000000",
        "country": {
          "id": "00000000-0000-0000-0000-000000000000",
          "createdAt": "2025-01-01T00:00:00Z",
          "updatedAt": "2025-01-01T00:00:00Z",
          "currency": {
            "id": "00000000-0000-0000-0000-000000000000"
          }
        },
        "logo": "https://example.com"
      },
      "id": "00000000-0000-0000-0000-000000000000"
    },
    "creditorAccount": {
      "provider": {
        "id": "00000000-0000-0000-0000-000000000000",
        "country": {
          "id": "00000000-0000-0000-0000-000000000000",
          "createdAt": "2025-01-01T00:00:00Z",
          "updatedAt": "2025-01-01T00:00:00Z",
          "currency": {
            "id": "00000000-0000-0000-0000-000000000000"
          }
        },
        "logo": "https://example.com"
      },
      "id": "00000000-0000-0000-0000-000000000000"
    },
    "createdAt": "2025-01-01T00:00:00Z",
    "updatedAt": "2025-01-01T00:00:00Z",
    "executionDateTime": "2025-01-01T00:00:00Z",
    "successRedirectUrl": "https://example.com",
    "failureRedirectUrl": "https://example.com"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.