NAV Navbar
  • Introduction
  • Transactions
  • Users
  • Introduction

    Correct answer example

    If query should return entity_name:

    {
      "success": true,
      "entity_name": {
        ...
      }
    }
    

    Answer has flag success: true and additional fields, if they are provided.

    Request body

    Fields listed in the table for the query is sent to the body query

    Signature

    For improved security we use signatures for queries. It allows us to check that secretKey of sender is correct. It must be created from other query fields (list of fields and their order is specified for each query). You should use md5 library.

    Example of creating signature:

    md5([name, amount, secretKey].join(';')).toUpperCase()

    Transactions

    Create transaction

    Correct answer:

    {
      "success": true,
      "transaction": {
        "id": "5b74232016ee0da591d92457",
        "merchant": "5b630a4a3788982e9b130da6",
        "currency": "XOF",
        "amount": 534,
        "status": "open",
        "orderNumber": null, // if specified
        "customerNumber": null, // if specified
        "signature": "1C1B0CEBAD316B32ED48B4C88D1E69FC"
      }
    }
    

    Your transaction link (which user must click to pay) will be: https://app.payqin.com/p/:your_uniq_link_or_your_id/:transaction_id

    HTTP Request

    POST app.payqin.com/business-api/transactions

    Request body

    Param Type isRequired Description
    shopId string (objectID) true Merchant PayQin id
    vendorId string (objectID) false Vendor PayQin id
    amount number true Transaction amount
    customerNumber string false Customer id in your system
    orderNumber string false Order id in your system
    signature string true MD5 string (shopId;amount;secretKey)

    Check transaction

    Our server send request on your checkOrderUrl. You should check that all fields are correct and, which is most important part, compare signatures. Then you should send response with code 200 and message:

    { "success": true }

    Any other response accepts as error.

    Request body

    Param Type Default value Description
    action string checkOrder Request type
    id string (objectID) - Transaction id
    orderNumber string - Order id in your system
    customerNumber string - Customer id in your system
    currencyCode string - Transaction currency code
    shopAmount number - Transaction amount
    signature string - MD5 string (id;orderNumber;customerNumber;amount;currencyCode;secretKey)
    requestDate string Date.now Date of request

    Transaction notifications

    Our server send request on your notifyUrl. You should check that all fields are correct and, which is most important part, compare signatures. Then you should send response with code 200 and message:

    { "success": true }

    Any other response accepts as error.

    If response was incorrect, we try to send request again 6 times in next 24 hours. If all 6 requests will get incorrect response, we will send you email with order data.

    Request body

    Param Type Default value Description
    action string notification Request type
    id string (objectID) - Transaction id
    orderNumber string - Order id in your system
    customerNumber string - Customer id in your system
    currencyCode string - Transaction currency code
    shopAmount number - Transaction amount
    status string completed/failed Transaction status
    endDate string - Date of completion of the transaction
    signature string - MD5 string (id;orderNumber;customerNumber;amount;currencyCode;secretKey)
    requestDate string Date.now Date of request

    Users

    Get user by phone

    Correct answer:

    {
      "success": true,
      "user": {
        ...
      }
    }
    

    HTTP Request

    GET app.payqin.com/api/users/phone/:phone