openapi: 3.2.0 info: version: 1.6.0 title: iBanFirst Documents API description: "iBanFirst API for cross-border payments, FX trades, account management, beneficiaries, and webhooks.\n\n**Try it out in Postman:** [View Postman Collection](https://www.postman.com/productibf/ibanfirst-rest-api-workspace/collection/d24hl8d/ibanfirst-rest-api?action=share&creator=44872188)\n\n---\n\n## Authentication — X-WSSE\n\nEvery request must include an `X-WSSE` header. Plain HTTP calls will fail. The token is **stateless and expires after ~5 minutes**, so it must be computed fresh for each request.\n\n### Header format\n\n```\nX-WSSE: UsernameToken Username=\"\", PasswordDigest=\"\", Nonce=\"\", Created=\"\"\n```\n\n### Fields\n\n| Field | Description |\n|---|---|\n| `Username` | The username assigned during onboarding. |\n| `Nonce` | A Base64-encoded random hex string (≥ 32 hex characters). |\n| `Created` | Current UTC timestamp in ISO 8601: `YYYY-MM-DDTHH:MM:SSZ`. |\n| `PasswordDigest` | `Base64( SHA-1( nonce_bytes ∥ created_bytes ∥ secret_bytes ) )` — SHA-1 **binary** digest, then Base64. |\n\n### Algorithm (step-by-step)\n\n1. Generate a random nonce: at least 32 lowercase hexadecimal characters (e.g. `d36e3162829ed4c89851497a717f0001`).\n2. Get the current UTC timestamp as an ISO-8601 string (e.g. `2026-05-12T10:30:00Z`).\n3. Encode the nonce string as UTF-8 bytes, the timestamp as UTF-8 bytes, and the API secret as UTF-8 bytes.\n4. Compute `SHA-1( nonce_bytes + created_bytes + secret_bytes )`. The hash **must** be the raw binary digest (not hex).\n5. `PasswordDigest` = `Base64( sha1_binary_digest )`\n6. `Nonce` = `Base64( nonce_utf8_bytes )`\n\n### Code samples\n\n**Python**\n```python\nimport base64, hashlib, os, binascii\nfrom datetime import datetime, timezone\n\ndef generate_xwsse(username: str, secret: str) -> str:\n nonce = binascii.b2a_hex(os.urandom(16)) # 32 hex bytes\n created = datetime.now(timezone.utc).strftime(\"%Y-%m-%dT%H:%M:%SZ\")\n digest = base64.b64encode(\n hashlib.sha1(nonce + created.encode() + secret.encode()).digest()\n ).decode()\n nonce_b64 = base64.b64encode(nonce).decode()\n return f'UsernameToken Username=\"{username}\", PasswordDigest=\"{digest}\", Nonce=\"{nonce_b64}\", Created=\"{created}\"'\n```\n\n**JavaScript (Node.js)**\n```javascript\nconst crypto = require('crypto');\nfunction generateXWSSE(username, secret) {\n const nonce = crypto.randomBytes(16);\n const created = new Date().toISOString();\n const digest = crypto.createHash('sha1')\n .update(nonce)\n .update(Buffer.from(created))\n .update(Buffer.from(secret))\n .digest('base64');\n return `UsernameToken Username=\"${username}\", PasswordDigest=\"${digest}\", Nonce=\"${nonce.toString('base64')}\", Created=\"${created}\"`;\n}\n```\n\n**PHP**\n```php\nfunction generateXWSSE(string $username, string $secret): string {\n $nonce = bin2hex(random_bytes(16)); // 32 hex chars\n $created = gmdate('Y-m-d\\TH:i:s\\Z');\n $digest = base64_encode(sha1($nonce . $created . $secret, true));\n return sprintf('UsernameToken Username=\"%s\", PasswordDigest=\"%s\", Nonce=\"%s\", Created=\"%s\"',\n $username, $digest, base64_encode($nonce), $created);\n}\n```\n\n### Environments\n\n| Environment | Base URL |\n|---|---|\n| Demo (testing) | `https://api-demo.ibanfirst.com/api` |\n| Live (production) | `https://api.ibanfirst.com/api` |\n\n### Forbidden characters in input fields\n\nThe following characters are rejected in route parameters, query parameters, and JSON bodies: `&` `<` `>` `%` `?` `\\` `/` `|`" servers: - url: https://api-demo.ibanfirst.com/api security: - X-WSSE: [] tags: - name: Documents description: "The API allows you to access your documents stored on the iBanFirst platform through a one-time access link.\n\n Documents must be generated on the platform before being available through the API." paths: /documents: get: summary: Get documents list tags: - Documents description: 'This service allows you to retrieve the list of documents available for you on the iBanFirst platform. ' parameters: - name: page in: query description: 'Index of the page. ' required: false schema: type: string default: '1' - name: per_page in: query description: 'Number of items returned. ' required: false schema: type: string default: '50' responses: '200': description: OK content: application/json: schema: type: array items: type: object properties: id: $ref: '#/components/schemas/ID' name: description: 'The name of the document. ' type: string type: description: 'The type of document. ' type: string createdDate: $ref: '#/components/schemas/Datetime' link: description: 'The one-time link to the document. ' type: string '204': description: No documents found default: description: ERROR content: application/json: schema: $ref: '#/components/schemas/Error' /documents/{id}: get: summary: Get document details tags: - Documents description: 'Retrieve details for a specific document. ' parameters: - name: id in: path description: 'The unique identifier of the document you want. ' required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Document' default: description: ERROR content: application/json: schema: $ref: '#/components/schemas/Error' /documents/RIB: get: summary: Get RIB tags: - Documents description: Retrieve RIB for a specific account. parameters: - name: walletId in: query description: 'The account ID for which the RIB is requested. ' required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Document' default: description: ERROR content: application/json: schema: $ref: '#/components/schemas/Error' /documents/upload/{object}/{objectId}/{typeOfDocumentation}: put: summary: Upload a document tags: - Documents description: "This service allows you to upload documents.\n\n For an `externalBankAccount` object type (*beneficiary*), you may only upload an `identity` type of document.\n\nFor a `payment` object type, you may upload either a `identity` or `invoice` type of document.\n\nTo send a file, you have to extract its content in a binary format, encode it with a base64 algorithm and insert the result in the `file` field of the body request.\n" parameters: - name: object in: path description: 'The type of object you want to upload a document on. ' required: true schema: type: string enum: - externalBankAccount - payment - name: objectId in: path description: 'The unique identifier of the object you want to upload a document on. ' required: true schema: type: string - name: typeOfDocumentation in: path description: 'The type document you want to upload on your object. ' required: true schema: type: string enum: - identity - invoice requestBody: content: application/json: schema: type: object required: - tag - file properties: tag: description: 'The name of the document to be attached. ' type: string file: description: 'The binary content of the file, encoded with a base64 algorithm. ' type: string description: 'The document to upload ' required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Document' default: description: ERROR content: application/json: schema: $ref: '#/components/schemas/Error' components: schemas: Document: type: object description: 'Representation of a document. ' properties: id: $ref: '#/components/schemas/ID' name: description: 'The name of the document. ' type: string type: description: 'The type of the document. ' type: string createdDate: $ref: '#/components/schemas/Datetime' lastOpennedDate: $ref: '#/components/schemas/Datetime' mimeType: description: 'The MIME type of the document. ' type: string link: description: 'The one-time link to access or download the document. ' type: string Error: type: object description: 'Representation of an error. ' properties: errorCode: type: number format: int description: 'The code referring the error. ' errorType: type: string description: 'A short description identifying a general category for the error that occurred. ' errorMessage: type: string description: Error description. link: type: string description: 'An hyperlink to access the page that describes more accurately the error. ' Datetime: type: string pattern: ^((19[0,99]|2[0-9]{3})\-(0[1-9]|1[012])\-([012][0-9]|3[01])\ ([01][0-9]|2[0-3])\:([0-5][0-9])\:([0-5][0-9]))$ format: ^((19[0,99]|2[0-9]{3})\-(0[1-9]|1[012])\-([012][0-9]|3[01])\ ([01][0-9]|2[0-3])\:([0-5][0-9])\:([0-5][0-9]))$ example: '2016-01-01 00:00:00' description: 'A String representing a date by its year, month, day in month, hour, minute and second. ' ID: type: string pattern: ^[A-Za-z0-9]+$ format: ^[A-Za-z0-9]+$ example: Na5Dv6E description: 'A String representing the id of an object. This string contains alpha-numeric characters, including the capital ones. ' securitySchemes: X-WSSE: type: apiKey in: header name: X-WSSE description: 'X-WSSE token-based authentication. The header value must be computed fresh for every request (tokens expire in ~5 minutes). Header value format: ``` UsernameToken Username="", PasswordDigest="", Nonce="", Created="" ``` Algorithm: 1. Generate a random nonce: ≥ 32 lowercase hex characters. 2. Get current UTC timestamp in ISO 8601: `YYYY-MM-DDTHH:MM:SSZ`. 3. Compute `PasswordDigest = Base64( SHA-1( nonce_bytes + created_bytes + secret_bytes ) )` — SHA-1 over the raw UTF-8 bytes concatenated in that order, result must be the binary digest before Base64 encoding. 4. Compute `Nonce = Base64( nonce_utf8_bytes )`. See the `info.description` field at the top of this spec for full code samples in Python, JavaScript, PHP, Java, and Go.'