NAV
shell python javascript

API Reference

The Gigapay API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded requests, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

API server

The demo version serves as a test environment for developers working to integrate with our API. No money flows through the demo environment.

Browsable API

Both the live and demo environment render a human-friendly HTML output for each resource, when the HTML format is requested by a web browser. This allows for easy browsing and interaction with the available resources. We strongly recommend you test our Browsable API before starting to integrate with our API, as it will give you a far more intuitive understanding of the API compared to reading this documentation.

Authentication

import requests

response = requests.get(
    'https://api.gigapay.se/v2/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/

fetch("https://api.gigapay.se/v2/", {
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

The Gigapay API uses API keys to identify and authenticate requests. You can request a key by contacting us at support@gigapay.se. Note that you will receive separate keys for the live and demo environment.

Your API keys carry many privileges, so make sure you keep them secure. Do not share your API keys in publicly accessible areas such as GitHub, client-side code, etc.

Authorization to the API is performed through a token-based HTTP Authentication scheme. To authorize requests, include your key in the Authorization HTTP header. Note that the API key should be prefixed by the string literal Token, with whitespace separating the two strings.

To specify which Integration you are acting as you need to provide the Integration-ID header.

Tokens

Replacing the above tokens with your own will add them to the provided code examples, making them executable.

Unauthenticated Requests

API requests without valid authentication will fail with the HTTP response code 401. If you are getting unexpected 401 responses, ensure that your URL is correct. API calls made over plain HTTP will be redirected with the response code 301, and API calls with incorrect placed / will be redirected with the response code 307 to the correct URL, and most HTTP clients will automatically follow the redirects while stripping out the authorization headers, resulting in the 401 response. Disable automated redirects or be mindful of this.

IP-whitelisting

The Gigapay API Supports IP-whitelisting. When requesting API-keys, let us know if you want to only allow access from certain IP addresses. If IP-whitelisting is enabled, API requests made from a non-whitelisted IP will be rejected with HTTP response code 403.

Language

import requests

response = requests.get(
    'https://api.gigapay.se/v2/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b',
        'Accept-Language': 'sv',
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -H "Accept-Language: en" https://api.gigapay.se/v2/

fetch("https://api.gigapay.se/v2/", {
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
    "Accept-Language": "sv",
  },
});

The default language of the API is English. This document is written assuming you have the language set to English. To change language set the Accept-Language header to your preferred language.

Events

An example Employee object with event timestamps:

{
  "id": "25d2af38-59b9-4f73-9452-51787fed5c84",
  "name": "Karl Karlsson",
  "cellphone_number": null,
  "email": "karl.karlsson@gmail.com",
  "metadata": {},
  "created_at": "2019-05-20T15:33:08.974624Z",
  "notified_at": "2019-05-20T15:33:12.581720Z",
  "claimed_at": "2019-05-21T09:13:32.575721Z",
  "verified_at": "2019-05-21T09:13:48.625263Z"
}

The Gigapay API is driven by actions taken by the parties involved in each Payout; the Client making the Payout, Gigapay facilitating it, and the Employee receiving it. The flowchart below illustrates each of these actions and the corresponding events.

Note that the Employee and Payout flow typically occur in parallel as the Employee is usually created when, or close in time to when, their first Payout is created.

All objects are timestamped when an associated event occurs. The field is simply the name of the event suffixed with _at.

Subscribing to Events

An example webhook for the Employee.verified event:

POST https://jobmatchr.se/webhooks/employees/ HTTP/1.1
Content-Type: application/json
Gigapay-Signature: t=1583327301,v1=ad583e2b2093c8d6fb3b65e04b99fc5988e98c0c312909acad334072da7e99ec
...

{
    "id": "25d2af38-59b9-4f73-9452-51787fed5c84",
    "name": "Karl Karlsson",
    "cellphone_number": null,
    "email": "karl.karlsson@gmail.com",
    "metadata": {
        "user_id": 3
    },
    "created_at": "2019-05-20T15:33:08.974624Z",
    "notified_at": "2019-05-20T15:33:12.581720Z",
    "claimed_at": "2019-05-21T09:13:32.575721Z"
    "verified_at": "2019-05-21T09:13:48.625263Z"
}

The Gigapay API allows you to register Webhooks in order to receive real-time updates on events related to your Gigapay account. They are optional, but the preferred way of monitoring the status of objects. We can send callbacks on the following events:

The notifications simply contain the object that triggered the event, as represented in the API.

Gigapay Signature

Example code to verify a Gigapay Signature:

secret_key = '...asId'

# If you're doing this in shell; parse the request manually:
timestamp='...'
signature='...'
body='...'

payload=${timestamp}.${body}

calculated_signature=$(echo -n $payload | openssl dgst -sha256 -hmac $secret_key)

if [ $signature == $calculated_signature ]; then
    ...
fi
import hmac

secret_key = '...asId'

t, v1 = request.headers['Gigapay-Signature'].split(',')
timestamp = t.split('=')[1]
signature = v1.split('=')[1]

payload = timestamp + '.' + request.body

hmac.new(secret_key.encode('utf-8'), digestmod='sha256')
hmac.update(payload.encode('utf-8'))
calculated_signature = hmac.hexdigest()

hmac.compare_digest(signature, calculated_signature)
import hmacSHA512 from "crypto-js/hmac-sha512";

let secret_key = "...asId";

let [t, v1] = request.get("Gigapay-Signature").split(",");
let timestamp = t.split("=")[1];
let signature = v1.split("=")[1];

let payload = timestamp + "." + request.body;

let calculated_signature = hmacSHA512(payload, secret_key);

calculated_signature === signature;

The notification is signed using the secret_key for the Webhooks, the signature is included in the notification as a Gigapay-Signature header. This allows you to verify that the events were sent by Gigapay, and not by a third party.

The signature consists of two parameters;

t, the timestamp of when the notification was sent, and;

v the signature of the current scheme.

The only valid signature scheme is currently v1, which is the HMAC algorithm as described in RFC 2104 using SHA256 as digestmod.

To verify signatures using the v1 scheme, extract the timestamp from the Gigapay-Signature header, and the JSON-encoded notification from the request body. Join these strings with a period, ., as a separator. Compute an HMAC with the SHA256 hash function using the Webhook’s secret key as the key. Lastly ensure that the signature in the header and the calculated signature matches.

Errors

HTTP/1.1 405 Method Not Allowed
Allow: GET, HEAD, OPTIONS
...

{"detail":"Method \"DELETE\" not allowed."}

Gigapay uses HTTP response codes to indicate whether an API request was successful. Codes in the 2XX range indicate success; codes in the 4XX range indicate that the request failed, given the information provided; codes in the 5XX range indicate an error with Gigapay's servers. Response codes in the 4XX range generally indicate a client error and will as such include information in the body of the response describing the cause of the error.

HTTP/1.1 400 Bad Request
...

{"description": ["This field may not be blank."]}

Validation errors returned on otherwise valid requests are structured differently. They will respond with the status code 400and include the field names as the keys in the response. If the validation error was not specific to a particular field then the non_field_errors key will be used.

Expanding objects

Request to retrieve a Payout object with the related Employee object expanded:

import requests

response = requests.get(
    'https://api.gigapay.se/v2/payouts/9472/?expand=employee',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' 'https://api.gigapay.se/v2/payouts/9472/?expand=employee'
fetch("https://api.gigapay.se/v2/payouts/9472/?expand=employee", {
  method: "GET",
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

Returns a response formatted as such:

{
  "id": "9472",
  "amount": "760.92",
  "cost": "1020.00",
  "currency": "SEK",
  "description": "Instagram samarbete 2021-11-13.",
  "employee": {
    "id": "1847",
    "name": "Albin Lindskog",
    "email": "albin@mail.com",
    "cellphone_number": "+46700000001",
    "country": "SWE",
    "metadata": {},
    "created_at": "2019-05-22T10:32:36.118753Z",
    "notified_at": null,
    "claimed_at": null,
    "verified_at": null
  },
  "invoice": "c1554d88-b74f-4d6a-bfa6-049c14905dc7",
  "invoiced_amount": "1000.00",
  "metadata": {
    "campaign_id": 12394
  },
  "start_at": null,
  "end_at": null,
  "created_at": "2019-05-23T10:32:38.118753Z",
  "notified_at": null,
  "accepted_at": null
}

Many objects contain the identifier of a related object in their response properties. For example, a Payout has an associated Employee identifier. Those objects can be expanded inline with the expand request parameter. Objects that can be expanded are noted in this documentation. You can use the expand param on any endpoint which includes expandable fields, including the create endpoints. You can expand multiple objects at once by repeating the expand request parameter.

Pagination

Request to retrieve two Employee objects per page, and the second page:

import requests

response = requests.get(
    'https://api.gigapay.se/v2/employees/?page_size=2&page=2',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' 'https://api.gigapay.se/v2/employees/?page_size=2&page=2'
fetch("https://api.gigapay.se/v2/employees/?page_size=2&page=2", {
  method: "GET",
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

Returns a response formatted as such:

{
  "count": 17,
  "next": "https://api.gigapay.se/v2/employees/?page=3",
  "previous": "https://api.gigapay.se/v2/employees/?page=1",
  "results": [
    {
      "id": "1f1d1263-0e79-4787-b573-6df81b44bfc2",
      "name": "Albin Lindskog",
      "cellphone_number": "+46703000000",
      "email": null,
      "metadata": {
        "user_id": 2
      },
      "created_at": "2019-05-20T15:33:08.974624Z",
      "notified_at": "2019-05-20T15:33:12.581720Z",
      "claimed_at": "2019-05-21T09:13:32.575721Z",
      "verified_at": "2019-05-21T09:13:48.625263Z"
    },
    {
      "id": "25d2af38-59b9-4f73-9452-51787fed5c84",
      "name": "Karl Karlsson",
      "cellphone_number": null,
      "email": "karl.karlsson@gmail.com",
      "metadata": {
        "user_id": 3
      },
      "created_at": "2019-05-20T15:33:08.974624Z",
      "notified_at": "2019-05-20T15:33:12.581720Z",
      "claimed_at": null,
      "verified_at": null
    }
  ]
}

The Gigapay API uses pagination on all of its list-endpoints. These endpoints all share a common structure, optionally accepting page and a page_size request parameter. page specifies which page to return and page_size the number of objects per page. The objects returned are contained within the result field of the response.

Filtering

Request to retrieve all non-accepted Payouts belonging to a specific Employee:

import requests

response = requests.get(
    'https://api.gigapay.se/v2/payouts/?employee=12&accepted_at_null=True',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' 'https://api.gigapay.se/v2/payouts/?employee=12&accepted_at_null=True'
fetch("https://api.gigapay.se/v2/payouts/?employee=12&accepted_at_null=True", {
  method: "GET",
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

Returns a response formatted as such:

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "0177270d-f94b-4ab9-88ba-ac1fa2f791aa",
      "amount": "100.00",
      "cost": "137.99",
      "currency": "SEK",
      "description": "Lön genom Gigapay",
      "employee": "12",
      "invoice": "bab4b830-47d6-4a24-a460-3289897f6e8e",
      "metadata": {},
      "start_at": null,
      "end_at": null,
      "created_at": "2019-05-22T10:32:38.118753Z",
      "notified_at": "2019-05-22T10:38:19.874623Z",
      "accepted_at": null
    }
  ]
}

Request to retrieve all employees with string "skoog" in name, email or phone number:

import requests

response = requests.get(
    'https://api.gigapay.se/v2/employees/?search=skoog',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' 'https://api.gigapay.se/v2/employees/?search=skoog'
fetch("https://api.gigapay.se/v2/employees/?search=skoog", {
  method: "GET",
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

Returns a response formatted as such:

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "59cc997d-b4bc-4b2d-ac2d-0101ea9ba241",
      "name": "Joakim Karlsson",
      "cellphone_number": "+46703100002",
      "email": "skoog@gigapay.co",
      "country": "SWE",
      "metadata": {},
      "created_at": "2022-04-11T13:05:27.565954Z",
      "notified_at": "2022-04-11T13:05:27.565954Z",
      "claimed_at": "2022-04-11T13:05:27.565954Z",
      "verified_at": "2022-04-11T14:05:27.565954Z"
    },
    {
      "id": "481c3138-5710-4086-9237-a082e87d624f",
      "name": "Joakim Skoog",
      "cellphone_number": "+46703100001",
      "email": "joakims@gigapay.co",
      "country": "SWE",
      "metadata": {},
      "created_at": "2022-04-11T13:05:27.543935Z",
      "notified_at": "2022-04-11T13:05:27.543935Z",
      "claimed_at": "2022-04-11T13:05:27.543935Z",
      "verified_at": "2022-04-11T14:05:27.543935Z"
    }
  ]
}

Request to retrieve all payouts to employees with string "skoog" in name, email or phone number or with string "skoog" in the description of the payout:

import requests

response = requests.get(
    'https://api.gigapay.se/v2/payouts/?search=skoog',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' 'https://api.gigapay.se/v2/payouts/?search=skoog'
fetch("https://api.gigapay.se/v2/payouts/?search=skoog", {
    method: "GET",
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
}

Returns a response formatted as such:

{
  "count": 3,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "bfdac591-4bc5-45d3-9e93-27a885c8b130",
      "cost": "1396.32",
      "invoiced_amount": "1368.95",
      "amount": "1000.00",
      "currency": "SEK",
      "description": "Test",
      "metadata": {},
      "start_at": null,
      "end_at": null,
      "created_at": "2022-04-14T08:31:11.773275Z",
      "notified_at": null,
      "accepted_at": null,
      "employee": {
        "id": "411246da-0b59-41c6-8b87-1e5abb73af30",
        "name": "Kalle Karlsson",
        "cellphone_number": "+46703100003",
        "email": "skoog@gigapay.co",
        "country": "SWE",
        "metadata": {},
        "created_at": "2022-04-14T08:31:11.741713Z",
        "notified_at": "2022-04-14T08:31:11.741713Z",
        "claimed_at": "2022-04-14T08:31:11.741713Z",
        "verified_at": "2022-04-14T09:31:11.741713Z"
      },
      "invoice": "f4377884-e4c0-4e65-bbd1-24f52973b933",
      "full_salary_specification": false
    },
    {
      "id": "1bc53e19-3589-4f92-aece-360006cfe196",
      "cost": "1396.32",
      "invoiced_amount": "1368.95",
      "amount": "1000.00",
      "currency": "SEK",
      "description": "Test",
      "metadata": {},
      "start_at": null,
      "end_at": null,
      "created_at": "2022-04-14T08:31:11.763167Z",
      "notified_at": null,
      "accepted_at": null,
      "employee": {
        "id": "411246da-0b59-41c6-8b87-1e5abb73af30",
        "name": "Kalle Karlsson",
        "cellphone_number": "+46703100003",
        "email": "skoog@gigapay.co",
        "country": "SWE",
        "metadata": {},
        "created_at": "2022-04-14T08:31:11.741713Z",
        "notified_at": "2022-04-14T08:31:11.741713Z",
        "claimed_at": "2022-04-14T08:31:11.741713Z",
        "verified_at": "2022-04-14T09:31:11.741713Z"
      },
      "invoice": "b749b0fd-a82a-4644-a7c8-e89ae891cc23",
      "full_salary_specification": false
    },
    {
      "id": "bf216a95-0560-46c8-b9c7-0d15850aea23",
      "cost": "1396.32",
      "invoiced_amount": "1368.95",
      "amount": "1000.00",
      "currency": "SEK",
      "description": "Test",
      "metadata": {},
      "start_at": null,
      "end_at": null,
      "created_at": "2022-04-14T08:31:11.755175Z",
      "notified_at": null,
      "accepted_at": null,
      "employee": {
        "id": "1fa40cc7-a2c9-43ab-972f-eb322bded992",
        "name": "Joakim Skoog",
        "cellphone_number": "+46703100002",
        "email": "joakim@gigapay.co",
        "country": "SWE",
        "metadata": {},
        "created_at": "2022-04-14T08:31:11.707438Z",
        "notified_at": "2022-04-14T08:31:11.707438Z",
        "claimed_at": "2022-04-14T08:31:11.707438Z",
        "verified_at": "2022-04-14T09:31:11.707438Z"
      },
      "invoice": "e5647953-4df7-4166-9066-f9dea11b66f3",
      "full_salary_specification": false
    }
  ]
}

The Gigapay API supports filtering on all of its list-endpoints. These filters are of two types, either relational filters or timestamp filters. Which filters are available are described under each endpoint.

Relational filters filter out all objects belonging to a specified object. They are use the format {field_name}={object_id}.

Timestamp filters are used to filter out objects having had a certain event associated with them. They can be used to filter on whether an event has occurred with the null suffix, e.g. {field_name}_null={Bool}, or when, by using the _before and _after suffix, e.g. {field_name}_before={ISO 8601 string}.

Idempotency

Registering an Employee with an idempotency key

import requests

response = requests.post(
    'https://api.gigapay.se/v2/employees/',
    json={
        'name': 'Albin Lindskog',
        'cellphone_number': '+4670000000',
        'country': 'SWE',
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Idempotency-Key': 'afjkakkknbkasaskkaksdakjdnsakja',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Idempotency-Key': 'afjkakkknbkasaskkaksdakjdnsakja' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"name": "Albin Lindskog", "cellphone_number": "+4670000001", "country": "SWE"}' https://api.gigapay.se/v2/employees/
fetch("https://api.gigapay.se/v2/employees/", {
  method: "POST",
  body: JSON.stringify({
    name: "Albin Lindskog",
    cellphone_number: "+4670000000",
    country: "SWE",
  }),
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Content-Type": "application/json",
    "Idempotency-Key": "afjkakkknbkasaskkaksdakjdnsakja",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

The Gigapay API supports idempotency to safely retry requests without accidentally performing the same operation twice. Gigapay offers two mechanism of idempotency; idempotency keys and object ids.

To perform an idempotent request using an idempotency-key, provide the additional Idempotency-Key header to the request. Idempotency keys works by storing the responses of previous requests. Subsequent requests with the same key return the same response, without performing the action specified in the request. Keys expire after 24 hours, so a new response is generated if a key is reused outside that timeframe.

Registering an Employee with a specific id

import requests

response = requests.post(
    'https://api.gigapay.se/v2/employees/',
    json={
        'id': 19472,
        'name': 'Albin Lindskog',
        'cellphone_number': '+4670000000',
        'country': 'SWE',
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Idempotency-Key': 'afjkakkknbkasaskkaksdakjdnsakja' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"id": 19472, "name": "Albin Lindskog", "cellphone_number": "+4670000001", "country": "SWE"}' https://api.gigapay.se/v2/employees/
fetch("https://api.gigapay.se/v2/employees/", {
  method: "POST",
  body: JSON.stringify({
    id: 19472,
    name: "Albin Lindskog",
    cellphone_number: "+4670000000",
    country: "SWE",
  }),
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Content-Type": "application/json",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

To perform an idempotent request using an object id simply specify the id when creating the object. Object ids ensure idempotency when creating object as no objects can have the same id. Subsequent requests with the same id will return an error. The uniqueness of an id is guaranteed for the lifetime of the object.

Metadata

Registering an Employee with metadata:

import requests

response = requests.post(
    'https://api.gigapay.se/v2/employees/',
    json={
        'name': 'Albin Lindskog',
        'cellphone_number': '+4670000000',
        'country': 'SWE',
        'metadata': {
            'user_id': 1847,
        },
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"name": "Albin Lindskog", "cellphone_number": "+4670000001", "country": "SWE", "metadata": {"user_id": 1847}}' https://api.gigapay.se/v2/employees/
fetch("https://api.gigapay.se/v2/employees/", {
  method: "POST",
  body: JSON.stringify({
    name: "Albin Lindskog",
    cellphone_number: "+4670000000",
    country: "SWE",
    metadata: {
      user_id: 1847,
    },
  }),
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Content-Type": "application/json",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

Response:

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Albin Lindskog",
  "email": null,
  "cellphone_number": "+46703000000",
  "country": "SWE",
  "metadata": {
    "user_id": 1847
  },
  "created_at": "2019-05-22T10:32:36.118753Z",
  "notified_at": null,
  "claimed_at": null,
  "verified_at": null
}

All objects in the Gigapay API have a metadata attribute. You can use this attribute to attach any JSON-serializable data to these objects. It is useful for storing additional information about an object. For example, you could store a unique identifier for an Employee in your system. This data is not used by Gigapay, and will not be displayed to any users.

The Payout object also has a description field. It should contain a human-readable description of why this Payout is being made. Unlike metadata, description is a single string, and the Employee will see it.

Integrations

Integrations are the parent object of all other objects in the Gigapay API. All other objects are separated per Integration, when operating on these objects you thus need to specify which integration you are acting as by providing the Integration-ID header.

There are three types of integrations:

The Integration object

An example Integration object:

{
    "id": "1",
    "name": "Zerebra AB",
    "type": 1,
    "logo": "https://gigapay.ams3.digitaloceanspaces.com/gigapay/zerebra_logo.png",
    "metadata": {},
    "email": "faktura@zerebra.com",
    "recipient": "Zerebra AB",
    "address_line_1": "Svartmangatan 18",
    "address_line_2": null,
    "zip_code": "11129"
}
Attribute Description
id Unique identifier for the object.
name Name of integration, presented to Employees.
type Type of integrations.
logo Image of logo to use, presented to Employees.
metadata JSON-encoded metadata.
email Email address to send invoices to.
recipient Name of recipient written on invoices.
address_line_1 Address line 1 written on invoices.
address_line_2 Address line 2 written on invoices.
zip_code Zip code written on invoices
city City written on invoices.

List All Integrations

import requests

response = requests.get(
    'https://api.gigapay.se/v2/integrations/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821'  https://api.gigapay.se/v2/integrations/
fetch("https://api.gigapay.se/v2/integrations/", {
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
    }
})

The above command returns JSON structured like this:

{
    "count": 4,
    "next": null,
    "previous": "https://api.gigapay.se/v2/integrations/?page=2",
    "results": [
        {
            "id": "1",
            "name": "Zerebra AB",
            "type": 1,
            "logo": "https://gigapay.ams3.digitaloceanspaces.com/gigapay/zerebra_logo.png",
            "metadata": {},
            "email": "faktura@zerebra.com",
            "recipient": "Zerebra AB",
            "address_line_1": "Svartmangatan 18",
            "address_line_2": null,
            "zip_code": "11129"
        }, {
            "id": "1",
            "name": "Zerebra AB Gig",
            "type": 3,
            "logo": "https://gigapay.ams3.digitaloceanspaces.com/gigapay/zerebra_logo.png",
            "metadata": {},
            "email": "faktura+gig@zerebra.com",
            "recipient": "Zerebra AB",
            "address_line_1": "Svartmangatan 18",
            "address_line_2": null,
            "zip_code": "11129"
        },
    ]
}

This endpoint retrieves all integrations.

HTTP Request

GET https://api.gigapay.se/v2/integrations/

Headers

Parameter Required Description
Authorization True Your Authorization Token.

Query Parameters

Parameter Default Description
page 1 Which page to return.
page_size 25 The number of Integrations per page.
type Filter based on type.

Create an Integration

import requests

response = requests.post(
    'https://api.gigapay.se/v2/integrations/',
    json={
        "address_line_1": "Malmvägen 8",
        "city": "Segeltorp",
        "email": "albin@pinestreet.tech",
        "id": "846291712",
        "logo": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=",
        "name": "Pinestreet Tech",
        "recipient": "Pinestreet Technology AB",
        "zip_code": "14171",
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -d '{"address_line_1": "Malmv\u00e4gen 8", "city": "Segeltorp", "email": "albin@pinestreet.tech", "id": "846291712", "logo": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=", "name": "Pinestreet Tech", "recipient": "Pinestreet Technology AB", "zip_code": "14171"}' https://api.gigapay.se/v2/integrations/```
fetch("https://api.gigapay.se/v2/integrations/", {
    method: "POST",
    body: JSON.stringify({
        address_line_1: "Malmvägen 8",
        city: "Segeltorp",
        email: "albin@pinestreet.tech",
        id: "846291712",
        logo: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=",
        name: "Pinestreet Tech",
        recipient: "Pinestreet Technology AB",
        zip_code: "14171",
    }),
    headers: {
        Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    },
})

The above command returns JSON structured like this:

{
    "id": "14585989-9a6c-4f05-b251-69e38e85d324",
    "name": "Pinestreet Tech",
    "type": 3,
    "logo": "https://gigapay.ams3.digitaloceanspaces.com/gigapay/pinestreet_logo.png",
    "metadata": {},
    "email": "albin@pinestreet.tech",
    "recipient": "Pinestreet Technology AB",
    "address_line_1": "Malmvägen 8",
    "address_line_2": null,
    "zip_code": "14171",
    "city": "Segeltorp"
}

This endpoint creates an Integration.

This endpoints supports both JSON and multipart/form-data encoded requests, to facilitate uploading a logo file.

Only examples with JSON-encoded payload and base64-encoded images are provided, though.

HTTP Request

POST https://api.gigapay.se/v2/integrations/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Idempotency-key False Idempotency key.

Body Parameters

Parameter Type Required Default Notes
id String False uuid4() Globally unique.
name String True
logo Image False null base64 or multipart/form-data encoded image file.
metadata Object False {}
email String True
recipient String True
address_line_1 Object True
address_line_2 String False null
zip_code String True
city String True

Retrieve an Integration

import requests

response = requests.get(
    'https://api.gigapay.se/v2/integrations/846291712/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821'  https://api.gigapay.se/v2/integrations/846291712/
fetch("https://api.gigapay.se/v2/integrations/846291712/", {
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
    }
})

The above command returns JSON structured like this:

{
    "id": "846291712",
    "name": "Pinestreet Tech",
    "type": 3,
    "logo": "https://gigapay.ams3.digitaloceanspaces.com/gigapay/pinestreet_logo.png",
    "metadata": {},
    "email": "albin@pinestreet.tech",
    "recipient": "Pinestreet Technology AB",
    "address_line_1": "Malmvägen 8",
    "address_line_2": null,
    "zip_code": "14171",
    "city": "Segeltorp"
}

This endpoint retrieves an Integration.

HTTP Request

GET https://api.gigapay.se/v2/integrations/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Update an Integration

import requests

response = requests.patch(
    'https://api.gigapay.se/v2/integrations/846291712/',
    json={
        'email': 'invoice@pinestreet.tech'
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
    }
)
curl -X PATCH -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -d '{"email": "invoice@pinestreet.tech"} https://api.gigapay.se/v2/integrations/846291712/
fetch("https://api.gigapay.se/v2/integrations/846291712/", {
    method: "PATCH",
    body: JSON.stringify({'email': 'invoice@pinestreet.tech'}),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
    },
})

The above command returns JSON structured like this:

{
    "id": "846291712",
    "name": "Pinestreet Tech",
    "type": 3,
    "logo": "https://gigapay.ams3.digitaloceanspaces.com/gigapay/pinestreet_logo.png",
    "metadata": {},
    "email": "albin@pinestreet.tech",
    "recipient": "Pinestreet Technology AB",
    "address_line_1": "Malmvägen 8",
    "address_line_2": null,
    "zip_code": "14171",
    "city": "Segeltorp"
}

This endpoint updates an integration. You may not update Integrations of type 2.

HTTP Request

PATCH https://api.gigapay.se/v2/integrations/:id/

This endpoints supports both JSON and multipart/form-data encoded requests, to facilitate uploading a logo file.

Only examples with JSON-encoded payload and base64-encoded images are provided, though.

Headers

Parameter Required Description
Authorization True Your Authorization Token.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Body Parameters

Parameter Type Required Default Notes
id String False Previous value Globally unique.
name String False Previous value
logo Image False Previous value base64 or multipart/form-data encoded image file.
metadata Object False Previous value
email String False Previous value
recipient String False Previous value
address_line_1 Object False Previous value
address_line_2 String False Previous value
zip_code String False Previous value
city String False Previous value

Replace an Integration

import requests

response = requests.put(
    'https://api.gigapay.se/v2/integrations/846291712/',
    json={
        "address_line_1": "Malmvägen 8",
        "city": "Segeltorp",
        "email": "albin@pinestreet.tech",
        "id": "846291712",
        "logo": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=",
        "name": "Pinestreet Tech",
        "recipient": "Pinestreet Technology AB",
        "zip_code": "14171",
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
    }
)
curl -X PUT -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -d '{"address_line_1": "Malmv\u00e4gen 8", "city": "Segeltorp", "email": "albin@pinestreet.tech", "id": "846291712", "logo": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=", "name": "Pinestreet Tech", "recipient": "Pinestreet Technology AB", "zip_code": "14171"}' https://api.gigapay.se/v2/integrations/846291712/```
fetch("https://api.gigapay.se/v2/integrations/846291712/", {
    method: "PUT",
    body: JSON.stringify({
        address_line_1: "Malmvägen 8",
        city: "Segeltorp",
        email: "albin@pinestreet.tech",
        id: "846291712",
        logo: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=",
        name: "Pinestreet Tech",
        recipient: "Pinestreet Technology AB",
        zip_code: "14171",
    }),
    headers: {
        Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    },
})

The above command returns JSON structured like this:

{
    "id": "846291712",
    "name": "Pinestreet Tech",
    "type": 3,
    "logo": "https://gigapay.ams3.digitaloceanspaces.com/gigapay/pinestreet_logo.png",
    "metadata": {},
    "email": "albin@pinestreet.tech",
    "recipient": "Pinestreet Technology AB",
    "address_line_1": "Malmvägen 8",
    "address_line_2": null,
    "zip_code": "14171",
    "city": "Segeltorp"
}

This endpoint replaces an Integration. You may not replace Integrations of type 2.

HTTP Request

PUT https://api.gigapay.se/v2/integrations/:id/

This endpoints supports both JSON and multipart/form-data encoded requests, to facilitate uploading a logo file.

Only examples with JSON-encoded payload and base64-encoded images are provided, though.

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.
Parameter Type Required Default Notes
id String False uuid4() Globally unique.
name String True
logo Image False null base64 or multipart/form-data encoded image file.
metadata Object False {}
email String True
recipient String True
address_line_1 Object True
address_line_2 String False null
zip_code String True
city String True

Delete an Integration

import requests

response = requests.delete(
    'https://api.gigapay.se/v2/integrations/846291712/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
    }
)
curl -X DELETE -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' https://api.gigapay.se/v2/integrations/846291712/
fetch("https://api.gigapay.se/v2/integrations/846291712/", {
    method: "DELETE",
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
    }
})

The above command returns an empty response.

This endpoint deletes an Integration. Note that you can not delete Integrations of type 1 or 2, nor Integrations that have objects associated with them.

HTTP Request

DELETE https://api.gigapay.se/v2/integrations/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Employees

An Employee is an individual performing tasks within your organization, employed or sub-contracted by Gigapay. To add an Employee to your organization you can create an Employee object. The Employee will be notified and Gigapay will verify their identity and working permits.

The Employee object

An example Employee object:

{
    "id": "1847",
    "name": "Albin Lindskog",
    "email": "albin@gigapay.co",
    "cellphone_number": "+46703000000",
    "country": "SWE",
    "metadata": {},
    "created_at": "2019-05-22T10:32:36.118753Z",
    "notified_at": "2019-05-22T10:32:37.846274Z",
    "claimed_at": "2019-05-23T11:56:41.123721Z",
    "verified_at": "2019-05-23T11:57:03.742345Z"
}
Attribute Description
id Unique identifier for the object.
name The full name of the Employee.
email Email address of the Employee.
country Employee's country of residence. ISO-3166 country code.
cellphone_number The Employees cellphone number, including country code.
metadata JSON-encoded metadata.
created_at Time at which the Employee was created at. Displayed as ISO 8601 string.
notified_at Time at which the Employee was notified. Displayed as ISO 8601 string.
claimed_at Time at which the Employee consumed the magic link. Displayed as ISO 8601 string.
verified_at Time when the Employee was verified. Displayed as ISO 8601 string.

List All Employees

import requests

response = requests.get(
    'https://api.gigapay.se/v2/employees/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/employees/
fetch("https://api.gigapay.se/v2/employees/", {
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "count": 4,
    "next": null,
    "previous": "https://api.gigapay.se/v2/employees/?page=2",
    "results": [
        {
            "id": "1847",
            "name": "Albin Lindskog",
            "email": "albin@gigapay.co",
            "cellphone_number": "+46703000000",
            "country": "SWE",
            "metadata": {},
            "created_at": "2019-05-22T10:32:36.118753Z",
            "notified_at": "2019-05-22T10:32:37.846274Z",
            "claimed_at": "2019-05-23T11:56:41.123721Z",
            "verified_at": "2019-05-23T11:57:03.742345Z"
        }, {
            "id": "1848",
            "name": "Joakim Olovsson",
            "email": "joakim@gigapay.co",
            "cellphone_number": "+46703000001",
            "country": "SWE",
            "metadata": {},
            "created_at": "2019-05-23T14:45:12.545271Z",
            "notified_at": "2019-05-23T14:45:13.374627Z",
            "claimed_at": "2019-05-23T14:45:37.282819Z",
            "verified_at": "2019-05-24T09:47:02.918264Z"
        }
    ]
}

This endpoint retrieves all Employees.

HTTP Request

GET https://api.gigapay.se/v2/employees/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

Query Parameters

Parameter Default Description
page 1 Which page to return.
page_size 25 The number of Employees per page.
created_at Timestamp filter.
notified_at Timestamp filter.
claimed_at Timestamp filter.
verified_at Timestamp filter.
search Filter by part of name, email or cellphone number.

Register an Employee

import requests

response = requests.post(
    'https://api.gigapay.se/v2/employees/',
    json={
        'id': 1847,
        'name': 'Albin Lindskog',
        'cellphone_number': '+4670000001',
        'email': 'albin@mail.com',
        'country': 'SWE'
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"id": 1847, "name": "Albin Lindskog", "cellphone_number": "+4670000001", "email": "albin@mail.com", "country": "SWE"}' https://api.gigapay.se/v2/employees/
fetch("https://api.gigapay.se/v2/employees/", {
    method: "POST",
    body: JSON.stringify({
        name: "Albin Lindskog",
        cellphone_number: "+4670000000",
        email: "albin@mail.com",
        country: "SWE"
    }),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "id": "14585989-9a6c-4f05-b251-69e38e85d324",
    "name": "Albin Lindskog",
    "email": "albin@gigapay.co",
    "cellphone_number": "+46703000000",
    "country": "SWE",
    "metadata": {},
    "created_at": "2019-05-22T10:32:36.118753Z",
    "notified_at": null,
    "claimed_at": null,
    "verified_at": null
}

This endpoint registers an Employee.

HTTP Request

POST https://api.gigapay.se/v2/employees/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

Body Parameters

Parameter Type Required Default Notes
id String False uuid4() Unique per Integration.
name String True
email String True
country String True ISO-3166 country code where the employee is living and working.
cellphone_number String False null
metadata Object False {}

Retrieve an Employee

import requests

response = requests.get(
    'https://api.gigapay.se/v2/employees/1847/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/employees/1847/
fetch("https://api.gigapay.se/v2/employees/1847/", {
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "id": "1847",
    "name": "Albin Lindskog",
    "email": "albin@gigapay.co",
    "cellphone_number": "+46703000000",
    "country": "SWE",
    "metadata": {},
    "created_at": "2019-05-22T10:32:36.118753Z",
    "notified_at": "2019-05-22T10:32:37.846274Z",
    "claimed_at": "2019-05-23T11:56:41.123721Z",
    "verified_at": "2019-05-23T11:57:03.742345Z"
}

This endpoint retrieves an employee.

HTTP Request

GET https://api.gigapay.se/v2/employees/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Update an Employee

import requests

response = requests.patch(
    'https://api.gigapay.se/v2/employees/1847/',
    json={
        'id': 8472,
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X PATCH -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"id": 8472}' https://api.gigapay.se/v2/employees/1847/
fetch("https://api.gigapay.se/v2/employees/1847/", {
    method: "PATCH",
    body: JSON.stringify({id: 8472}),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    },
})

The above command returns JSON structured like this:

{
    "id": "8472",
    "name": "Albin Lindskog",
    "email": "albin@gigapay.co",
    "cellphone_number": "+46703000000",
    "country": "SWE",
    "metadata": {},
    "created_at": "2019-05-22T10:32:36.118753Z",
    "notified_at": "2019-05-22T10:32:37.846274Z",
    "claimed_at": "2019-05-23T11:56:41.123721Z",
    "verified_at": "2019-05-23T11:57:03.742345Z"
}

This endpoint updates an Employee.

HTTP Request

PATCH https://api.gigapay.se/v2/employees/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Body Parameters

Parameter Type Required Default Notes
id String False Previous value. Unique per Integration.
name String False Previous value.
email String False Previous value.
country String False Previous value. ISO-3166 country code where the employee is living and working.
cellphone_number False False Previous value.
metadata Object False Previous value.

Replace an Employee

import requests

response = requests.put(
    'https://api.gigapay.se/v2/employees/8472/',
    json={
        'id': 1847,
        'name': 'Albin Lindskog',
        'cellphone_number': '+4670000001',
        'email': 'albin@mail.com',
        'country': 'SWE'
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X PUT -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"id": 1847, "name": "Albin Lindskog", "cellphone_number": "+4670000001", "email": "albin@mail.com", "country": "SWE"}' https://api.gigapay.se/v2/employees/8472/
fetch("https://api.gigapay.se/v2/employees/8472/", {
    method: "PUT",
    body: JSON.stringify({
        id: 1847,
        name: "Albin Lindskog",
        cellphone_number: "+4670000000",
        email: "albin@mail.com",
        country: "SWE"
    }),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "id": "1847",
    "name": "Albin Lindskog",
    "email": "albin@gigapay.co",
    "cellphone_number": "+46703000000",
    "country": "SWE",
    "metadata": {},
    "created_at": "2019-05-22T10:32:36.118753Z",
    "notified_at": null,
    "claimed_at": null,
    "verified_at": null
}

This endpoint replaces an Employee.

HTTP Request

PUT https://api.gigapay.se/v2/employees/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Body Parameters

Parameter Type Required Default Description
id String False uuid4() Unique per Integration.
name String True
email String True
country String True ISO-3166 country code where the employee is living and working.
cellphone_number String False null
metadata Object False {}

Delete a Employee

import requests

response = requests.delete(
    'https://api.gigapay.se/v2/employees/1847/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X DELETE -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/employees/1847/
fetch("https://api.gigapay.se/v2/employees/1847/", {
    method: "DELETE",
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns an empty response.

This endpoint deletes an Employee. You can not delete an Employee after a Payout has been registered to it.

HTTP Request

DELETE https://api.gigapay.se/v2/employees/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Resend an Invitation

import requests

response = requests.patch(
    'https://api.gigapay.se/v2/employees/1847/resend/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b',
        'Idempotency-key': 'ac4beffd-79b0-4561-b16c-846a9600b168'
    }
)
curl -X PATCH -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -H 'Idempotency-key: ac4beffd-79b0-4561-b16c-846a9600b168' https://api.gigapay.se/v2/employees/1847/resend/
fetch("https://api.gigapay.se/v2/employees/1847/resend/", {
    method: "PATCH",
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
        "Idempotency-key": "ac4beffd-79b0-4561-b16c-846a9600b168"
    }
})

The above command returns an empty response.

This endpoint resends an invitation. After resending, you need to wait at least 24 hours before resending again.

HTTP Request

PATCH https://api.gigapay.se/v2/employees/:id/resend/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Messages

A Message is a one way communication object between the Integration and its Employee objects.

To issue a message to an employee or multiple employees, you can create a Message object and include a list of employees that should receive it.

Once the Message object is created, the relevant Employees will see it in the gigapay app in their home view.

The Message object

An example Message object:

{
  "id": "3d5356ee-6943-4d10-8060-967d3180b79d",
  "employees": [
    "9c9c19a6-bb64-4c53-8dc1-516033390092",
    "a5384a47-ee2b-4a5e-be29-969fac195be7"
  ],
  "content": "The February payment is delayed",
  "created_at": "2024-03-22T10:32:36.118753Z"
}
Attribute Description
id Unique identifier for the object.
employees A list of employees that will see the Message content.
content The Message content to be displayed to the employees.
created_at Time at which the Message was created at. Displayed as ISO 8601 string.

List All Messages

import requests

response = requests.get(
    'https://api.gigapay.se/v2/messages/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/messages/
fetch("https://api.gigapay.se/v2/messages/", {
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

The above command returns JSON structured like this:

{
  "count": 4,
  "next": null,
  "previous": "https://api.gigapay.se/v2/messages/?page=2",
  "results": [
    {
      "id": "2a241017-80af-467a-a3e1-50a6321a2adc",
      "created_at": "2024-03-27T08:34:32.802625Z",
      "employees": [
        "9119e535-ef85-4a0e-a7ba-d46dddd58c3b",
        "fafef424-cf39-4ada-a8a1-8b085738d64a"
      ],
      "content": "January payment is underway"
    },
    {
      "id": "f9a57847-5d28-43dc-a748-365f6d487084",
      "created_at": "2024-03-27T08:35:05.070901Z",
      "employees": [
        "74fb03a0-d890-45fc-972b-8562b8d9acbe",
        "ee6100b2-7d80-4c1d-b251-19e961f7fc9f",
        "ba6162b0-e949-44c4-92ec-f65cc3f64a8c",
        "56a34d0e-068f-4f56-9663-a36095751b9b"
      ],
      "content": "Your application is incomplete"
    }
  ]
}

This endpoint retrieves all Messages.

HTTP Request

GET https://api.gigapay.se/v2/messages/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

Query Parameters

Parameter Default Description
page 1 Which page to return.
page_size 25 The number of Messages per page.

Create a Message

import requests

response = requests.post(
    'https://api.gigapay.se/v2/messages/',
    json={
        'employees': ['74fb03a0-d890-45fc-972b-8562b8d9acbe'],
        'content': 'Payment in progress',
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"employees": ["74fb03a0-d890-45fc-972b-8562b8d9acbe"], "content": "Payment in progress"}' https://api.gigapay.se/v2/messages/
fetch("https://api.gigapay.se/v2/messages/", {
  method: "POST",
  body: JSON.stringify({
    employees: ["74fb03a0-d890-45fc-972b-8562b8d9acbe"],
    content: "Payment in progress",
  }),
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Content-Type": "application/json",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

The above command returns JSON structured like this:

{
  "id": "e9e3c146-83d9-4080-b719-091719d90629",
  "employees": ["74fb03a0-d890-45fc-972b-8562b8d9acbe"],
  "content": "Payment in progress",
  "created_at": "2024-03-22T10:32:36.118753Z"
}

This endpoint creates a Message.

HTTP Request

POST https://api.gigapay.se/v2/messages/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

Body Parameters

Parameter Type Required Notes
employees List True A list of employee ids
content String True The Message content to be displayed to the employees.

Retrieve a Message

import requests

response = requests.get(
    'https://api.gigapay.se/v2/messages/e9e3c146-83d9-4080-b719-091719d90629/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/messages/e9e3c146-83d9-4080-b719-091719d90629/
fetch(
  "https://api.gigapay.se/v2/message/e9e3c146-83d9-4080-b719-091719d90629/",
  {
    headers: {
      Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
      "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
    },
  },
);

The above command returns JSON structured like this:

{
  "id": "e9e3c146-83d9-4080-b719-091719d90629",
  "employees": ["74fb03a0-d890-45fc-972b-8562b8d9acbe"],
  "content": "Payment in progress",
  "created_at": "2024-03-22T10:32:36.118753Z"
}

This endpoint retrieves a Message.

HTTP Request

GET https://api.gigapay.se/v2/messages/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Update a Message

import requests

response = requests.patch(
    'https://api.gigapay.se/v2/messages/e9e3c146-83d9-4080-b719-091719d90629/',
    json={
        'content': 'Correction: payment is delayed by 1 day',
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X PATCH -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"content": "Correction: payment is delayed by 1 day"}' https://api.gigapay.se/v2/messages/e9e3c146-83d9-4080-b719-091719d90629/
fetch(
  "https://api.gigapay.se/v2/messages/e9e3c146-83d9-4080-b719-091719d90629/",
  {
    method: "PATCH",
    body: JSON.stringify({
      content: "Correction: payment is delayed by 1 day",
    }),
    headers: {
      Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
      "Content-Type": "application/json",
      "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
    },
  },
);

The above command returns JSON structured like this:

{
  "id": "e9e3c146-83d9-4080-b719-091719d90629",
  "employees": ["74fb03a0-d890-45fc-972b-8562b8d9acbe"],
  "content": "Correction: payment is delayed by 1 day",
  "created_at": "2024-03-22T10:32:36.118753Z"
}

This endpoint updates a Message.

HTTP Request

PATCH https://api.gigapay.se/v2/messages/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Body Parameters

Parameter Type Required Notes
employees List False A list of employee ids
content String False The Message content to be displayed to the employees.

Replace a Message

import requests

response = requests.put(
    'https://api.gigapay.se/v2/messages/8472/',
    json={
      'employees': ['74fb03a0-d890-45fc-972b-8562b8d9acbe', '696f4143-1579-4352-9e9c-a0cf09df7b3f'],
      'content': 'Payment 664 and 566 in progress',
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X PUT -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"employees": ["74fb03a0-d890-45fc-972b-8562b8d9acbe", "696f4143-1579-4352-9e9c-a0cf09df7b3f"],"content": "Payment 664 and 566 in progress"}' https://api.gigapay.se/v2/messages/8472/
fetch("https://api.gigapay.se/v2/messages/8472/", {
  method: "PUT",
  body: JSON.stringify({
    employees: [
      "74fb03a0-d890-45fc-972b-8562b8d9acbe",
      "696f4143-1579-4352-9e9c-a0cf09df7b3f",
    ],
    content: "Payment 664 and 566 in progress",
  }),
  headers: {
    Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Content-Type": "application/json",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
  },
});

The above command returns JSON structured like this:

{
  "id": "e9e3c146-83d9-4080-b719-091719d90629",
  "employees": [
    "74fb03a0-d890-45fc-972b-8562b8d9acbe",
    "696f4143-1579-4352-9e9c-a0cf09df7b3f"
  ],
  "content": "Payment 664 and 566 in progress",
  "created_at": "2024-03-23T10:32:36.118753Z"
}

This endpoint replaces a Message.

HTTP Request

PUT https://api.gigapay.se/v2/messages/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Body Parameters

Parameter Type Required Description
employees List True A list of employee ids
content String True The Message content to be displayed to the employees.

Delete a Message

import requests

response = requests.delete(
    'https://api.gigapay.se/v2/messages/e9e3c146-83d9-4080-b719-091719d90629/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X DELETE -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/messages/e9e3c146-83d9-4080-b719-091719d90629/
fetch(
  "https://api.gigapay.se/v2/messages/e9e3c146-83d9-4080-b719-091719d90629/",
  {
    method: "DELETE",
    headers: {
      Authorization: "Token cd7a4537a231356d404b553f465b6af2fa035821",
      "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
    },
  },
);

The above command returns an empty response.

This endpoint deletes a Message.

HTTP Request

DELETE https://api.gigapay.se/v2/messages/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Payouts

To make a payout to an Employee you need to create a Payout object. The Employee is notified of the Payout once the corresponding Invoice is paid. The Employee will need to sign and accept the Payout before it is disbursed to their account.

Either amount, invoiced_amount or cost is used as a basis for the Payout. For their definition and how they are related see Pricing. Ensure that you are using the same definition when communicating with the recipient to align everyone's expectation.

The Payout object

An example Payout object:

{
    "id": "0177270d-f94b-4ab9-88ba-ac1fa2f791aa",
    "amount": "100.00",
    "cost": "137.99",
    "currency": "SEK",
    "description": "Lön genom Gigapay",
    "employee": "1f1d1263-0e79-4787-b573-6df81b44bfc2",
    "invoice": "bab4b830-47d6-4a24-a460-3289897f6e8e",
    "metadata": {},
    "start_at": null,
    "end_at": null,
    "created_at": "2019-05-22T10:32:38.118753Z",
    "notified_at": "2019-05-22T10:38:19.874623Z",
    "accepted_at": null
}
Attribute Description
id Unique identifier for the object.
amount Decimal formatted string of the gross salary amount.
invoiced_amount Decimal formatted string of the invoiced amount.
cost Decimal formatted string of the total salary cost.
currency ISO-4217 currency code.
description String describing the work done, displayed to the recipient. Max 255 characters.
full_salary_specification Controls whether to present the payroll taxes and Gigapay's fee on the payslip. It is set to false when amount is used as a basis for the Payout, true otherwise.
employee Unique identifier for the Employee object, that is the recipient of the Payout. This is an expandable object.
invoice Unique identifier for the Invoice object the Payout object belongs to. This is an expandable object.
metadata JSON-encoded metadata.
start_at The time at which the gig will start. Displayed as ISO 8601 string.
end_at The time at which the gig will end. Displayed as ISO 8601 string.
created_at The time at which the Payout was created at. Displayed as ISO 8601 string.
notified_at The time at which the Employee was notified of the Payout. Displayed as ISO 8601 string.
accepted_at The time at which the Employee accepted the Payout. Displayed as ISO 8601 string.

List All Payouts

import requests

response = requests.get(
    'https://api.gigapay.se/v2/payouts/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/payouts/
fetch("https://api.gigapay.se/v2/payouts/", {
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "count": 4,
    "next": null,
    "previous": "https://api.gigapay.se/v2/payouts/?page=1",
    "results": [
        {
            "id": "0177270d-f94b-4ab9-88ba-ac1fa2f791aa",
            "amount": "100.00",
            "cost": "137.99",
            "currency": "SEK",
            "description": "Lön genom Gigapay",
            "employee": "1f1d1263-0e79-4787-b573-6df81b44bfc2",
            "invoice": "bab4b830-47d6-4a24-a460-3289897f6e8e",
            "metadata": {
                "job_id": 127
            },
            "start_at": null,
            "end_at": null,
            "created_at": "2019-05-22T10:32:38.118753Z",
            "notified_at": "2019-05-22T10:38:19.874623Z",
            "accepted_at": null
        }, {
            "id": "8a726186-a4e4-42e0-b56e-20fd17dc67ba",
            "amount": "10.00",
            "cost": "13.79",
            "currency": "SEK",
            "description": "Lön genom Gigapay",
            "employee": "1f1d1263-0e79-4787-b573-6df81b44bfc2",
            "invoice": "c1554d88-b74f-4d6a-bfa6-049c14905dc7",
            "metadata": {
              "job_id": 128
            },
            "start_at": "2019-05-22T08:00:00.000000Z",
            "end_at": "2019-05-22T17:00:00.000000Z",
            "created_at": "2019-05-23T10:32:38.118753Z",
            "notified_at": "2019-05-23T11:46:29.298742Z",
            "accepted_at": "2019-05-23T12:02:16.472846Z"
        }
    ]
}

This endpoint retrieves all Payouts.

HTTP Request

GET https://api.gigapay.se/v2/payouts/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

Query Parameters

Parameter Default Description
page 1 Which page to return.
page_size 25 The number of Employees per page.
invoice Relational Filter.
employee Relational Filter.
start_at Timestamp filter.
end_at Timestamp filter.
created_at Timestamp filter.
notified_at Timestamp filter.
accepted_at Timestamp filter.
search Find payout by searching for part of payout description or employee: name, cellphone number, email.

Register a Payout

import requests

response = requests.post(
    'https://api.gigapay.se/v2/payouts/',
    json={
        'id': 9472,
        'currency': 'SEK',
        'description': 'Instagram samarbete 2021-11-13.',
        'employee': 1847,
        'invoiced_amount': '1000.00',          
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b'  -d '{"id": 9472, "currency": "SEK", "description": "Instagram samarbete 2021-11-13.", "employee": 1847, "invoiced_amount": "1000.00"}' https://api.gigapay.se/v2/payouts/
fetch("https://api.gigapay.se/v2/payouts/", {
    method: "POST",
    body: JSON.stringify({
        id: 9472,
        currency: 'SEK',
        description: 'Instagram samarbete 2021-11-13.',
        employee: 1847,
        invoiced_amount: '1000.00',       
    }),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "id": "9472",
    "amount": "760.92",
    "cost": "1020.00",
    "currency": "SEK",
    "description": "Lön genom Gigapay",
    "employee": "1847",
    "full_salary_specification": true,
    "invoice": "c1554d88-b74f-4d6a-bfa6-049c14905dc7",
    "invoiced_amount": "1000.00",
    "metadata": {},
    "start_at": null,
    "end_at": null,
    "created_at": "2019-05-23T10:32:38.118753Z",
    "notified_at": null,
    "accepted_at": null
}

This endpoint registers a payout.

HTTP Request

POST https://api.gigapay.se/v2/payouts/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

Body Parameters

Parameter Type Required Default Notes
id String False uuid4() Unique per Integration.
amount String False Either amount, invoiced_amount or cost is required.
cost String False Either amount, invoiced_amount or cost is required.
currency String True
description String True
employee String True
invoiced_amount String True Either amount, invoiced_amount or cost is required.
metadata Object False
start_at String False
end_at String False null

Register multiple Payouts

import requests

response = requests.post(
    'https://api.gigapay.se/v2/payouts/',
    json=[
        {
            'id': 9472,
            'currency': 'SEK',
            'description': 'Instagram samarbete 2021-11-13.',
            'employee': 1847,
            'invoiced_amount': '1000.00',
            'metadata': {},            
        }, {
            'id': 9473,
            'currency': 'SEK',
            'description': 'Instagram samarbete 2021-11-13.',
            'employee': 1736,
            'invoiced_amount': '2500.00',
            'metadata': {},            
        },
    ],
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '[{"id": 9472, "currency": "SEK", "description": "Instagram samarbete 2021-11-13.", "employee": 1847, "invoiced_amount": "1000.00"}, {"id": 9473, "currency": "SEK", "description": "Instagram samarbete 2021-11-13.", "employee": 1736, "invoiced_amount": "2500.00"}]' https://api.gigapay.se/v2/payouts/
fetch("https://api.gigapay.se/v2/payouts/", {
    method: "POST",
    body: JSON.stringify([
        {
            'id': 9472,
            'currency': 'SEK',
            'description': 'Instagram samarbete 2021-11-13.',
            'employee': 1847,
            'invoiced_amount': '1000.00',
            'metadata': {},            
        }, {
            'id': 9473,
            'currency': 'SEK',
            'description': 'Instagram samarbete 2021-11-13.',
            'employee': 1736,
            'invoiced_amount': '2500.00',
            'metadata': {},            
        },
    ]),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

[
    {
        "id": "9472",
        "amount": "760.92",
        "cost": "1020.00",
        "currency": "SEK",
        "description": "Instagram samarbete 2021-11-13.",
        "employee": "1847",
        "full_salary_specification": true,
        "invoice": "c1554d88-b74f-4d6a-bfa6-049c14905dc7",
        "invoiced_amount": "1000.00",
        "metadata": {},
        "start_at": null,
        "end_at": null,
        "created_at": "2019-05-23T10:32:38.118753Z",
        "notified_at": null,
        "accepted_at": null
    }, {
        "id": "9473",
        "amount": "1902.31",
        "cost": "2550.00",
        "currency": "SEK",
        "description": "Instagram samarbete 2021-11-13.",
        "employee": "1736",
        "full_salary_specification": true,
        "invoice": "c1554d88-b74f-4d6a-bfa6-049c14905dc7",
        "invoiced_amount": "2500.00",
        "metadata": {},
        "start_at": null,
        "end_at": null,
        "created_at": "2019-05-23T10:32:38.118812Z",
        "notified_at": null,
        "accepted_at": null
    }
]

This endpoint registers multiple Payouts at once. All payouts will be added to the same Invoice object.

HTTP Request

POST https://api.gigapay.se/v2/payouts/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

Body Parameters

Type Required Default Notes
Payout[] True Elements of array structured as Payout.

Register a Payout with an inline Employee

import requests

response = requests.post(
    'https://api.gigapay.se/v2/payouts/?expand=employee',
    json={
        'id': 9472,
        'currency': 'SEK',
        'description': 'Instagram samarbete 2021-11-13.',
        'employee': {
            'id': 1847,
            'name': 'Albin Lindskog',
            'cellphone_number': '+4670000001',
            'email': 'albin@mail.com',
            'country': 'SWE'
        },
        'invoiced_amount': '1000.00',         
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"id": 9472, "currency": "SEK", "description": "Instagram samarbete 2021-11-13.", "employee": {"id": 1847, "name": "Albin Lindskog", "cellphone_number": "+4670000001", "email": "albin@mail.com", "country": "SWE"}, "invoiced_amount": "1000.00"}' 'https://api.gigapay.se/v2/payouts/?expand=employee'
fetch("https://api.gigapay.se/v2/payouts/?expand=employee", {
    method: "POST",
    body: JSON.stringify({
        id: 9472,
        currency: 'SEK',
        description: 'Instagram samarbete 2021-11-13.',
        employee: {
            id: 1847,
            name: 'Albin Lindskog',
            cellphone_number: '+4670000001',
            email: 'albin@mail.com',
            country: 'SWE'
        },
        invoiced_amount: '1000.00',       
    }),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "id": "9472",
    "amount": "760.92",
    "cost": "1020.00",
    "currency": "SEK",
    "description": "Instagram samarbete 2021-11-13.",
    "employee": {
        "id": "1847",
        "name": "Albin Lindskog",
        "email": "albin@mail.com",
        "cellphone_number": "+46700000001",
        "country": "SWE",
        "metadata": {},
        "created_at": "2019-05-22T10:32:36.118753Z",
        "notified_at": null,
        "claimed_at": null,
        "verified_at": null
    },
    "full_salary_specification": true,
    "invoice": "c1554d88-b74f-4d6a-bfa6-049c14905dc7",
    "invoiced_amount": "1000.00",
    "metadata": {
        "campaign_id": 12394
    },
    "start_at": null,
    "end_at": null,
    "created_at": "2019-05-23T10:32:38.118753Z",
    "notified_at": null,
    "accepted_at": null
}

This endpoint registers a Payout and an Employee at the same time. If an Employee with matching information is already registered that object will be reused.

HTTP Request

POST https://api.gigapay.se/v2/payouts/?expand=employee

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

Body Parameters

Parameter Type Required Default Notes
id String False uuid4() Unique per Integration.
amount String False Either amount, invoiced_amount or cost is required.
cost String False Either amount, invoiced_amount or cost is required.
currency String True
description String True
employee Object True Structured as an Employee.
invoiced_amount String True Either amount, invoiced_amount or cost is required.
metadata Object False
start_at String False
end_at String False null

Retrieve a Payout

import requests

response = requests.get(
    'https://api.gigapay.se/v2/payouts/9472/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/payouts/9472/
fetch("https://api.gigapay.se/v2/payouts/9472/", {
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "id": "9472",
    "amount": "760.92",
    "cost": "1020.00",
    "currency": "SEK",
    "description": "Lön genom Gigapay",
    "employee": "1847",
    "full_salary_specification": true,
    "invoice": "c1554d88-b74f-4d6a-bfa6-049c14905dc7",
    "invoiced_amount": "1000.00",
    "metadata": {
        "campaign_id": 12394
    },
    "start_at": "2019-05-22T08:00:00.000000Z",
    "end_at": "2019-05-22T17:00:00.000000Z",
    "created_at": "2019-05-23T10:32:38.118753Z",
    "notified_at": "2019-05-23T11:46:29.298742Z",
    "accepted_at": "2019-05-23T12:02:16.472846Z"
}

This endpoint retrieves a payout.

HTTP Request

GET https://api.gigapay.se/v2/payouts/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Delete a Payout

import requests

response = requests.delete(
    'https://api.gigapay.se/v2/payouts/9472/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X DELETE -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/payouts/9472/
fetch("https://api.gigapay.se/v2/payouts/9472/", {
    method: "DELETE",
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns an empty response.

Endpoint for deleting a specific Payout. Note that you can not delete a payout belonging to a paid Invoice or an Invoice on credit.

HTTP Request

DELETE https://api.gigapay.se/v2/payouts/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Resend a Notification

import requests

response = requests.put(
    'https://api.gigapay.se/v2/payouts/9472/resend/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b',
        'Idempotency-key': 'ac4beffd-79b0-4561-b16c-846a9600b168'
    }
)
curl -X PUT -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -H 'Idempotency-key: ac4beffd-79b0-4561-b16c-846a9600b168' https://api.gigapay.se/v2/payouts/9472/resend/
fetch("https://api.gigapay.se/v2/payouts/9472/resend/", {
    method: "PUT",
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b",
        "Idempotency-key": "ac4beffd-79b0-4561-b16c-846a9600b168"
    }
})

The above command returns an empty response.

This endpoint resends a notification. After resending, you need to wait at least 24 hours before resending again.

HTTP Request

PATCH https://api.gigapay.se/v2/payouts/:id/resend/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Pricing

The Pricing endpoint allows you to calculate the price of payout you would like to make, and to retrieve the price information about previously made payouts. The endpoint is designed to mirror the Payouts endpoint as closely as possible, e.g. the same request can be used to retrieve the price information of a Payout you'd like to make and to actually make it.

The Pricing breakdown

An example Pricing breakdown for a Payout:

{
  "amount": "1000.00",
  "cost": "1379.91",
  "currency": "SEK",
  "fee": "65.71",
  "health_insurance": null,
  "invoiced_amount": "1314.20",
  "payroll": "314.20",
  "pension": null,
  "tax": "300.00",
  "vat": "344.97"
}
Attribute Description
amount Decimal formatted string of the gross salary amount.
invoiced_amount Decimal formatted string of the invoiced amount.
cost Decimal formatted string of the total salary cost.
currency ISO-4217 currency code.
fee Decimal formatted string of Gigapay's fee for this Payout.
health_insurance Decimal formatted string of the cost of mandated health insurance. Will be none if health insurance is not mandated.
payroll Decimal formatted string of the payroll taxes. Will be none if payroll taxes are not mandated.
pension Decimal formatted string of the cost of mandated pension. Will be none if pension is not mandated.
tax Decimal formatted string of the preliminary income taxes the will be reported and paid on behalf of the recipient.
vat Decimal formatted string of the VAT for the Payout.

Either amount, invoiced_amount or cost is used as a basis for calculating the Pricing breakdown. One is provided and the other are calculated based on that. Their definitions are:

Which of the attributes that are included and in what step varies between countries. Examples of what the pricing looks like in each country are provided.

List Pricing info

import requests

response = requests.get(
    'https://api.gigapay.se/v2/pricing/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/pricing/
fetch("https://api.gigapay.se/v2/pricing/", {
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "count": 4,
    "next": null,
    "previous": "https://api.gigapay.se/v2/pricing/?page=1",
    "results": [
        {
           "amount": "1000.00",
           "cost": "1379.91",
           "currency": "SEK",
           "fee": "65.71",
           "health_insurance": null,
           "invoiced_amount": "1314.20",
           "payroll": "314.20",
           "pension": null,
           "tax": "300.00",
           "vat": "344.97"
        }, {
           "amount": "3000.00",
           "cost": "4139.73",
           "currency": "SEK",
           "fee": "197.13",
           "health_insurance": null, 
           "invoiced_amount": "3942.60",
           "payroll": "942.60",
           "pension": null,
           "tax": "900.00",
           "vat": "1034.93"
        }
   ]
}

List Pricing info for past Payouts.

HTTP Request

GET https://api.gigapay.se/v2/pricing/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

Query Parameters

Parameter Default Description
page 1 Which page to return.
page_size 25 The number of Employees per page.
invoice Relational Filter.
employee Relational Filter.
start_at Timestamp filter.
end_at Timestamp filter.
created_at Timestamp filter.
notified_at Timestamp filter.
accepted_at Timestamp filter.

Calculate Pricing info

import requests

response = requests.post(
    'https://api.gigapay.se/v2/pricing/',
    json={
        'id': 9472,
        'currency': 'SEK',
        'description': 'Instagram samarbete 2021-11-13.',
        'full_salary_specification': True,
        'employee': 1847,
        'invoiced_amount': '1000.00',          
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b'  -d '{"id": 9472, "currency": "SEK", "description": "Instagram samarbete 2021-11-13.", "full_salary_specification": true, "employee": 1847, "invoiced_amount": "1000.00"}' https://api.gigapay.se/v2/pricing/
fetch("https://api.gigapay.se/v2/pricing/", {
    method: "POST",
    body: JSON.stringify({
        id: 9472,
        currency: 'SEK',
        description: 'Instagram samarbete 2021-11-13.',
        full_salary_specification: true,
        employee: 1847,
        invoiced_amount: '1000.00',       
    }),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "amount": "760.92",
    "cost": "1020.00",
    "currency": "SEK",
    "fee": "20.00",
    "health_insurance": null,
    "invoiced_amount": "1000.00",
    "payroll": "239.18",
    "pension": null,
    "tax": "228.28",
    "vat": "255.00"
}

This endpoint allows you to calculate the price of payout you would like to make.

HTTP Request

POST https://api.gigapay.se/v2/pricing/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

Body Parameters

Parameter Type Required Default Description
id String False uuid4() Unique per Integration.
amount String False Either amount, invoiced_amount or cost is required.
cost String False Either amount, invoiced_amount or cost is required.
currency String True
description String True
employee String True
full_salary_specification Bool False False
invoiced_amount String True Either amount, invoiced_amount or cost is required.
metadata Object False
start_at String False
end_at String False null

Calculate bulk pricing info

import requests

response = requests.post(
    'https://api.gigapay.se/v2/payouts/',
    json=[
        {
            'id': 9472,
            'currency': 'SEK',
            'description': 'Instagram samarbete 2021-11-13.',
            'full_salary_specification': True,
            'employee': 1847,
            'invoiced_amount': '1000.00',       
        }, {
            'id': 9473,
            'currency': 'SEK',
            'description': 'Instagram samarbete 2021-11-13.',
            'full_salary_specification': True,
            'employee': 1736,
            'invoiced_amount': '2500.00',       
        },
    ],
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '[{"id": 9472, "currency": "SEK", "description": "Instagram samarbete 2021-11-13.", "full_salary_specification": true, "employee": 1847, "invoiced_amount": "1000.00"}, {"id": 9473, "currency": "SEK", "description": "Instagram samarbete 2021-11-13.", "full_salary_specification": true, "employee": 1736, "invoiced_amount": "2500.00"}]' https://api.gigapay.se/v2/payouts/
fetch("https://api.gigapay.se/v2/payouts/", {
    method: "POST",
    body: JSON.stringify([
        {
            'id': 9472,
            'currency': 'SEK',
            'description': 'Instagram samarbete 2021-11-13.',
            'full_salary_specification': true,
            'employee': 1847,
            'invoiced_amount': '1000.00',
        }, {
            'id': 9473,
            'currency': 'SEK',
            'description': 'Instagram samarbete 2021-11-13.',
            'full_salary_specification': true,
            'employee': 1736,
            'invoiced_amount': '2500.00',
        },
    ]),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

[
    {
        "amount": "760.92",
        "cost": "1020.00",
        "currency": "SEK",
        "fee": "20.00",
        "health_insurance": null,
        "invoiced_amount": "1000.00",
        "payroll": "239.18",
        "pension": null,
        "tax": "228.28",
        "vat": "255.00"
    }, {
        "amount": "1902.30",
        "cost": "2550.00",
        "currency": "SEK",
        "fee": "50.00",
        "health_insurance": null,
        "invoiced_amount": "2500.00",
        "payroll": "597.95",
        "pension": null,
        "tax": "570.70",
        "vat": "637.50"
    }
]

The same endpoint is used to calculate the pricing info for multiple Payouts at once.

HTTP Request

POST https://api.gigapay.se/v2/pricing/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

Body Parameters

Type Required Default Notes
Payout[] True Elements of array structured as Payout.

Calculate Pricing info with an inline Employee

import requests

response = requests.post(
    'https://api.gigapay.se/v2/pricing/?expand=employee',
    json={
        'id': 9472,
        'currency': 'SEK',
        'description': 'Instagram samarbete 2021-11-13.',
        'full_salary_specification': True,
        'employee': {
            'id': 1847,
            'name': 'Albin Lindskog',
            'cellphone_number': '+4670000001',
            'email': 'albin@mail.com',
            'country': 'SWE'
        },
        'invoiced_amount': '1000.00',        
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"id": 9472, "currency": "SEK", "description": "Instagram samarbete 2021-11-13.", "full_salary_specification": true, "employee": {"id": 1847, "name": "Albin Lindskog", "cellphone_number": "+4670000001", "email": "albin@mail.com", "country": "SWE"}, "invoiced_amount": "1000.00"}' 'https://api.gigapay.se/v2/pricing/?expand=employee'
fetch("https://api.gigapay.se/v2/pricing/?expand=employee", {
    method: "POST",
    body: JSON.stringify({
        id: 9472,
        currency: 'SEK',
        description: 'Instagram samarbete 2021-11-13.',
        full_salary_specification: true,
        employee: {
            id: 1847,
            name: 'Albin Lindskog',
            cellphone_number: '+4670000001',
            email: 'albin@mail.com',
            country: 'SWE'
        },
        invoiced_amount: '1000.00',       
    }),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "amount": "760.92",
    "cost": "1020.00",
    "currency": "SEK",
    "fee": "20.00",
    "health_insurance": null,
    "invoiced_amount": "1000.00",
    "payroll": "239.18",
    "pension": null,
    "tax": "228.28",
    "vat": "255.00"
}

This endpoint registers a Payout and an Employee at the same time. If an Employee with matching information is already registered will the object be reused.

HTTP Request

POST https://api.gigapay.se/v2/payouts/?expand=employee

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

Body Parameters

Parameter Type Required Default Description
id String False uuid4() Unique per Integration.
amount String False Either amount, invoiced_amount or cost is required.
cost String False Either amount, invoiced_amount or cost is required.
currency String True
description String True
employee Object True Structured as an Employee.
full_salary_specification Bool False False
invoiced_amount String True Either amount, invoiced_amount or cost is required.
metadata Object False
start_at String False
end_at String False null

Retrieve Pricing info of Payout

import requests

response = requests.get(
    'https://api.gigapay.se/v2/pricing/9472/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/pricing/9472/
fetch("https://api.gigapay.se/v2/pricing/9472/", {
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "amount": "760.92",
    "cost": "1020.00",
    "currency": "SEK",
    "fee": "20.00",
    "health_insurance": null,
    "invoiced_amount": "1000.00",
    "payroll": "239.18",
    "pension": null,
    "tax": "228.28",
    "vat": "255.00"
}

This endpoint retrieves a payout.

HTTP Request

GET https://api.gigapay.se/v2/pricing/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the Payout object.

Invoices

An Invoice groups Payouts together. It is a managed object, you can not create them directly. When a Payout is created it is added to the Invoice that is currently open. If there is no open Invoice, a new will be created.

You can keep invoices open for a certain time period by enabling batching of payouts. Contact support@gigapay.se if you are interested in this.

The Invoice object

An example Invoice object:

{
    "app": "https://app.gigapay.se/i/2859272/?token=Ii9pbnZvaWNpbmcvb3Blbl9pbnZvaWNlcy9jMTMzYzIwMi0xMDUwLTQ5NTktODMwNi05NWQ3Y2IzZjNiMjgvIg",
    "created_at": "2019-05-22T10:32:36.118753Z",
    "currency": "SEK",
    "id": "2859272",
    "metadata": {},
    "ocr_number": "986911160380",
    "open": false,
    "paid_at": "2019-05-25T9:02:16.8462735Z",
    "pdf": "https://api.gigapay.se/invoice/cad7d4d7-cdc7-4f70-8246-c061e041e9e/?token=Ii9pbnZvaWNpbmcvb3Blbl9pbnZvaWNlcy8zYjcyNTYyOS05MTE4LTQ5YTctYTFiYS0yMTU4NTZhMzYwOTgvIg&language=en",
    "price": "1340.48"
}
Attribute Description
app Link to pay invoice in app.
created_at Time at which the Invoice was created. Displayed as ISO 8601 string.
currency ISO-4217 currency code.
id A unique identifier for the object.
metadata JSON-encoded metadata.
ocr_number Bank reference.
open Whether the Invoice is the currently open one.
paid_at Time at which the Invoice was paid. Displayed as ISO 8601 string.
pdf Link to download a pdf version of the Invoice.
price Decimal formatted string of the price.

List All Invoices

import requests

response = requests.get(
    'https://api.gigapay.se/v2/invoices/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/invoices/
fetch("https://api.gigapay.se/v2/invoices/", {
  headers: {
    "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
  }
})

The above command returns JSON structured like this:

{
    "count": 4,
    "next": null,
    "previous": "https://api.gigapay.se/v2/invoices/?page=1",
    "results": [
        {
            "app": "https://app.gigapay.se/i/2859272/?token=Ii9pbnZvaWNpbmcvb3Blbl9pbnZvaWNlcy9jMTMzYzIwMi0xMDUwLTQ5NTktODMwNi05NWQ3Y2IzZjNiMjgvIg",
            "created_at": "2019-05-22T10:32:36.118753Z",
            "currency": "SEK",
            "id": "2859272",
            "metadata": {},
            "ocr_number": "986911160380",
            "open": false,
            "paid_at": "2019-05-25T9:02:16.8462735Z",
            "pdf": "https://api.gigapay.se/invoice/cad7d4d7-cdc7-4f70-8246-c061e041e9e/?token=Ii9pbnZvaWNpbmcvb3Blbl9pbnZvaWNlcy8zYjcyNTYyOS05MTE4LTQ5YTctYTFiYS0yMTU4NTZhMzYwOTgvIg&language=en",
            "price": "1340.48"
        }, {
            "app": "https://app.gigapay.se/i/2859273/?token=Ii9pbnZvaWNpbmcvb3Blbl9pbnZvaWNlcy9jMTMzYzIwMi0xMDUwLTQ5NTktODMwNi05NWQ3Y2IzZjNiMjgvIg",
            "created_at": "2019-06-22T10:28:21.847474Z",
            "currency": "SEK",
            "id": "2859273",
            "metadata": {},
            "ocr_number": "986911160349",
            "open": false,
            "paid_at": "2019-06-25T9:12:57.742648Z",
            "pdf": "https://api.gigapay.se/invoice/cad7d4d7-cdc7-4f70-8246-c061e041e9e/?token=Ii9pbnZvaWNpbmcvb3Blbl9pbnZvaWNlcy8zYjcyNTYyOS05MTE4LTQ5YTctYTFiYS0yMTU4NTZhMzYwOTgvIg&language=en",
            "price": "1340.48"
        }
}

This endpoint retrieves all Invoices.

HTTP Request

GET https://api.gigapay.se/v2/invoices/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

Query Parameters

Parameter Default Description
page 1 Which page to return.
page_size 25 The number of Invoices per page.
created_at Timestamp filter.
paid_at Timestamp filter.

Retrieve an Invoice

import requests

response = requests.get(
    'https://api.gigapay.se/v2/invoices/2859272/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/invoices/2859272/
fetch("https://api.gigapay.se/v2/invoices/2859272/", {
  headers: {
    "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
    "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
  }
})

The above command returns JSON structured like this:

{
    "app": "https://app.gigapay.se/i/2859272/?token=Ii9pbnZvaWNpbmcvb3Blbl9pbnZvaWNlcy9jMTMzYzIwMi0xMDUwLTQ5NTktODMwNi05NWQ3Y2IzZjNiMjgvIg",
    "created_at": "2019-05-22T10:32:36.118753Z",
    "currency": "SEK",
    "id": "2859272",
    "metadata": {},
    "ocr_number": "986911160380",
    "open": false,
    "paid_at": "2019-05-25T9:02:16.8462735Z",
    "pdf": "https://api.gigapay.se/invoice/cad7d4d7-cdc7-4f70-8246-c061e041e9e/?token=Ii9pbnZvaWNpbmcvb3Blbl9pbnZvaWNlcy8zYjcyNTYyOS05MTE4LTQ5YTctYTFiYS0yMTU4NTZhMzYwOTgvIg&language=en",
    "price": "1340.48"
}

This endpoint retrieves an Invoice.

HTTP Request

GET https://api.gigapay.se/v2/invoices/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Update an Invoice

import requests

response = requests.patch(
    'https://api.gigapay.se/v2/invoices/2859272/',
    json={
      'id': '846271',
      'metadata': {'original_id': '2859272'}
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X PATCH -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"id": "846271", "metadata": {"original_id": "2859272"}}' https://api.gigapay.se/v2/invoices/2859272/
fetch("https://api.gigapay.se/v2/invoices/2859272/", {
    method: "PATCH",
    body: JSON.stringify({'id': '846271', 'metadata': {'original_id': '2859272'}}),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    },
})

The above command returns JSON structured like this:

{
    "app": "https://app.gigapay.se/i/2859272/?token=Ii9pbnZvaWNpbmcvb3Blbl9pbnZvaWNlcy9jMTMzYzIwMi0xMDUwLTQ5NTktODMwNi05NWQ3Y2IzZjNiMjgvIg",
    "created_at": "2019-05-22T10:32:36.118753Z",
    "currency": "SEK",
    "id": "846271",
    "metadata": {
        "original_id": "2859272"
    },
    "ocr_number": "986911160380",
    "open": false,
    "paid_at": "2019-05-25T9:02:16.8462735Z",
    "pdf": "https://api.gigapay.se/invoice/cad7d4d7-cdc7-4f70-8246-c061e041e9e/?token=Ii9pbnZvaWNpbmcvb3Blbl9pbnZvaWNlcy8zYjcyNTYyOS05MTE4LTQ5YTctYTFiYS0yMTU4NTZhMzYwOTgvIg&language=en",
    "price": "1340.48"
}

This endpoint updates an Invoice.

HTTP Request

PATCH https://api.gigapay.se/v2/invoices/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Body Parameters

Parameter Type Required Default Notes
id String False Previous value Unique per Integration.
metadata Object False Previous value

Delete an Invoice

import requests

response = requests.delete(
    'https://api.gigapay.se/v2/invoices/846271/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X DELETE -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/invoices/846271/
fetch("https://api.gigapay.se/v2/invoices/846271/", {
    method: "DELETE",
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns an empty response.

This endpoint deletes an Invoice. Note that you can not delete a paid Invoice or an Invoice on credit.

HTTP Request

DELETE https://api.gigapay.se/v2/invoices/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Webhooks

Webhooks allows you to receive real-time status updates any time an event happens on your account. For a complete description of these notifications, see Events.

In the case where the receiving server is unavailable, we will retry the webhook notification up to 10 times with an exponential backoff.

The Webhook object

An example Webhook object

{
    "id": "38a93e19-886a-4246-9cfe-471214ff6739",
    "url": "https://jobmatchr.se/webhooks/payouts/",
    "events": ["Payout.notified", "Payout.accepted"],
    "secret_key": "c1329a085d65f7757838df5920fdcc9a",
    "metadata": {}
}
Attribute Description
id Unique identifier for the object.
url URL to which the notifications are posted.
events List of events to subscribe to.
secret_key Secret key used to sign the Webhook notifications.
metadata JSON-encoded metadata.

List All Registered Webhooks

import requests

response = requests.get(
    'https://api.gigapay.se/v2/webhooks/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/webhooks/
fetch("https://api.gigapay.se/v2/webhooks/", {
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "count": 4,
    "next": null,
    "previous": "https://api.gigapay.se/v2/webhooks/?page=2",
    "results": [
        {
            "id": "38a93e19-886a-4246-9cfe-471214ff6739",
            "url": "https://jobmatchr.se/webhooks/payouts/",
            "events": ["Payout.notified", "Payout.accepted"],
            "secret_key": "c1329a085d65f7757838df5920fdcc9a",
            "metadata": {}
        }, {
            "id": "0630bfcf-ad0a-458a-9794-816b54b542b6",
            "url": "https://jobmatchr.se/webhooks/employees/",
            "events": ["Employee.verified"],
            "secret_key": "1fc0ee40ecf33f83cbd3f930443074ca",
            "metadata": {}
        }
    ]
}

This endpoint retrieves all webhooks.

HTTP Request

GET https://api.gigapay.se/v2/webhooks/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

Query Parameters

Parameter Default Description
page 1 Which page to return.
page_size 25 The number of Webhooks per page.

Register a Webhook

import requests

response = requests.post(
    'https://api.gigapay.se/v2/webhooks/',
    json={
        'url': 'https://jobmatchr.se/webhooks/payouts/', 
        'events': ['Payout.created']
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"url": "http://0.0.0.0:8000/", "events": ["Payout.created"]}' https://jobmatchr.se/webhooks/payouts/
fetch("https://api.gigapay.se/v2/webhooks/", {
    method: "POST",
    body: JSON.stringify({url: "https://jobmatchr.se/webhooks/payouts/", events: ["Payout.created"]}),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    },
})

The above command returns JSON structured like this:

{
    "id": "38a93e19-886a-4246-9cfe-471214ff6739",
    "url": "https://jobmatchr.se/webhooks/payouts/",
    "events": ["Payout.created"],
    "secret_key": "c1329a085d65f7757838df5920fdcc9a",
    "metadata": {}
}

This endpoint creates a webhook.

HTTP Request

POST https://api.gigapay.se/v2/webhooks/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.
Idempotency-key False Idempotency key.

Body Parameters

Parameter Type Required Default Notes
id String False uuid4() Unique per Integration.
url URL True
events String[] True
secret_key String False 32 char random string
metadata Object False {}

Retrieve a Webhook

import requests

response = requests.get(
    'https://api.gigapay.se/v2/webhooks/481272/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X GET -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/webhooks/481272/
fetch("https://api.gigapay.se/v2/webhooks/481272/", {
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "id": "38a93e19-886a-4246-9cfe-471214ff6739",
    "url": "https://jobmatchr.se/webhooks/payouts/",
    "events": ["Payout.created"],
    "secret_key": "c1329a085d65f7757838df5920fdcc9a",
    "metadata": {}
}

This endpoint retrieves a webhook.

HTTP Request

GET https://api.gigapay.se/v2/webhooks/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Update a Webhook

import requests

response = requests.patch(
    'https://api.gigapay.se/v2/webhooks/481272/',
    json={
        'events': ['Payout.created', 'Payout.notified']
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X PATCH -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"events": ["Payout.created", "Payout.notified"]}' https://api.gigapay.se/v2/webhooks/481272/
fetch("https://api.gigapay.se/v2/webhooks/481272/", {
    method: "PATCH",
    body: JSON.stringify({events: ["Payout.created", "Payout.notified"]}),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    },
})

The above command returns JSON structured like this:

{
    "id": "481272",
    "url": "https://jobmatchr.se/webhooks/payouts/",
    "events": ["Payout.created", "Payout.notified"],
    "secret_key": "c1329a085d65f7757838df5920fdcc9a",
    "metadata": {}
}

This endpoint updates a webhook.

HTTP Request

PATCH https://api.gigapay.se/v2/webhooks/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Body Parameters

Parameter Type Required Default Notes
id String False Previous value Unique per Integration.
url URL False Previous value
events String[] False Previous value
secret_key String False Previous value
metadata Object False Previous value

Replace a Webhook

import requests

response = requests.put(
    'https://api.gigapay.se/v2/webhooks/481272/',
    json={
        'url': 'https://jobmatchr.se/webhooks/invoiced/', 
        'events': ['Invoice.created']
    },
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X PUT -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Content-Type: application/json' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' -d '{"url": "https://jobmatchr.se/webhooks/invoiced/", "events": ["Invoice.created"]}' https://api.gigapay.se/v2/webhooks/481272/
fetch("https://api.gigapay.se/v2/webhooks/481272/", {
    method: "PUT",
    body: JSON.stringify({url: "https://jobmatchr.se/webhooks/invoiced/", events: ["Invoice.created"]}),
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Content-Type": "application/json",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns JSON structured like this:

{
    "id": "481272",
    "url": "https://jobmatchr.se/webhooks/invoices/",
    "events": ["Invoice.created"],
    "secret_key": "vksnrsc6tamq73tc26rzrnzf33a4pgdv",
    "metadata": {}
}
{
    "id": "481272",
    "url": "https://jobmatchr.se/webhooks/invoices/",
    "events": ["Invoice.created"],
    "secret_key": "vksnrsc6tamq73tc26rzrnzf33a4pgdv",
    "metadata": {}
}

This endpoint replaces a webhook.

HTTP Request

PUT https://api.gigapay.se/v2/webhooks/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.

Body Parameters

Parameter Type Required Default Description
id String False uuid4() Unique per Integration.
url URL True
events String[] True
secret_key String False 32 char random string
metadata Object False {}

Delete a Webhook

import requests

response = requests.delete(
    'https://api.gigapay.se/v2/webhooks/481272/',
    headers={
        'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
        'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
    }
)
curl -X DELETE -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/webhooks/481272/
fetch("https://api.gigapay.se/v2/webhooks/481272/", {
    method: "DELETE",
    headers: {
        "Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
        "Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
    }
})

The above command returns an empty response.

This endpoint deletes a webhook.

HTTP Request

DELETE https://api.gigapay.se/v2/webhooks/:id/

Headers

Parameter Required Description
Authorization True Your Authorization Token.
Integration-ID True Integration id.

URL Parameters

Parameter Required Description
id True Unique identifier for the object.