Transactions

A transaction is a card, ATM, cash, or Swypex-fee ledger event visible to your organization.

The transaction model

  • Name
    id
    Type
    string · required
    Description

    Unique transaction identifier.

  • Name
    authorizationDate
    Type
    integer · required
    Description

    Authorization or recording time as a Unix timestamp in milliseconds.

  • Name
    merchant
    Type
    string · required
    Description

    Merchant or counterparty display name.

  • Name
    person
    Type
    CardHolder · required
    Description

    Associated person's ID, name, optional external IDs, and nullable department.

  • Name
    department
    Type
    string | null · required
    Description

    Department display name, or null when none is assigned.

  • Name
    method
    Type
    string · required
    Description

    One of CARD, ATM, CASH, or SWYPEX_FEES.

  • Name
    category
    Type
    Category · required
    Description

    Machine-readable category.

  • Name
    categoryLabel
    Type
    string · required
    Description

    Display label for the category.

  • Name
    reviewStatus
    Type
    string | null
    Description

    NOT_REVIEWED, UNDER_REVIEW, BALANCE_SETTLED, APPROVED, REJECTED, or null.

  • Name
    status
    Type
    string · required
    Description

    SUCCEEDED, DECLINED, or REVERSED.

  • Name
    currency
    Type
    string · required
    Description

    ISO 4217 currency. Currently EGP.

  • Name
    amountCents
    Type
    integer · required
    Description

    Transaction amount in cents.

  • Name
    tags
    Type
    TransactionTag[] · required
    Description

    Tags containing id and name.

  • Name
    note
    Type
    string
    Description

    Optional transaction note.

  • Name
    description
    Type
    string
    Description

    Optional transaction description.

  • Name
    refund
    Type
    boolean · required
    Description

    Whether this is a refunded cash expense.

  • Name
    authorizationCode
    Type
    string
    Description

    Card processor authorization code.

  • Name
    last4
    Type
    string | null · required
    Description

    Last four card digits, or null for a non-card transaction.

  • Name
    cleared
    Type
    boolean · required
    Description

    Whether the transaction is cleared and settled.

Transaction example

{
  "id": "TXN1000000000",
  "authorizationDate": 1704067200000,
  "merchant": "Uber",
  "person": {
    "id": "USR1000000000",
    "fullName": "Sara Amr",
    "userExternalIdOne": "EMP-100",
    "department": { "id": "TAG1000000000", "name": "Sales" }
  },
  "department": "Sales",
  "method": "CARD",
  "category": "TRANSPORTATION",
  "categoryLabel": "Transportation",
  "reviewStatus": "APPROVED",
  "status": "SUCCEEDED",
  "currency": "EGP",
  "amountCents": 50000,
  "tags": [{ "id": "TAG1000000000", "name": "Travel" }],
  "refund": false,
  "last4": "1234",
  "cleared": true
}

GET/v1/transaction

List transactions

Returns transactions newest first using cursor pagination. Array query parameters use comma-separated values.

Query parameters

  • Name
    cursor
    Type
    string
    Description

    Cursor from the previous page's nextCursor.

  • Name
    limit
    Type
    integer
    Description

    Page size from 1 to 100. Defaults to 10.

  • Name
    fromDate
    Type
    integer
    Description
    Inclusive start time as Unix milliseconds.
  • Name
    toDate
    Type
    integer
    Description
    Inclusive end time as Unix milliseconds.
  • Name
    statuses
    Type
    string[]
    Description
    Comma-separated transaction statuses.
  • Name
    categories
    Type
    string[]
    Description
    Comma-separated transaction categories.
  • Name
    reviewStatuses
    Type
    string[]
    Description
    Comma-separated review statuses.
  • Name
    merchant
    Type
    string
    Description
    Merchant display-name filter.
  • Name
    departmentIds
    Type
    string[]
    Description
    Comma-separated department IDs.

Request

GET
/v1/transaction
curl -G https://p.swypex.com/v1/transaction \
  -H "Authorization: Bearer {access_token}" \
  --data-urlencode "limit=25" \
  --data-urlencode "statuses=SUCCEEDED,REVERSED"

Response

{
  "transactions": [
    {
      "id": "TXN1000000000",
      "authorizationDate": 1704067200000,
      "merchant": "Uber",
      "person": {
        "id": "USR1000000000",
        "fullName": "Sara Amr",
        "department": { "id": "TAG1000000000", "name": "Sales" }
      },
      "department": "Sales",
      "method": "CARD",
      "category": "TRANSPORTATION",
      "categoryLabel": "Transportation",
      "reviewStatus": "APPROVED",
      "status": "SUCCEEDED",
      "currency": "EGP",
      "amountCents": 50000,
      "tags": [],
      "refund": false,
      "last4": "1234",
      "cleared": true
    }
  ],
  "nextCursor": "eyJpZCI6IlRYTjEwMDAwMDAwMDAifQ=="
}

GET/v1/transaction/{id}

Retrieve a transaction

Returns a transaction object by ID. A transaction that does not exist or is not available to your organization returns a not-found error.

  • Name
    id
    Type
    string · required
    Description
    Transaction ID supplied in the path.

Request

GET
/v1/transaction/TXN1000000000
curl https://p.swypex.com/v1/transaction/TXN1000000000 \
  -H "Authorization: Bearer {access_token}"

Response excerpt

{
  "id": "TXN1000000000",
  "authorizationDate": 1704067200000,
  "merchant": "Uber",
  "method": "CARD",
  "status": "SUCCEEDED",
  "currency": "EGP",
  "amountCents": 50000,
  "refund": false,
  "last4": "1234",
  "cleared": true
}

Was this page helpful?