Bassnet SOA API

(0 reviews)

BASSnet SOA Integration API

Overview and purpose of the API

  • The BASSnet SOA Integration API provides snapshot-consistent, cursor-paged retrieval of:
    • BASSnet invoices
    • BASSnet purchase orders (POs)
  • Each endpoint supports filtering by key fields and a modified-from timestamp to enable incremental data extraction.
  • Designed for reliable pagination by returning a snapshotId and nextCursor to ensure consistency across pages.

Authentication and security requirements

  • OAuth 2.0 is defined with two token endpoints:
    • UAT: /uat/kc/oauth2/token
    • Production: /pil/live/native-op/oauth2/token
  • Scopes: default_scope
  • Grant type: implicit
  • Each endpoint also requires the following HTTP header:
    • X-API-Key: Client Secret Key (required)

Notes:
- The RAML defines OAuth 2.0 schemes but does not specify how tokens are passed on requests (e.g., Authorization header). If your environment requires OAuth, obtain a token from the environment-appropriate token URL and follow your gatewayโ€™s standard token usage.
- X-API-Key is mandatory for all operations.

Base URL and supported environments

Endpoint documentation

1) Get BASSnet invoices

  • Summary: Retrieve a snapshot-consistent, cursor-paged list of BASSnet invoices. Filters may be applied by status, approval status, credit note and last modified date.
  • Method and path: POST /v1/soa/bassnet-invoices

Headers
- X-API-Key: string (required)

Request body schema: BassnetInvoiceRequest
- status: string (optional, default: All)
- approvalStatus: string (optional, default: All)
- creditNote: string (optional, default: All)
- modifiedFrom: datetime (optional) โ€” Returns records modified on or after this date-time
- cursor: string (optional) โ€” Opaque cursor returned as nextCursor from the previous page
- limit: integer (int32) (optional, default: 1000)

Sample request body

{
  "status": "All",
  "approvalStatus": "All",
  "creditNote": "All",
  "modifiedFrom": "2026-05-01T00:00:00+00:00",
  "cursor": null,
  "limit": 1000
}

Successful response schema: BassnetInvoicePagedResponse
- snapshotId: string (required) โ€” Identifier of the snapshot used for consistent paging
- asOf: datetime (required)
- nextCursor: string or null โ€” Pass as cursor to fetch the next page. Null when there are no more pages
- rows: array of BassnetInvoiceDto (required)

BassnetInvoiceDto fields (all optional; types include string, date-only, datetime, boolean where applicable)
- voucher, creditNote, vesselCode, vesselName, supplierCode, supplierName, invoiceNo, status, currency, amount, amountBase, attention, approvalStatus, deviationComments, nonConformance, financialYear, createdBy, cid, responsible, transferredBy, poNo, baseCurrency
- arrivalDate, invDate, dueDate, paidDate, verifiedDate, createdDate, transferredDate: date-only or null
- lastModifiedAt: datetime or null

Error response schema: ProblemDetails
- type: string or null
- title: string
- status: integer (int32)
- detail: string
- instance: string

Response codes
- 200: successful operation
- 400: Invalid invoice request
- 500: Invoice retrieval failed

cURL example (request)

curl -X POST "https://pildevfasweb01:8092/v1/soa/bassnet-invoices" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: {your_api_key}" \
  -d '{
    "status": "All",
    "approvalStatus": "All",
    "creditNote": "All",
    "modifiedFrom": "2026-05-01T00:00:00+00:00",
    "cursor": null,
    "limit": 1000
  }'

JSON response example (200)

{
  "snapshotId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "asOf": "2026-05-18T07:00:00+00:00",
  "nextCursor": "eyJPZmZzZXQiOjEwMDB9",
  "rows": [
    {
      "voucher": "V-100234",
      "creditNote": "No",
      "vesselCode": "DKS",
      "vesselName": "Dock Station",
      "supplierCode": "SUP001",
      "supplierName": "Marine Supplies Pte Ltd",
      "invoiceNo": "INV-2026-0001",
      "status": "Approved",
      "currency": "USD",
      "amount": "1250.00",
      "amountBase": "1250.00",
      "arrivalDate": "2026-05-01",
      "invDate": "2026-04-28",
      "dueDate": "2026-06-01",
      "paidDate": null,
      "verifiedDate": "2026-05-02",
      "attention": "Chief Engineer",
      "approvalStatus": "Approved",
      "deviationComments": null,
      "nonConformance": null,
      "financialYear": "2026",
      "createdDate": "2026-05-01",
      "createdBy": "jdoe",
      "cid": "C123",
      "responsible": "Accounts",
      "transferredDate": null,
      "transferredBy": null,
      "poNo": "PO-2026-0456",
      "baseCurrency": "USD",
      "lastModifiedAt": "2026-05-18T07:00:00+00:00"
    }
  ]
}

