Cards

Use the Cards API to list cards, retrieve a card, inspect available balance, and set or update its spending limits. Monetary values are integer cents.

The card model

  • Name
    id
    Type
    string · required
    Description

    Unique card identifier, for example CRD1000000000.

  • Name
    last4
    Type
    string | null · required
    Description

    Last four digits of the card number. null when the card is not activated.

  • Name
    nickname
    Type
    string · required
    Description

    Nickname assigned to the card.

  • Name
    cardHolder
    Type
    CardHolder · required
    Description

    Cardholder details. Includes id, fullName, optional userExternalIdOne, userExternalIdTwo, and userExternalIdThree, and a nullable department object containing id and name.

  • Name
    limits
    Type
    CardLimits · required
    Description

    Current daily, monthly, atm, and nullable approvalBased limits.

  • Name
    availableBalance
    Type
    integer | null · required
    Description

    Amount currently available to spend, in cents.

    For non-approval-based cards, this is the minimum of the remaining daily, monthly, and ATM limits after subtracting usage for each period.

    For example, with a daily limit of EGP 5,000, a monthly limit of EGP 20,000, and an ATM limit of EGP 10,000, spending EGP 1,000 today and EGP 5,000 this month with no ATM transactions leaves an available balance of EGP 4,000. The remaining daily limit is the most restrictive in this case.

    For approval-based cards, this is the amount still available after current spending, pending transactions, and outstanding cash.

    This is null if the card is not activated.

Card example

{
  "id": "CRD1000000000",
  "last4": "1234",
  "nickname": "Business Travel Card",
  "cardHolder": {
    "id": "USR1000000000",
    "fullName": "Sara Amr",
    "userExternalIdOne": "EMP-100",
    "userExternalIdTwo": "COST-20",
    "userExternalIdThree": "REGION-3",
    "department": {
      "id": "TAG1000000000",
      "name": "Sales"
    }
  },
  "limits": {
    "daily": 500000,
    "monthly": 2000000,
    "atm": 400000,
    "approvalBased": null
  },
  "availableBalance": 150000
}

Card limits

  • Name
    daily
    Type
    integer · required
    Description

    Daily spending limit in cents. Range: -100000000 to 100000000.

  • Name
    monthly
    Type
    integer · required
    Description

    Monthly spending limit in cents. Range: -300000000 to 300000000.

  • Name
    atm
    Type
    integer · required
    Description

    Monthly ATM withdrawal limit in cents. Range: -300000000 to 300000000.

  • Name
    approvalBased
    Type
    integer | null · required
    Description

    Approval-based limit in cents. Range: -99999999999 to 99999999999, or null for a non-approval-based card.


GET/v1/card

List cards

Returns cards using cursor pagination.

Query parameters

  • Name
    cursor
    Type
    string
    Description

    Cursor returned as nextCursor by the previous page.

  • Name
    limit
    Type
    integer
    Description

    Maximum number of cards to return. Defaults to 10.

Request

GET
/v1/card
curl -G https://p.swypex.com/v1/card \
  -H "Authorization: Bearer {access_token}" \
  --data-urlencode "limit=10"

Response

{
  "cards": [
    {
      "id": "CRD1000000000",
      "last4": "1234",
      "nickname": "Business Travel Card",
      "cardHolder": {
        "id": "USR1000000000",
        "fullName": "Sara Amr",
        "department": { "id": "TAG1000000000", "name": "Sales" }
      },
      "limits": {
        "daily": 500000,
        "monthly": 2000000,
        "atm": 400000,
        "approvalBased": null
      },
      "availableBalance": 150000
    }
  ],
  "nextCursor": "eyJpZCI6IkNSRDEwMDAwMDAwMDAifQ=="
}

GET/v1/card/{id}

Retrieve a card

Returns one card by its unique ID. The response is a card object.

  • Name
    id
    Type
    string · required
    Description

    Card ID supplied in the path.

Request

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

Response

{
  "id": "CRD1000000000",
  "last4": "1234",
  "nickname": "Business Travel Card",
  "cardHolder": {
    "id": "USR1000000000",
    "fullName": "Sara Amr",
    "department": { "id": "TAG1000000000", "name": "Sales" }
  },
  "limits": {
    "daily": 500000,
    "monthly": 2000000,
    "atm": 400000,
    "approvalBased": null
  },
  "availableBalance": 150000
}

PUT/v1/card/{id}/limits

Set card limits

Sets the card's limits. Send the complete desired limit state. Returns the updated card object.

For approval-based cards, set approvalBased to a non-null value and omit daily, monthly, and atm.

Request

PUT
/v1/card/CRD1000000000/limits
curl -X PUT https://p.swypex.com/v1/card/CRD1000000000/limits \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/merge-patch+json" \
  -d '{"daily":750000,"monthly":3000000,"atm":500000,"approvalBased":null}'

Response excerpt

{
  "id": "CRD1000000000",
  "limits": {
    "daily": 750000,
    "monthly": 3000000,
    "atm": 500000,
    "approvalBased": null
  },
  "availableBalance": 150000
}

PATCH/v1/card/{id}/limits

Update card limits

Updates only the limit fields included in the merge-patch document. Provided amounts are added to the current limits; negative amounts reduce them. Omitted limits remain unchanged.

For approval-based cards, set approvalBased to a non-null value and omit daily, monthly, and atm.

Returns the updated card object.

Request

PATCH
/v1/card/CRD1000000000/limits
curl -X PATCH https://p.swypex.com/v1/card/CRD1000000000/limits \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/merge-patch+json" \
  -d '{"daily":900000}'

Response excerpt

{
  "id": "CRD1000000000",
  "limits": {
    "daily": 900000,
    "monthly": 3000000,
    "atm": 500000,
    "approvalBased": null
  },
  "availableBalance": 150000
}

Was this page helpful?