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
Field | Type | Description |
---|---|---|
subscriptionConsentId | string | unique identifier for the subscription consent |
bankId | integer | Unique identifier for the bank |
state | string | Base64 encoded JSON containing information about the original request to persist the state throughout the user journey |
Attributes
Field | Type | Description |
---|---|---|
Id | string | Unique identifier for the subscription |
subscriptionConsentId | string | Unique identifier for the consent |
payerCompanyId | string | Unique identifier for the company |
bankId | integer | Unique identifier for the bank |
subscriptionRequestId | string | Unique identifier for the subscription Request |
creationDate | string | Date and time of the transaction |
subscriptionStatus | string | Status of the Subscription |
amount | integer | Payment amount |
currency | string | Account currency |
reference | string | Transaction reference |
products | string | comma-separated list of subscribed products |
Error Messages
Condition | Response Status | Response Body |
---|---|---|
Invalid bankId | 403 Forbidden | |
Invalid consentId | 403 Forbidden | |
No state | 400 Bad Request | {“error”: “Missing/Invalid state} |
Invalid state | 400 Bad Request | {“error”: “Missing/Invalid state”} |
Bank errors | 502 Bad Gateway | {“error”: “Bank error”} |
Request Body
{"OBSubscription"=>{"subscriptionConsentId"=>"5daade1c-0658-487d-89c4-cbc14a28ccfc", "state"=>"state", "bankId"=>31}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
X-Api-Key | string | ||
X-Partner-Id | string | ||
Authorization | string | ||
X-Company-Id | string |
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"}