Create Subscription

POST {{base_url}}/banking/v2/pay/domestic/subscription

Authorise Subscription Payment

Before the subscription payment can be initiated, the payment request needs to be approved.

Before calling this endpoint, subscription consent needs to be created in order to retrieve the authentication URL (sign-in url) for the bank.

Now, your application will need to redirect a user to the sign-in url location for them to sign in through their bank account.

The payment request will be completed once the user successfully signs in. You will be redirected back to your redirect field in the initial POST request body.

Request

FieldTypeDescription
subscriptionConsentIdstringunique identifier for the subscription consent
bankIdintegerUnique identifier for the bank
statestringBase64 encoded JSON containing information about the original request to persist the state throughout the user journey

Attributes

FieldTypeDescription
IdstringUnique identifier for the subscription
subscriptionConsentIdstringUnique identifier for the consent
payerCompanyIdstringUnique identifier for the company
bankIdintegerUnique identifier for the bank
subscriptionRequestIdstringUnique identifier for the subscription Request
creationDatestringDate and time of the transaction
subscriptionStatusstringStatus of the Subscription
amountintegerPayment amount
currencystringAccount currency
referencestringTransaction reference
productsstringcomma-separated list of subscribed products

Error Messages

ConditionResponse StatusResponse Body
Invalid bankId403 Forbidden
Invalid consentId403 Forbidden
No state400 Bad Request{“error”: “Missing/Invalid state}
Invalid state400 Bad Request{“error”: “Missing/Invalid state”}
Bank errors502 Bad Gateway{“error”: “Bank error”}

Request Body

{"OBSubscription"=>{"subscriptionConsentId"=>"5daade1c-0658-487d-89c4-cbc14a28ccfc", "state"=>"state", "bankId"=>31}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
X-Api-Keystring
X-Partner-Idstring
Authorizationstring
X-Company-Idstring

RESPONSES

status: Created

{"id":"6c3751c9-c28a-44b5-b38a-71299886fe6f","subscriptionConsentId":"907be5fa-8555-47e9-88b4-f003df73c0f7","payerCompanyId":"cecccb4b-2f98-4a8d-adad-c6f1f9768289","payerEmail":"payeremail","partnerId":"partner_id","subscriptionRequestId":"94d1cbc3-f7be-4aa6-a0cd-80435e67562e","bankId":0,"externalId":"","creationDate":"2022-02-16T15:47:22.565Z","updatedDate":"","amount":"9.95","currency":"GBP","reference":"tps-3n","subscriptionStatus":"PENDING","cancellationReason":"","isoStatus":"","products":"SMART_INVOICE","source":"MANUAL","paymentStartDate":"2022-02-17T15:47:22.361Z"}