Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Push data

Create a new business linked

To create a new business the usual authentication approach is followed except uidis not required. The uid along with an authentication token will be returned once the business is created. If the email supplied already has a stub account the account details will be returned in addition to the uid and token.

post
Authorizations
X-API-KeystringRequired

API key needed to access the endpoints

Body
apikeystringOptional
appidstringOptional
webhookstringOptional
signaturestringOptional
Responses
200Success

No content

post/api/push/business
POST /api/push/business HTTP/1.1
Host: test.connect.stub.africa
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 221

{
  "apikey": "text",
  "appid": "text",
  "data": {
    "businessname": "text",
    "firstname": "text",
    "lastname": "text",
    "industry": "text",
    "phone": "text",
    "vatregistered": true,
    "region": "text",
    "email": "text"
  },
  "webhook": "text",
  "signature": "text"
}

No content


Update business information

Update the business data created by your app.

post
Authorizations
X-API-KeystringRequired

API key needed to access the endpoints

Body
apikeystringOptional
appidstringOptional
uidstringRequired
webhookstringOptional
signaturestringOptional
Responses
200Success

No content

post/api/push/business/update
POST /api/push/business/update HTTP/1.1
Host: test.connect.stub.africa
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 234

{
  "apikey": "text",
  "appid": "text",
  "uid": "text",
  "data": {
    "businessname": "text",
    "firstname": "text",
    "lastname": "text",
    "industry": "text",
    "phone": "text",
    "vatregistered": true,
    "region": "text",
    "email": "text"
  },
  "webhook": "text",
  "signature": "text"
}

No content


Asynchronously record income

Record income and send it to the account of the business specified by the uid

post
Body
apikeystringRequired
appidstringRequired
uidstringRequired
webhookstringOptional
signaturestringOptional
Responses
200Success

No content

post/api/push/income
POST /api/push/income HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 233

{
  "apikey": "text",
  "appid": "text",
  "uid": "text",
  "data": {
    "id": "text",
    "date": "text",
    "name": "text",
    "category": "text",
    "notes": "text",
    "currency": "ZAR",
    "amount": 1,
    "vat": 1,
    "productid": "text",
    "feeid": "text"
  },
  "webhook": "text",
  "signature": "text"
}

No content


Asynchronously record an expense

Create an expense and send it to the account of the business specified by the uid

post
Body
apikeystringRequired
appidstringRequired
uidstringRequired
webhookstringOptional
signaturestringOptional
Responses
200Success

No content

post/api/push/expense
POST /api/push/expense HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 199

{
  "apikey": "text",
  "appid": "text",
  "uid": "text",
  "data": {
    "id": "text",
    "date": "text",
    "name": "text",
    "category": "text",
    "notes": "text",
    "currency": "ZAR",
    "amount": 1,
    "vat": 1
  },
  "webhook": "text",
  "signature": "text"
}

No content


Asynchronously record a sale

Record a sale and send it to the account of the business specified by the uid

post
Body
apikeystringRequired
appidstringRequired
uidstringRequired
webhookstringOptional
signaturestringOptional
Responses
200Success

No content

post/api/push/sale
POST /api/push/sale HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 523

{
  "apikey": "text",
  "appid": "text",
  "uid": "text",
  "data": {
    "id": "text",
    "payment": {
      "id": "text",
      "date": "text",
      "name": "text",
      "category": "text",
      "currency": "ZAR",
      "amount": 1,
      "vat": 1
    },
    "items": [
      {
        "id": "text",
        "name": "text",
        "description": "text",
        "price": 1,
        "quantity": 1,
        "cost": 1,
        "costcurrency": "ZAR"
      }
    ],
    "customer": {
      "id": "text",
      "name": "text",
      "email": "text",
      "address": "text",
      "address2": "text",
      "suburb": "text",
      "city": "text",
      "postalcode": "text",
      "country": "text",
      "vatnumber": "text",
      "registrationnumber": "text"
    }
  },
  "webhook": "text",
  "signature": "text"
}

No content


Asynchronously record multiple income and expenses

Push a batch of income and expenses for a specific user.

post
Body
apikeystringRequired
appidstringRequired
uidstringRequired
webhookstringOptional
signaturestringOptional
Responses
200Success

No content

post/api/push/many
POST /api/push/many HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 370

