CRIPTAN Fiat Gateway API reference guide

API Overview

This document describes CRIPTAN’s internal API for fiat payments available for CRIPTAN’s partners.

Note

The base URL for all browser requests is https://fg.criptan.es/

The base URL for all API requests is https://fg-api.criptan.es/

The base URLs for the sandbox environments have the suffix sandbox as follows: fg-sandbox.criptan.es and fg-api-sandbox.criptan.es

All requests to the API must include a request header named authorization containing a valid API authorization token. A content-type request header must also be set, with value application/json.

All responses from the API include a common set of fields indicating the status and success of the request. Examples:

API Response
    {
        "success": false,
        "timestamp": 1587468224,
        "errorMessage": "Resource could not be found"
    }

Transfer

Create Transfer

There are two ways to create a new transfer: via API call or by visiting a specific URL with a web browser directly.

API call supports sending CRIPTAN the KYC data if required.

Web browser redirection

HTTP request
    https://fg.criptan.es/

    POST
    {
        "currency": "EUR",
        "amount": 100,
        "receiverAccount": "sales@company.com",
        "senderAccount": "user@personal.com",
        "externalOrderId": "fdbe66e4-c3e1-4c38-8a4b-5fb95c7411ca",
        "callbackUrlSuccess": "https://company.com/success"
        "callbackUrlError": "https://company.com/error"
    }
_images/overview.png _images/paymentDetails.png

API

API request
    curl -X POST https://fg-api.criptan.es/v1/transfer \
        -H 'authorization: Bearer eac33631-e416-43f9-b8ad-cff3cc0ab16b' \
        -H 'content-type: application/json' \
    {
        "currency": "EUR",
        "amount": 100,
        "receiverAccount": "sales@company.com",
        "senderAccount": "user@personal.com",
        "externalOrderId": "fdbe66e4-c3e1-4c38-8a4b-5fb95c7411ca",
        "callbackUrlSuccess": "https://company.com/success",
        "callbackUrlError": "https://company.com/error",
        "receiverKycData: {
            "firstName": "John"
            "lastName": "Doe"
            "documents": [
                {
                    type: "identity-document",
                    format: "png"
                    data: "..."
                },
                {
                    type: "residence-proof",
                    format: "pdf"
                    data: "..."
                },
            ]
        }
    }

Parameters available through API and Web

  • currency - The currency in which the transfer is made.
  • amount - The transfer’s amount of currency units.
  • receiverAccount - Account ID/email address of the transfer recipient.
  • senderAccount - Account ID/email address of the transfer sender.
  • externalOrderId - An arbitrary ID used to
  • callbackUrlSuccess - (Optional) URL to which the user will be redirected in case of payment has been received successfully.
  • callbackUrlError - (Optional) URL to which the user will be redirected in case of payment could not be received successfully.

Note

Use externalOrderId to link the payment to your system.

Parameters available through API

  • firstName - Sender’s first name

  • lastName - Sender’s last name

  • type - Type of document. Values: identity-document, *residence-proof”.

  • format - Document format. Supported formats are: png, jpg, pdf.

  • data - Document contents in Base64 encoding.

    API Response
        {
            "success": true,
            "timestamp": 1587468224,
            "data": {
                "id": "271d2c17b7e0",
                "url": "https://fg.criptan.es/271d2c17b7e0",
                "status: "CREATED",
                "createdAt": 1587468224,
                "receiverKycData": "PROCESSING"
            }
        }
    
  • success - Whether or not the request was processed successfully.

  • timestamp - Unix time in seconds at which the request was processed.

  • id - The id of the transfer that was just created.

  • url - URL to which the transfer UI can be accessed.

  • status - Status of the transfer: CREATED, PENDING, CONFIRMED.

  • createdAt - Unix time in seconds at which the transfer was created.

  • receiverKycData - Status of the KYC verification process: PROCESSING, VALID, INVALID.

List Transfers

API

API request
    curl -X GET https://fg-api.criptan.es/v1/transfer \
        -H 'authorization: Bearer eac33631-e416-43f9-b8ad-cff3cc0ab16b' \
        -H 'content-type: application/json'
API Response
    {
        "success": true,
        "data": [
            {
                "id": "19667833f055",
                "url": "https://fg.criptan.es/19667833f055",
                "status: "CANCELLED",
                "createdAt": 1587466284
            },
            {
                "id": "271d2c17b7e0",
                "url": "https://fg.criptan.es/271d2c17b7e0",
                "status: "CREATED",
                "createdAt": 1587468224,
                "receiverKycData": "ok"
            }
        ]
    }
  • success - Whether or not the request was processed successfully.
  • timestamp - Unix time in seconds at which the request was processed.
  • id - The id of the transfer that was just created.
  • url - URL to which the transfer UI can be accessed.
  • status - Status of the transfer: CREATED, PENDING, CONFIRMED.
  • createdAt - Unix time in seconds at which the transfer was created.
  • receiverKycData - Status of the KYC verification process: PROCESSING, VALID, INVALID.

Cancel Transfer

API

API request
    curl -X DELETE https://fg-api.criptan.es/v1/transfer \
        -H 'authorization: Bearer eac33631-e416-43f9-b8ad-cff3cc0ab16b' \
        -H 'content-type: application/json' \
    {
        "id": "271d2c17b7e1"
    }
API Response
    {
        "success": false,
        "timestamp": 1587468223,
        "errorMessage": "Resource could not be found"
    }
  • success - Whether or not the request was processed successfully.
  • timestamp - Unix time in seconds at which the request was processed.