General · Payments for Programmers

Payments for Programmers

General

200 words 1 minutes

This details the general usage of the PayFunc API.

URL

The PayFunc API is reachable at the following URL:

https://api.payfunc.com/

The same URL is used both for testing and for production. It is the API key that determines if you are using the system for testing or production.

Content Types

Requests should be done done using the following header:

Accept: application/json; charset=utf-8

Responses will come as UTF-8 encoded JSON:s with the following header:

Content-Type: application/json; charset=utf-8

Authentication

All request to the API except login requests to the me endpoint are done using the bearer authentication pattern.

Authorization: Bearer <your.api.key>

API keys always come in pairs of two:

  1. private Used for privileged access to the administration parts of the API.
  2. public Used for creating new orders from the end user’s browser.

The API keys determine whether you use the system in test or production mode.

Error Handling

Errors are returned as a response with a HTTP status of 400 or above. All but exceptional error messages will have the following content type:

Content-Type: application/json; charset=utf-8

The body will be a JSON encoded message like this:

{
    "status": 400,
    "type": "invalid content",
    "content": {
        "type": "model.Order.Creatable",
        "description": "A valid order to be created."
    }
}