技能 产品商业 企业卡与费用管理工作流

企业卡与费用管理工作流

v20260423
ramp-core-workflow-a
本工作流提供与Ramp API集成的企业卡和费用管理解决方案。用户可以通过它来自动化执行虚拟卡的发行、修改消费限额,并进行卡片暂停或终止等生命周期管理操作。适用于企业财务自动化、费用报销和账务同步等场景。
获取技能
255 次下载
概览

Ramp Core Workflow A

Overview

Issue and manage virtual cards with spending limits, policies, and lifecycle management.

Prerequisites

  • Completed ramp-hello-world

Instructions

Step 1: Issue a Virtual Card

card = requests.post(f"{BASE}/cards", headers={**headers, "Content-Type": "application/json"}, json={
    "holder_name": "Jane Smith",
    "spending_restrictions": {
        "amount": 50000,        # $500.00 in cents
        "interval": "monthly",  # monthly, yearly, total
    },
    "display_name": "Marketing Software",
    "fulfillment": { "card_type": "virtual" },
})
card.raise_for_status()
card_id = card.json()["id"]
print(f"Virtual card issued: {card_id}")

Step 2: Update Card Limit

requests.patch(f"{BASE}/cards/{card_id}", headers={**headers, "Content-Type": "application/json"}, json={
    "spending_restrictions": {
        "amount": 100000,  # Increase to $1,000
        "interval": "monthly",
    },
})

Step 3: Suspend Card

requests.post(f"{BASE}/cards/{card_id}/suspend", headers=headers)
print(f"Card {card_id} suspended")

Step 4: Terminate Card

requests.post(f"{BASE}/cards/{card_id}/terminate", headers=headers)
print(f"Card {card_id} terminated")

Output

  • Virtual card issued with spending limits
  • Card limits updated
  • Card suspended/terminated

Error Handling

Error Cause Solution
422 Invalid holder User not found Verify holder is a Ramp user
400 Invalid amount Amount not in cents Multiply dollars by 100
Card already terminated Cannot modify Check card state first

Resources

Next Steps

Transaction management: ramp-core-workflow-b

信息
Category 产品商业
Name ramp-core-workflow-a
版本 v20260423
大小 2.39KB
更新时间 2026-04-28
语言