File Payment Usage Examples - v3.1.2
- Setup File Payment Consent
- Upload File to for the File Payment Consent
- Submit the File Payment after Authorisation
- Upload File in the UK.OBIE.PaymentInitiation.4.0 format to the File Payment Consent
Setup File Payment Consent
This is an API call by the PISP to create the file-payment-consent metadata.
POST /file-payment-consents
Request
POST /file-payment-consents HTTP/1.1
Authorization: Bearer 2YotnFZFEjr1zCsicMWpAA
x-idempotency-key: FRESCO.21302.GFX.20
x-jws-signature: TGlmZSdzIGEgam91cm5leSBub3QgYSBkZXN0aW5hdGlvbiA=..T2ggZ29vZCBldmVuaW5nIG1yIHR5bGVyIGdvaW5nIGRvd24gPw==
x-fapi-auth-date: Sun, 10 Sep 2017 19:43:31 UTC
x-fapi-customer-ip-address: 104.25.212.99
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
Accept: application/json
{
"Data": {
"Initiation": {
"FileType": "UK.OBIE.pain.001.001.08",
"FileHash": "m5ah/h1UjLvJYMxqAoZmj9dKdjZnsGNm+yMkJp/KuqQ",
"FileReference": "GB2OK238",
"NumberOfTransactions": "100",
"ControlSum": 3459.30
}
}
}
Response
HTTP/1.1 201 Created
x-jws-signature: V2hhdCB3ZSBnb3QgaGVyZQ0K..aXMgZmFpbHVyZSB0byBjb21tdW5pY2F0ZQ0K
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
{
"Data": {
"ConsentId" : "512345",
"Status": "AwaitingUpload",
"CreationDateTime": "2018-06-05T15:15:13+00:00",
"StatusUpdateDateTime": "2018-06-05T15:15:13+00:00",
"Initiation": {
"FileType": "UK.OBIE.pain.001.001.08",
"FileHash": "m5ah/h1UjLvJYMxqAoZmj9dKdjZnsGNm+yMkJp/KuqQ",
"FileReference": "GB2OK238",
"NumberOfTransactions": "100",
"ControlSum": 3459.30
}
},
"Links":{
"Self":"https://api.alphabank.com/open-banking/v4.0/pisp/file-payment-consents/512345"
},
"Meta":{}
}
Upload File to for the File Payment Consent
Once the metadata has been accepted by the ASPSP, the PISP may post the file to the file endpoint.
The file should conform to the XML ISO20022 pain.001.001.08 format.
POST /file-payment-consents/{ConsentId}/file
Request
POST /file-payment-consents/512345/file HTTP/1.1
Authorization: Bearer 2YotnFZFEjr1zCsicMWpAA
x-idempotency-key: FRESCO.21302.GFX.20
x-jws-signature: TGlmZSdzIGEgam91cm5leSBub3QgYSBkZXN0aW5hdGlvbiA=..T2ggZ29vZCBldmVuaW5nIG1yIHR5bGVyIGdvaW5nIGRvd24gPw==
x-fapi-auth-date: Sun, 10 Sep 2017 19:43:31 UTC
x-fapi-customer-ip-address: 104.25.212.99
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: text/xml
Accept: application/json
[File-Data]
A sample file with 3 transactions is provided below:
File Data Expand source
```xmlResponse
HTTP/1.1 200 OK
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Submit the File Payment after Authorisation
Once the metadata and file are both attached to the consent, and the user is able to authorise the consent.
The PISP must POST the file-payment resource to submit the file-payment for execution. The JSON message is signed.
POST /file-payments
Request
POST /file-payments HTTP/1.1
Authorization: Bearer 2YotnFZFEjr1zCsicMWpAA
x-idempotency-key: FRESCO.21302.GFX.20
x-jws-signature: TGlmZSdzIGEgam91cm5leSBub3QgYSBkZXN0aW5hdGlvbiA=..T2ggZ29vZCBldmVuaW5nIG1yIHR5bGVyIGdvaW5nIGRvd24gPw==
x-fapi-auth-date: Sun, 10 Sep 2017 19:43:31 UTC
x-fapi-customer-ip-address: 104.25.212.99
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
Accept: application/json
{
"Data": {
"ConsentId":"512345",
"Initiation": {
"FileType": "UK.OBIE.pain.001.001.08",
"FileHash": "m5ah/h1UjLvJYMxqAoZmj9dKdjZnsGNm+yMkJp/KuqQ",
"FileReference": "GB2OK238",
"NumberOfTransactions": "100",
"ControlSum": 3459.30
}
}
}
Response
HTTP/1.1 201 Created
x-jws-signature: V2hhdCB3ZSBnb3QgaGVyZQ0K..aXMgZmFpbHVyZSB0byBjb21tdW5pY2F0ZQ0K
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
{
"Data": {
"ConsentId" : "512345",
"FilePaymentId":"FP1-512345",
"Status": "InitiationPending",
"CreationDateTime": "2018-06-05T15:15:13+00:00",
"StatusUpdateDateTime": "2018-06-05T15:15:13+00:00",
"Initiation": {
"FileType": "UK.OBIE.pain.001.001.08",
"FileHash": "m5ah/h1UjLvJYMxqAoZmj9dKdjZnsGNm+yMkJp/KuqQ",
"FileReference": "GB2OK238",
"NumberOfTransactions": "100",
"ControlSum": 3459.30
}
},
"Links":{
"Self":"https://api.alphabank.com/open-banking/v4.0/pisp/file-payments/FP1-512345"
},
"Meta":{}
}
Upload File in the UK.OBIE.PaymentInitiation.4.0 format to the File Payment Consent
Steps:
- Stage the File Payment Consent with “FileType”: “UK.OBIE.PaymentInitiation.4.0”.
- Upload the File with payments in UK.OBIE.PaymentInitiation.v4.0 format, as described below.
POST /file-payment-consents/{ConsentId}/file
Request
POST /file-payment-consents/512346/file HTTP/1.1
Authorization: Bearer 2YotnFZFEjr1zCsicMWpAA
x-idempotency-key: FRESCO.21302.GFX.20
x-jws-signature: TGlmZSdzIGEgam91cm5leSBub3QgYSBkZXN0aW5hdGlvbiA=..T2ggZ29vZCBldmVuaW5nIG1yIHR5bGVyIGdvaW5nIGRvd24gPw==
x-fapi-auth-date: Sun, 10 Sep 2017 19:43:31 UTC
x-fapi-customer-ip-address: 104.25.212.99
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
Accept: application/json
[ File Data ]
A sample file with 3 Domestic Payments - CHAPS, BACS and one unspecified is provided below:
File Data Expand source
```json { "Data": { "DomesticPayments": [{ "InstructionIdentification": "ANSM020", "EndToEndIdentification": "FRESCO.21302.GFX.01", "LocalInstrument": "UK.OBIE.CHAPS", "InstructedAmount": { "Amount": "21.00", "Currency": "GBP" }, "DebtorAccount": { "SchemeName": "UK.OBIE.SortCodeAccountNumber", "Identification": "11280001234567", "Name": "Andrea Smith" }, "CreditorAccount": { "SchemeName": "UK.OBIE.SortCodeAccountNumber", "Identification": "08080021325698", "Name": "Bob Clements" }, "CreditorPostalAddress": { "AddressType": "Correspondence", "StreetName": "Liberty", "BuildingNumber": "1", "PostCode": "AB1 2CD", "TownName": "London", "Country": "UK" }, "RemittanceInformation": { "Reference": "FRESCO-037", "Unstructured": "Internal ops code 5120103" } }, { "InstructionIdentification": "ANSM021", "EndToEndIdentification": "FRESCO.21302.GFX.02", "LocalInstrument": "UK.OBIE.BACS", "InstructedAmount": { "Amount": "22.00", "Currency": "GBP" }, "DebtorAccount": { "SchemeName": "UK.OBIE.SortCodeAccountNumber", "Identification": "11280001234567", "Name": "Andrea Smith" }, "CreditorAccount": { "SchemeName": "UK.OBIE.SortCodeAccountNumber", "Identification": "08080021325698", "Name": "Bob Clements" }, "RemittanceInformation": { "Reference": "FRESCO-037", "Unstructured": "Internal ops code 5120103" } }, { "InstructionIdentification": "ANSM022", "EndToEndIdentification": "FRESCO.21302.GFX.03", "InstructedAmount": { "Amount": "23.00", "Currency": "GBP" }, "DebtorAccount": { "SchemeName": "UK.OBIE.SortCodeAccountNumber", "Identification": "11280001234567", "Name": "Andrea Smith" }, "CreditorAccount": { "SchemeName": "UK.OBIE.SortCodeAccountNumber", "Identification": "08080021325698", "Name": "Bob Clements" }, "RemittanceInformation": { "Reference": "FRESCO-037", "Unstructured": "Internal ops code 5120103" } }] } } ```Response
HTTP/1.1 200 OK
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d