Error response example (400)

{
  "type": null,
  "title": "Invalid invoice request",
  "status": 400,
  "detail": "One or more request parameters are invalid.",
  "instance": "/v1/soa/bassnet-invoices"
}

Error response example (500)

{
  "type": null,
  "title": "Invoice retrieval failed",
  "status": 500,
  "detail": "An unexpected error occurred while retrieving invoices.",
  "instance": "/v1/soa/bassnet-invoices"
}

2) Get BASSnet purchase orders

  • Summary: Retrieve a snapshot-consistent, cursor-paged list of BASSnet purchase orders. Filters may be applied by approval status, status, current version and last modified date.
  • Method and path: POST /v1/soa/bassnet-pos

Headers
- X-API-Key: string (required)

Request body schema: BassnetPoRequest
- approvalStatus: string (optional, default: All)
- status: string (optional, default: All)
- currentVersionOnly: boolean (optional, default: true)
- modifiedFrom: datetime (optional) โ€” Returns records modified on or after this date-time
- cursor: string (optional) โ€” Opaque cursor returned as nextCursor from the previous page
- limit: integer (int32) (optional, default: 1000)

Sample request body

{
  "approvalStatus": "All",
  "status": "All",
  "currentVersionOnly": true,
  "modifiedFrom": "2026-05-01T00:00:00+00:00",
  "cursor": null,
  "limit": 1000
}

Successful response schema: BassnetPoPagedResponse
- snapshotId: string (required) โ€” Identifier of the snapshot used for consistent paging
- asOf: datetime (required)
- nextCursor: string or null โ€” Pass as cursor to fetch the next page. Null when there are no more pages
- rows: array of BassnetPoDto (required)

BassnetPoDto fields (all optional unless stated)
- vesselCode, poNo, reference, requisitionNo, description, supplierGroupRef, approvalStatus, poAttention, supplierCode, supplierName, forwarderName, pic, status, account, type, requestedFor, priority, department, projectCode, port, componentId, componentName, invoicedPoStatus, poInvoiceAmount, creditNoteAmount, orderTotalBase, invoiceAmountTrx, creditNoteAmountTrx, orderTotalTrx, shipmentOrder, awbNo, totalWeightKg, finYear, claimNo, currency, baseCurrency
- version: integer (int32) or null
- deliveryDate, requestedDate, sentToSupplier, orderDate, requiredDate, receivedDate, lastReminderSentDate, lastDeliveryReminderSentDate, confirmedDate, entDate, actualArrivalAtPort: date-only or null
- totalPackages: integer (int32) or null
- isCurrentVersion: boolean
- lastModifiedAt: datetime or null

Error response schema: ProblemDetails
- type: string or null
- title: string
- status: integer (int32)
- detail: string
- instance: string

Response codes
- 200: successful operation
- 400: Invalid PO request
- 500: PO retrieval failed

cURL example (request)

curl -X POST "https://pildevfasweb01:8092/v1/soa/bassnet-pos" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: {your_api_key}" \
  -d '{
    "approvalStatus": "All",
    "status": "All",
    "currentVersionOnly": true,
    "modifiedFrom": "2026-05-01T00:00:00+00:00",
    "cursor": null,
    "limit": 1000
  }'

JSON response example (200)

{
  "snapshotId": "6b8b4567-894a-4a50-9ff4-4c0f4d2c2f5e",
  "asOf": "2026-05-18T07:00:00+00:00",
  "nextCursor": null,
  "rows": [
    {
      "vesselCode": "DKS",
      "poNo": "PO-2026-0456",
      "version": 1,
      "reference": "REF-001",
      "requisitionNo": "REQ-2026-0100",
      "description": "Engine spare parts",
      "supplierGroupRef": "SG-01",
      "approvalStatus": "Approved",
      "poAttention": "Chief Engineer",
      "supplierCode": "SUP001",
      "supplierName": "Marine Supplies Pte Ltd",
      "forwarderName": "Global Forwarders",
      "pic": "jdoe",
      "status": "Ordered",
      "account": "6010",
      "type": "Spares",
      "deliveryDate": "2026-05-20",
      "requestedFor": "Dock Station",
      "requestedDate": "2026-04-25",
      "orderBy": "jdoe",
      "sentToSupplier": "2026-04-26",
      "orderDate": "2026-04-26",
      "priority": "Normal",
      "department": "Engine",
      "projectCode": "PRJ-01",
      "requiredDate": "2026-05-25",
      "receivedDate": null,
      "lastReminderSentDate": null,
      "lastDeliveryReminderSentDate": null,
      "port": "SGSIN",
      "componentId": "CMP-100",
      "componentName": "Main Engine",
      "invoicedPoStatus": "Not Invoiced",
      "poInvoiceAmount": "0.00",
      "creditNoteAmount": "0.00",
      "orderTotalBase": "1250.00",
      "invoiceAmountTrx": "0.00",
      "creditNoteAmountTrx": "0.00",
      "orderTotalTrx": "1250.00",
      "confirmedDate": "2026-04-27",
      "entDate": "2026-04-25",
      "shipmentOrder": "SO-001",
      "awbNo": "AWB123456",
      "actualArrivalAtPort": null,
      "totalPackages": 3,
      "totalWeightKg": "45.5",
      "finYear": "2026",
      "claimNo": null,
      "currency": "USD",
      "baseCurrency": "USD",
      "isCurrentVersion": true,
      "lastModifiedAt": "2026-05-18T07:00:00+00:00"
    }
  ]
}

