Payop REST-like API Reference

The Payop API is organized around REST.

Payop API has predictable resource-oriented URLs, accepts JSON request bodies, returns JSON responses, and uses standard HTTP response codes.

Each request to Payop API should have Content-Type HTTP header with application/json value.

  1. API Response examples
  2. Authentication
  3. Checkout
  4. Invoice
  5. Transaction
  6. Withdrawal
  7. Refund

API Response examples

Successful response

Headers

HTTP/1.1 200 OK
Content-Type: application/json
Authorization: Bearer eyJ0eXAiO...

Body

{
    "data": {
        "id": "423131",
        "status": 1,
        "dateTime": {
            "createdAt": 1566543694,
            "updatedAt": null
        }
    },
    "status": 1
}

Each successful response this is JSON object with keys:

Key Type Description
data JSON object OR string Response data. Arbitrary structure object.
status Number Don't care about it. It's required for internal technical purposes

Note: "string" type for data this is not a feature, this is a bug. We are unable to change this in current api version, because of some integrations rely on it. But we will fix this in next API versions.


Failed responses

  • Invalid requests

    Headers

    HTTP/1.1 415 Unsupported Media Type
    Content-Type: application/json
    

    Body

    {
        "message": "Unsupported media type. Only json allowed"
    }
  • Validation fails

    Headers

    HTTP/1.1 422 Unprocessable Entity
    Content-Type: application/json
    

    Body

    {
        "message": {
            "email": [
                "This value should not be blank."
            ],
            "password": [
                "This value should not be blank."
            ]
        }
    }