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.
nullwhen 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, optionaluserExternalIdOne,userExternalIdTwo, anduserExternalIdThree, and a nullabledepartmentobject containingidandname.
- Name
limits- Type
- CardLimits · required
- Description
Current
daily,monthly,atm, and nullableapprovalBasedlimits.
- 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
nullif 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:
-100000000to100000000.
- Name
monthly- Type
- integer · required
- Description
Monthly spending limit in cents. Range:
-300000000to300000000.
- Name
atm- Type
- integer · required
- Description
Monthly ATM withdrawal limit in cents. Range:
-300000000to300000000.
- Name
approvalBased- Type
- integer | null · required
- Description
Approval-based limit in cents. Range:
-99999999999to99999999999, ornullfor a non-approval-based card.
For approval-based cards, the other limit fields are set to their maximum
values and are not useful for determining how much can be spent. Use
availableBalance for the current spendable amount.
List cards
Returns cards using cursor pagination.
Query parameters
- Name
cursor- Type
- string
- Description
Cursor returned as
nextCursorby the previous page.
- Name
limit- Type
- integer
- Description
Maximum number of cards to return. Defaults to
10.
Request
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=="
}
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
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
}
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
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
}
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
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
}