Firstoken API Docs
  • ⚙️API Reference
    • Firstoken API
      • Tokenization As A Service
        • Simple Tokenization
        • Simple Detokenization
        • Inspect Token
        • Delete Tokens
      • Transactions
        • Create a Transaction
        • Retrieve a Transaction
        • Inspect a Transaction
        • Delete a Transaction
        • Tokenize a Transaction
      • Proxy
        • Allowed Headers
        • Actions
        • Methods
          • POST - Proxy
          • GET - Proxy
          • PUT - Proxy
          • PATCH - Proxy
          • DELETE - Proxy
        • Get Payload Hash
        • Proxy JOSE
        • Proxy WSSEC
      • Inbound Routes
        • Create an Inbound - POST
      • Payments
        • Attributes of the Request
        • Common response
        • Endpoints
          • Authorizations
          • Reversals
          • Capture
            • Capture Refunds
            • Capture Void
          • Payments
            • Payment Refunds
            • Payment Void
          • Refunds void
          • Credit
            • Credit Void
          • Get Transaction Details
        • Decision Manager
          • How it works
          • Create decision
          • Update Decision
        • Risk Payer Authentication
          • How to use it
          • 3-D Secure Flows
            • Successful Frictionless Authentication
            • Unsuccessful Frictionless Authentication
            • Attempts Processing Frictionless Authentication
            • Unavailable Frictionless Authentication
            • Rejected Frictionless Authentication
            • Authentication not available on Lookup
            • Enrollment check error
            • Time-out
            • Bypassed Authentication
            • Successful Step-Up Authentication
            • Unsuccessful Step-Up Authentication
            • Unavailable Step-Up Authentication
            • Require Method URL
        • Point of Sale Payments
          • Authorization
          • Capture
          • Payment
          • Credit
  • 📖Guides
    • Firstoken Captures Hosted Iframe
      • How Firstoken Captures works
      • Generating a JSON Web Token
      • JSON form Schema
      • Iframe Communication
    • De-scoping Components
      • How Firstoken De-scoping Components works
      • Inbound Routes Module
        • Create an Inbound Route
        • Edit an Inbound Route
        • Delete an Inbound Route
      • Webhook Module
        • Create a Webhook
        • Edit a Webhook
        • Delete a Webhook
        • Webhook events
        • How to sign Webhooks data
      • Proxy Module
        • Create a Proxy
        • Edit a Proxy
        • Delete a Proxy
    • Firstoken Captures SDK JS
      • Getting Started
      • Functions
      • Type of Elements
      • Elements Options
      • CSS Object
      • Full Example of Usage
      • SDK versions
Powered by GitBook
On this page
  • Request Headers
  • Request Body
  • Response
  • Error Handling

Was this helpful?

  1. API Reference
  2. Firstoken API
  3. Payments
  4. Point of Sale Payments

Credit

This endpoint is used to process a credit transaction. It requires a JSON payload containing transaction details, order information, and point-of-sale (POS) data.

The URL for this endpoint is https://api.firstoken.co/v1/payments/credits

In case of sandbox environment you should use this URL: https://api.firstoken-staging.co/v1/payments/credits