Error response example (400)

{
  "type": null,
  "title": "Invalid PO request",
  "status": 400,
  "detail": "One or more request parameters are invalid.",
  "instance": "/v1/soa/bassnet-pos"
}

Error response example (500)

{
  "type": null,
  "title": "PO retrieval failed",
  "status": 500,
  "detail": "An unexpected error occurred while retrieving purchase orders.",
  "instance": "/v1/soa/bassnet-pos"
}

Error handling and status codes

  • 200: Request processed successfully. Response contains a snapshotId, asOf, nextCursor (null if no further pages), and rows.
  • 400: Invalid request input. The response follows ProblemDetails with fields: type, title, status, detail, instance.
  • 500: Server-side error during processing. The response follows ProblemDetails.

ProblemDetails schema

{
  "type": "string or null",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string"
}

Best practices for implementation

  • Use paging correctly:
    • Start with cursor null.
    • Continue calling with nextCursor until it is null.
    • Maintain the same snapshotId across a paging cycle for consistency.
  • Respect limits:
    • Use limit to control payload size; default is 1000.
  • Filter by modifiedFrom to implement incremental syncs.
  • Handle nullable date-only and datetime fields carefully when parsing.
  • Always provide X-API-Key in requests.
  • If using OAuth:
    • Acquire tokens from the environment-appropriate token URL.
    • Renew tokens according to your gatewayโ€™s token expiry policy.

Sample code snippets

Node.js (fetch) โ€” Get invoices first page

import fetch from "node-fetch";

const baseUrl = "https://pildevfasweb01:8092";
const apiKey = "{your_api_key}";

async function getInvoicesFirstPage() {
  const res = await fetch(`${baseUrl}/v1/soa/bassnet-invoices`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": apiKey
    },
    body: JSON.stringify({
      status: "All",
      approvalStatus: "All",
      creditNote: "All",
      modifiedFrom: "2026-05-01T00:00:00+00:00",
      cursor: null,
      limit: 1000
    })
  });
  if (!res.ok) {
    const err = await res.json().catch(() => ({}));
    throw new Error(`Request failed: ${res.status} ${JSON.stringify(err)}`);
    }
  return res.json();
}

getInvoicesFirstPage().then(console.log).catch(console.error);

Python (requests) โ€” Page through POs

import requests

BASE_URL = "https://pildevfasweb01:8092"
API_KEY = "{your_api_key}"

def fetch_pos(modified_from, cursor=None, limit=1000):
    url = f"{BASE_URL}/v1/soa/bassnet-pos"
    payload = {
        "approvalStatus": "All",
        "status": "All",
        "currentVersionOnly": True,
        "modifiedFrom": modified_from,
        "cursor": cursor,
        "limit": limit
    }
    headers = {
        "Content-Type": "application/json",
        "X-API-Key": API_KEY
    }
    r = requests.post(url, json=payload, headers=headers)
    r.raise_for_status()
    return r.json()

def fetch_all_pos(modified_from):
    cursor = None
    all_rows = []
    snapshot_id = None
    while True:
        page = fetch_pos(modified_from, cursor)
        if snapshot_id is None:
            snapshot_id = page["snapshotId"]
        all_rows.extend(page.get("rows", []))
        cursor = page.get("nextCursor")
        if cursor is None:
            break
    return {"snapshotId": snapshot_id, "rows": all_rows}

if __name__ == "__main__":
    data = fetch_all_pos("2026-05-01T00:00:00+00:00")
    print(f"Fetched {len(data['rows'])} PO rows from snapshot {data['snapshotId']}")

cURL โ€” Token acquisition (UAT example)

curl -X POST "https://pildevfasweb01:8092/uat/kc/oauth2/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data "grant_type=implicit&scope=default_scope"

Note: Exact token request parameters depend on your identity provider configuration. The API spec lists the token endpoints and grant but does not define client credentials or exact form fields. Use the appropriate parameters for your environment.


Reviews