openapi: 3.2.0 info: title: Fipto - OpenAPI 3.0 Payment links API version: 4.3.0 description: This is a REST API specifications based on OpenAPI 3.0 for Fipto solution. contact: url: https://www.fipto.com/ servers: - url: https://api.fipto.app description: The API server on production tags: - name: Payment links description: Manage payment links. paths: /companies/{company_id}/payment-links/{payment_link_id}: get: summary: Retrieve a specific payment link operationId: getPaymentLink tags: - Payment links parameters: - $ref: '#/components/parameters/company_id' - $ref: '#/components/parameters/payment_link_id' responses: '200': description: Retrieve a payment link. content: application/json: schema: allOf: - $ref: '#/components/schemas/meta' - type: object properties: data: $ref: '#/components/schemas/public_payment_link_data' patch: summary: Update a payment link operationId: updatePaymentLink description: Update a payment link as a user. tags: - Payment links parameters: - $ref: '#/components/parameters/company_id' - $ref: '#/components/parameters/payment_link_id' requestBody: content: application/json: schema: type: object required: - data properties: data: allOf: - $ref: '#/components/schemas/public_payment_link_update_data' responses: '204': description: Payment link updated. /companies/{company_id}/payment-links: get: summary: Retrieve all payment link operationId: listPaymentLinks tags: - Payment links parameters: - $ref: '#/components/parameters/company_id' - $ref: '#/components/parameters/page_number' - $ref: '#/components/parameters/page_size' - $ref: '#/components/parameters/sort' responses: '200': description: Retrieve all payment links. content: application/json: schema: allOf: - $ref: '#/components/schemas/meta' - $ref: '#/components/schemas/pagination' - type: object properties: data: type: array items: $ref: '#/components/schemas/public_payment_link_data' post: summary: Create payment link operationId: createPaymentLinks tags: - Payment links parameters: - $ref: '#/components/parameters/company_id' requestBody: content: application/json: schema: type: object required: - data properties: data: $ref: '#/components/schemas/public_payment_link_data' responses: '200': description: Create payment links. content: application/json: schema: allOf: - $ref: '#/components/schemas/meta' - type: object properties: data: $ref: '#/components/schemas/public_payment_link_data' '400': description: Bad Request content: application/json: schema: type: object required: - data properties: data: type: object required: - message properties: message: type: string enum: - wallet_id OR beneficiary_id must be provided. - Please select a beneficiary_id as destination. - Please select a wallet_id as destination. - '''expired_at'' must be at least 1 hour in the future.' - You've reached the maximum amount of payment links you can create in a 24-hour period. For further assistance or to request an adjustment to your limit, kindly contact our support at support@fipto.com. components: schemas: asset: description: The symbol/ticker of the crypto asset. type: string example: BTC request_id: type: string pattern: '[0-9]-[0-9a-fA-F]{8}-[0-9a-fA-F]{24}' description: Request identifier. sanitized_string: type: string description: Allow alphanumeric, +, -, _, &, (, ), °, space, single quote, comma, and all accented characters. pattern: ^[a-zA-Z0-9À-ɏ\s+'()_&,°-]*$ uuid: type: string pattern: '[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}' description: 128-bit value used to uniquely identify an object. example: 123e4567-e89b-12d3-a456-426614174000 positive_amount_greater_or_equal_1_with_two_decimals: type: string description: Strictly positive amount greater than or equal to 1, with up to two decimal places. example: '1.00' pattern: ^[1-9]\d*(\.\d{1,2})?$ object_id: description: Unique id of object type: object properties: id: readOnly: true allOf: - $ref: '#/components/schemas/uuid' meta: description: Metadata of the request type: object required: - meta properties: meta: type: object required: - request_id properties: request_id: oneOf: - $ref: '#/components/schemas/uuid' - $ref: '#/components/schemas/request_id' query_parameters: $ref: '#/components/schemas/query_parameters' wallet_address: type: string example: 0x71C* description: The public address associated with a wallet details on the blockchain. network_name: description: Name of network. type: string example: Bitcoin payment_link_status: description: The status of a payment link. type: string enum: - pending - completed - underpaid - overpaid example: pending payment_link_destination: description: Destination of a payment link. type: object properties: type: type: string enum: - wallet - beneficiary wallet_id: $ref: '#/components/schemas/uuid' beneficiary_id: $ref: '#/components/schemas/uuid' query_parameters: description: Information about the parameters in the request. All query string parameters provided (or implicit/with default value) will be returned type: object created_at: type: string format: date-time description: The specific date on which the transaction has been created. public_payment_link_update_data: description: Data to update a payment link. allOf: - $ref: '#/components/schemas/data_default' - type: object required: - type properties: type: type: string enum: - payment_link attributes: properties: external_reference: $ref: '#/components/schemas/payment_link_reference' note: $ref: '#/components/schemas/payment_link_note' payment_link_common: description: Payment link shared data. allOf: - $ref: '#/components/schemas/data_default' - $ref: '#/components/schemas/object_id' - type: object properties: type: type: string enum: - payment_link attributes: required: - base_amount - base_asset_code properties: base_amount: description: The desired payment amount expressed in the base_asset_code. allOf: - $ref: '#/components/schemas/positive_amount_greater_or_equal_1_with_two_decimals' base_asset_code: description: The currency used as the basis for calculating the amount to be paid. allOf: - $ref: '#/components/schemas/asset' example: EUR expired_at: description: The specific date on which the payment link will be expired. allOf: - $ref: '#/components/schemas/date' status: readOnly: true oneOf: - $ref: '#/components/schemas/payment_link_status' - type: string enum: - expired quote_amount: description: The amount of the payment expressed in the quote currency readOnly: true allOf: - $ref: '#/components/schemas/positive_amount' quote_asset_code: description: The currency used as the basis for calculating the amount paid. readOnly: true allOf: - $ref: '#/components/schemas/asset' payment_link_note: allOf: - $ref: '#/components/schemas/sanitized_string' minLength: 1 maxLength: 100 description: A custom message or note. This field allows for personalized communication or additional instructions to the payer. example: Monthly invoice payment data_default: description: Fields required on all objects. type: object required: - type - attributes properties: type: type: string attributes: type: object minProperties: 1 payment_link_reference: allOf: - $ref: '#/components/schemas/sanitized_string' minLength: 1 maxLength: 40 description: A reference to an external entity or resource. positive_amount: type: string description: Strictly positive amount expressed in the currency of the transaction. example: '1000' pattern: ^\d+(\.\d+)?$ date: description: Date. type: string format: date-time example: '2017-07-21T17:32:28Z' public_payment_link_data: description: Public payment link data. type: object allOf: - $ref: '#/components/schemas/payment_link_common' - type: object properties: attributes: required: - base_amount - base_asset_code - destination properties: destination: $ref: '#/components/schemas/payment_link_destination' external_reference: $ref: '#/components/schemas/payment_link_reference' note: $ref: '#/components/schemas/payment_link_note' created_at: description: The specific date on which the payment link was created. readOnly: true allOf: - $ref: '#/components/schemas/created_at' link: description: The URL to the payment page. readOnly: true type: string network_name: readOnly: true description: The name of the network used for the transaction. allOf: - $ref: '#/components/schemas/network_name' transaction_amount: readOnly: true description: The amount of the payment expressed in the transaction currency allOf: - $ref: '#/components/schemas/positive_amount' transaction_source: readOnly: true description: The source of the transaction. allOf: - $ref: '#/components/schemas/wallet_address' pagination: description: Information about the pagination of the request type: object required: - meta properties: meta: type: object required: - total_results - query_parameters properties: total_results: description: The total number of results type: number example: 100 query_parameters: allOf: - $ref: '#/components/schemas/query_parameters' required: - page_number - page_size - sort properties: page_number: type: number example: 1 page_size: type: number example: 100 sort: type: string example: created_at parameters: company_id: name: company_id in: path required: true description: The Company ID given by Fipto. example: 9de0691c-bc8d-409b-8f40-75d4f45db2f3 schema: $ref: '#/components/schemas/uuid' sort: name: sort in: query required: false schema: type: string example: created_at enum: - created_at - transaction_created_at page_number: name: page_number in: query required: false description: The page number retrieved in the paginated results. The default value is 1. schema: type: number example: 1 payment_link_id: name: payment_link_id in: path required: true description: A payment link identifier. example: cbd87a88-23cb-4f47-9996-1957a24f76e1 schema: $ref: '#/components/schemas/uuid' page_size: name: page_size in: query required: false description: The number of items to include in each page of the paginated results. The default value is 100. schema: type: number example: 100 x-topics: - title: Authentication content: "# Getting Started\n\nBefore using the API you need to generate a private/public key pair using:\n\n openssl genrsa -out private-key.rsa 2048\n openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in private-key.rsa -out private-key.pem\n openssl rsa -in private-key.rsa -pubout -out public-key.pem\n\nAfter sending us the public key by email, you will receive an api key, referred below as `keyId`.\n\n## HTTP request signing\n\nAll authenticated requests must include the following headers:\n\n- `Host`: target host of the request, e.g. \"api.fipto.app\"\n- `Date`: time of creation of the request, in RFC1123 format\n- `Signature`: signature of the request (see below)\n\nIn addition, requests with a body (POST, PUT, PATCH) must include:\n\n- `Content-Type`: MIME type of the body, e.g. \"application/json\"\n- `Digest`: base64-encoded SHA-256 hash of the body, in the format SHA-256=\n\n`Date` values are expected to be earlier than the present time, but not\nearlier than 1 minute.\n\n`Digest` values must obviously match to the actual hashes of their request\nbodies. The way of getting the digest is language-dependent but a basic\nUNIX approach would be\n\n echo -n $BODY | openssl dgst -sha256 -binary | openssl enc -base64 -A\n\nwhere $BODY contains the string representation of the request body.\n\n### Signature header\n\nRequests are signed and verified using the [HTTP signatures protocol](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-12).\nLibraries exist in different languages for building signed requests using that\nprotocol. We focus here on our specific requirements.\n\nWe expect the authentication data to be present in a `Signature` header.\n\nThe \"signing string\" itself should contain all the headers mentioned in the previous section,\nas well as the `(request-target)` pseudo-header (see [section 2.3](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-12#section-2.3)).\n\nFor example, the signing string of a POST request would look like:\n\n (request-target): post /companies/c240e5bf-863e-4f44-91aa-cc74a8b3303f/wallets\n host: api.demo.fipto.tech\n date: Fri, 24 Jan 2025 08:56:30 GMT\n content-type: application/json\n digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=\n\nThat string must then be signed using the RSA-256 algorithm, encoded in base64 and\nincluded in the `signature` field of the header.\n\nThe following constraints apply to other fields:\n\n- the `keyId` field must contain the UUID of your API user\n- the `headers` field must contain `(request-target)` as well as all the headers mentioned above\n- the `algorithm` field must be \"hs2019\" (or its synonym \"rsa-sha256\")\n\nThe final header of a POST request should look like:\n\n Signature: keyId=\"\",algorithm=\"hs2019\",headers=\"(request-target) host date content-type digest\",signature=\"\"\n"