{
  "apikey": "text",
  "appid": "text",
  "uid": "text",
  "data": {
    "income": [
      {
        "id": "text",
        "date": "text",
        "name": "text",
        "category": "text",
        "notes": "text",
        "currency": "ZAR",
        "amount": 1,
        "vat": 1,
        "productid": "text",
        "feeid": "text"
      }
    ],
    "expenses": [
      {
        "id": "text",
        "date": "text",
        "name": "text",
        "category": "text",
        "notes": "text",
        "currency": "ZAR",
        "amount": 1,
        "vat": 1
      }
    ]
  },
  "webhook": "text",
  "signature": "text"
}

No content


Asynchronously push settlement data

Push settlement data including income records, expense records, and optional settlement summary. This endpoint creating new records or updating existing ones based on the provided ID. Income and expenses in the same batch are typically paid out together in a single bank deposit or settlement.

post
Authorizations
X-API-KeystringRequired

API key needed to access the endpoints

Body
apikeystringRequired
appidstringRequired
uidstringRequired
webhookstringOptional
signaturestringOptional
Responses
200Success

No content

post/api/push/settlement
POST /api/push/settlement HTTP/1.1
Host: test.connect.stub.africa
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 419

{
  "apikey": "text",
  "appid": "text",
  "uid": "text",
  "data": [
    {
      "income": [
        {
          "id": "text",
          "date": "text",
          "name": "text",
          "accountid": "text",
          "notes": "text",
          "currency": "ZAR",
          "amount": 1,
          "vat": 1,
          "productid": "text"
        }
      ],
      "expenses": [
        {
          "id": "text",
          "date": "text",
          "name": "text",
          "accountid": "text",
          "notes": "text",
          "currency": "ZAR",
          "amount": 1,
          "vat": 1
        }
      ],
      "settlement": {
        "id": "text",
        "amount": 1,
        "fee": 1,
        "date": "text"
      }
    }
  ],
  "webhook": "text",
  "signature": "text"
}

No content


Asynchronously push settlement data using a file

This endpoint is complementary to the one above. Instead of send the data in the body of the payload. The path to file uploaded on s3 is included. File url must be one retrieved from Generate upload s3 URL

It is STRONGLY advised that a web hook is provided so that error can be received. Both success and errors will be sent to the URL provided.

post
Authorizations
X-API-KeystringRequired

API key needed to access the endpoints

Body
apikeystringRequired
appidstringRequired
uidstringRequired
webhookstringOptional
signaturestringOptional
Responses
200Success

No content

post/api/push/settlement-file
POST /api/push/settlement-file HTTP/1.1
Host: test.connect.stub.africa
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 117

{
  "apikey": "text",
  "appid": "text",
  "uid": "text",
  "data": {
    "url": "text",
    "date": "text"
  },
  "webhook": "text",
  "signature": "text"
}

No content

Web hook responses on settlements

There are 3 states post the processing of a settlement.

  1. When all the settlements are ingested successfully.

When no settlements are ingested successfully. i.e. total failure

When there is a partial failure


Asynchronously continue a subscription

Notify us that a subscription you are collecting on our behalf has been paid. This entitles the user to another month of access to stub premium.

post
Body
apikeystringRequired
appidstringRequired
uidstringRequired
webhookstringOptional
signaturestringOptional
Responses
200Success

No content

post/api/push/subscription
POST /api/push/subscription HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 127

{
  "apikey": "text",
  "appid": "text",
  "uid": "text",
  "data": {
    "id": "text",
    "date": "text",
    "amount": 1
  },
  "webhook": "text",
  "signature": "text"
}

No content

Asynchronously cancel a subscription

Notify us that a subscription you are collecting on our behalf has been cancelled. This entitles the user to stub premium until the end of the current billing period. Please note that this doesn't cancel subscriptions set up from within stub.

post
Body
apikeystringRequired
appidstringRequired
uidstringRequired
webhookstringOptional
signaturestringOptional
Responses
200Success

No content

post/api/push/cancellation
POST /api/push/cancellation HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 104

{
  "apikey": "text",
  "appid": "text",
  "uid": "text",
  "data": {
    "date": "text"
  },
  "webhook": "text",
  "signature": "text"
}

No content

Reset all transactional test data

This allows you to clear all the data in a test account except the basic account info and subscription status.

post
Body
apikeystringRequired
appidstringRequired
uidstringRequired
Responses
200Success

No content

post/api/push/reset
POST /api/push/reset HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 45

{
  "apikey": "text",
  "appid": "text",
  "uid": "text"
}

No content

Last updated