Request Headers

  • Content-Type: application/json

  • x-api-key: <Your API Key>

  • transaction_info {object}

    • type Type of transaction. Possible values: credit.

    • reference_code Unique reference code for the transaction.

  • order_info {object}

    • amount_details {object}

      • total_amount Total amount to be credited.

      • currency Currency code (e.g., MXN for Mexican Peso).

  • pos {object}

    • entry_mode Method of entering payment card information into the POS terminal. Possible values:

      • contact: Read directly from the chip card via contact.

      • contactless: Read from a contactless interface using chip data.

      • keyed: Manually entered into the POS terminal.

      • msd: Read from a contactless interface using magnetic stripe data (MSD).

      • swiped: Read from the magnetic stripe of the credit card.

      Note: The values contact, contactless, and msd are compatible only for EMV transactions.

    • term_capability POS terminal capability. Possible values:

      • 1: The terminal has only a magnetic stripe reader.

      • 2: The terminal has a magnetic stripe reader and manual input capability.

      • 3: The terminal has only manual input capability.

      • 4: The terminal can read chip cards.

      • 5: The terminal can read chip cards contactlessly; cannot use contact to read chip cards.

      Note: For an EMV transaction, the value of this field must be 4 or 5.

    • cat_level Card acceptance terminal (CAT) level.

      Possible values:

      • 1: Automated dispensing machine

      • 2: Self-service terminal

      • 3: Limited amount terminal

      • 4: In-flight commerce (IFC) terminal

      • 5: Radio frequency device

      • 6: Mobile acceptance terminal

      • 7: Electronic cash register

      • 8: E-commerce device at your location

      • 9: Terminal or cash register that uses a dialup connection to connect to the transaction processing network

    • emv {object}

      • tags EMV tags.

      • verification_method EMV verification method.

      • sequence_number Sequence number for the transaction.

    • track_data Track data from the card.

    • verification_method Complete list of cardholder verification methods (CVM) supported by the terminal.

      Possible Values:

      • PIN: For terminals with a PIN keypad.

      • Signature: For terminals capable of receiving a signature.

      • pinOnGlass: For terminals where the PIN is entered on a glass-based capture mechanism.

      Example:

      • ["PIN", "Signature"]

    • term_input_capability List of terminal input capabilities supported by the terminal.

      • Possible Values:

        • Keyed: The terminal can accept card data entered manually.

        • Swiped: The terminal can accept card data from a magnetic stripe reader.

        • Contact: The terminal can accept card data in contact mode EMV (card insertion).

        • Contactless: The terminal can accept card data in contactless mode EMV (card tap).

        • BarCode: The terminal can read barcodes.

        • QRcode: The terminal can read or scan QR codes.

        • OCR: The terminal can perform optical character recognition (OCR) on the card.

      Example:

      • ["Keyed", "Swiped", "Contact", "Contactless"]

    • term_card_capture_capability Indicates whether the terminal can capture the card.

      • Possible Values:

        • 1: The terminal can capture the card.

        • 0: The terminal cannot capture the card.

    • device_id Unique value created by the client software to identify the POS device.

    • encrypted_key_serial_number Combination of the unique device identifier and a transaction counter used in the process of decrypting the encrypted PIN. The entity that injected the PIN encryption keys into the terminal decrypts the encrypted PIN and creates this value

  • status Status of the response. Possible values: success, error or fail.

  • message Message describing the result of the credit transaction.

  • data {object}

    • transaction_info {object}

      • type Type of transaction response. Possible values: credit_response.

      • reference_code Unique reference code for the transaction.

      • transaction_id Unique transaction ID.

      • request_id Unique request ID.

      • status Status of the transaction. Possible values: Pending, Credited, Declined.

      • reconciliation_id Reconciliation ID for the transaction.

      • created_at Timestamp of when the transaction was created.

    • order_info {object}

      • amount_details {object}

        • credit_amount Credited amount.

        • currency Currency code.

Request Body

The request body should be a JSON object with the following structure:

Example of the request body
{
  "transaction_info": {
    "type": "credit",
    "reference_code": "123456789"
  },
  "order_info": {
    "amount_details": {
      "total_amount": 1000,
      "currency": "MXN"
    }
  },
  "pos": {
    "entry_mode": "contactless",
    "term_capability": "2",
    "cat_level": "1",
    "emv": {
      "tags": "9F3303204000950500000000009F3704518823719F10070601",
      "verification_method": 0,
      "sequence_number": "999"
    },
    "track_data": "%B38000000000006^TEST/CYBS         ^2512121019761100      00868000000?;3800000000006=25121210197611868000?",
    "verification_method": ["PIN", "Signature"],
    "term_input_capability": ["Contact", "Contactless", "Keyed", "Swiped"],
    "term_card_capture_capability": 1,
    "device_id": "123lkjdIOBK34981slviLI39bj",
    "encrypted_key_serial_number": "1043191"
  }
}

Response

The response will be a JSON object with the following structure:

Example of the response
{
  "status": "success",
  "message": "Credit successful",
  "data": {
    "transaction_info": {
      "type": "credit_response",
      "reference_code": "123456789",
      "transaction_id": "0001733750848834574048",
      "request_id": "7337508502966825004951",
      "status": "Pending",
      "reconciliation_id": "JQ3FY4GM9GQF",
      "created_at": "2024-12-09T13:27:30Z"
    },
    "order_info": {
      "amount_details": {
        "credit_amount": 1000,
        "currency": "MXN"
      }
    }
  }
}

Error Handling

In case of an error, the response will have a status of fail and a descriptive message. The data object provides more details about the specific issues encountered.

PreviousPaymentNextFirstoken Captures Hosted Iframe

Last updated 6 months ago

Was this helpful?

⚙️