-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathramp-developer-api-webhooks-asyncapi.yml
More file actions
738 lines (692 loc) · 24.5 KB
/
Copy pathramp-developer-api-webhooks-asyncapi.yml
File metadata and controls
738 lines (692 loc) · 24.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
asyncapi: 2.6.0
info:
title: Ramp Developer API Webhooks
version: 1.0.0
description: |
Event-driven surface for the Ramp Developer API. Ramp delivers
webhook events to subscriber-provided HTTPS endpoints whenever
state changes occur on resources such as transactions, bills,
reimbursements, purchase orders, vendors, users, and unified
requests.
All payloads share a common envelope and are signed with an
HMAC-SHA256 signature delivered in the `X-Ramp-Signature`
request header so consumers can verify authenticity.
Source: https://docs.ramp.com/developer-api/v1/webhooks
NOTE: The user task brief referenced a Svix signature scheme.
Ramp's public documentation describes signing using the
`X-Ramp-Signature` header (HMAC-SHA256 of the raw request body
with the subscription secret). The spec below models Ramp's
documented scheme rather than a fabricated Svix scheme so the
artifact stays faithful to the source. Consumers integrating
via a Svix-style relay should treat the documented Ramp signing
headers as canonical.
contact:
name: Ramp Developer Support
url: https://docs.ramp.com/developer-api/v1/overview/introduction
license:
name: Ramp Platform Agreement
url: https://ramp.com/legal/platform-agreement
tags:
- name: corporate-cards
- name: spend-management
- name: webhooks
- name: events
defaultContentType: application/json
servers:
subscriber:
url: '{webhookUrl}'
protocol: https
description: |
Subscriber-controlled HTTPS endpoint registered with Ramp.
Ramp POSTs each event to this URL. Endpoints must respond
with a 2xx status within 10 seconds; otherwise Ramp retries
(429/5xx only) up to 10 times with exponential backoff and
jitter (0-60s initial delay).
variables:
webhookUrl:
default: https://example.com/webhooks/ramp
description: Fully-qualified HTTPS URL configured on the Ramp webhook subscription.
channels:
ramp/webhook:
description: |
Single inbound channel that receives every Ramp webhook event.
Consumers route on the envelope `type` field. The complete list
of event types is enumerated in the `RampEventType` schema.
bindings:
http:
type: request
method: POST
bindingVersion: 0.3.0
subscribe:
summary: Receive a Ramp webhook event.
operationId: receiveRampWebhook
bindings:
http:
type: request
method: POST
bindingVersion: 0.3.0
message:
oneOf:
- $ref: '#/components/messages/ApplicationsStatusUpdated'
- $ref: '#/components/messages/BillsApproved'
- $ref: '#/components/messages/BillsArchived'
- $ref: '#/components/messages/BillsCreated'
- $ref: '#/components/messages/BillsPaid'
- $ref: '#/components/messages/BillsReadyToSync'
- $ref: '#/components/messages/BillsRejected'
- $ref: '#/components/messages/EntitiesCreated'
- $ref: '#/components/messages/ItemReceiptsCreated'
- $ref: '#/components/messages/PaymentsUpdated'
- $ref: '#/components/messages/PurchaseOrdersArchived'
- $ref: '#/components/messages/PurchaseOrdersCreated'
- $ref: '#/components/messages/PurchaseOrdersUpdated'
- $ref: '#/components/messages/ReimbursementsBatchPaymentReimbursed'
- $ref: '#/components/messages/ReimbursementsReadyForReview'
- $ref: '#/components/messages/ReimbursementsReadyToSync'
- $ref: '#/components/messages/ReimbursementsSyncRequested'
- $ref: '#/components/messages/SpendRequestsCommentCreated'
- $ref: '#/components/messages/TransactionsAuthorized'
- $ref: '#/components/messages/TransactionsCleared'
- $ref: '#/components/messages/TransactionsDeclined'
- $ref: '#/components/messages/TransactionsReadyForReview'
- $ref: '#/components/messages/TransactionsReadyToSync'
- $ref: '#/components/messages/TransactionsSyncRequested'
- $ref: '#/components/messages/TransactionsSynced'
- $ref: '#/components/messages/UnifiedRequestsCreated'
- $ref: '#/components/messages/UnifiedRequestsExternalApprovalRequest'
- $ref: '#/components/messages/UnifiedRequestsExternalApprovalRequestReset'
- $ref: '#/components/messages/UnifiedRequestsModified'
- $ref: '#/components/messages/UnifiedRequestsNodeAdvanced'
- $ref: '#/components/messages/UnifiedRequestsOverrideApproved'
- $ref: '#/components/messages/UnifiedRequestsUpdated'
- $ref: '#/components/messages/UsersInviteAccepted'
- $ref: '#/components/messages/VendorsActivated'
- $ref: '#/components/messages/VendorsUpdated'
- $ref: '#/components/messages/TestsTestEvent'
components:
messageTraits:
RampWebhookHeaders:
headers:
type: object
required:
- X-Ramp-Signature
properties:
X-Ramp-Signature:
type: string
description: |
HMAC-SHA256 hash of the raw request body, signed with
the webhook subscription secret. Verify by recomputing
the HMAC over the exact raw bytes received and comparing
in constant time.
example: <hmac-sha256-hex>
Content-Type:
type: string
const: application/json
User-Agent:
type: string
description: Identifies the Ramp webhook delivery agent.
messages:
ApplicationsStatusUpdated:
name: ApplicationsStatusUpdated
title: applications.status_updated
summary: Fired when a Ramp application status changes (e.g. IN_REVIEW, APPROVED, REJECTED).
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: applications.status_updated
BillsApproved:
name: BillsApproved
title: bills.approved
summary: Fired when a bill is approved.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: bills.approved
BillsArchived:
name: BillsArchived
title: bills.archived
summary: Fired when a bill is archived.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: bills.archived
BillsCreated:
name: BillsCreated
title: bills.created
summary: Fired when a new bill is created.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: bills.created
BillsPaid:
name: BillsPaid
title: bills.paid
summary: Fired when a bill payment completes.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: bills.paid
BillsReadyToSync:
name: BillsReadyToSync
title: bills.ready_to_sync
summary: Fired when a bill is ready to sync to accounting.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: bills.ready_to_sync
BillsRejected:
name: BillsRejected
title: bills.rejected
summary: Fired when a bill is rejected.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: bills.rejected
EntitiesCreated:
name: EntitiesCreated
title: entities.created
summary: Fired when a business entity is created.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: entities.created
ItemReceiptsCreated:
name: ItemReceiptsCreated
title: item_receipts.created
summary: Fired when an item receipt is created.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: item_receipts.created
PaymentsUpdated:
name: PaymentsUpdated
title: payments.updated
summary: Fired when a bill payment state updates.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: payments.updated
PurchaseOrdersArchived:
name: PurchaseOrdersArchived
title: purchase_orders.archived
summary: Fired when a purchase order is archived.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: purchase_orders.archived
PurchaseOrdersCreated:
name: PurchaseOrdersCreated
title: purchase_orders.created
summary: Fired when a purchase order is created.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: purchase_orders.created
PurchaseOrdersUpdated:
name: PurchaseOrdersUpdated
title: purchase_orders.updated
summary: Fired when a purchase order is updated.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: purchase_orders.updated
ReimbursementsBatchPaymentReimbursed:
name: ReimbursementsBatchPaymentReimbursed
title: reimbursements.batch_payment_reimbursed
summary: Fired when a batch reimbursement payment is disbursed.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: reimbursements.batch_payment_reimbursed
ReimbursementsReadyForReview:
name: ReimbursementsReadyForReview
title: reimbursements.ready_for_review
summary: Fired when a reimbursement is ready for review.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: reimbursements.ready_for_review
ReimbursementsReadyToSync:
name: ReimbursementsReadyToSync
title: reimbursements.ready_to_sync
summary: Fired when a reimbursement is ready to sync to accounting.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: reimbursements.ready_to_sync
ReimbursementsSyncRequested:
name: ReimbursementsSyncRequested
title: reimbursements.sync_requested
summary: Fired when a reimbursement sync is requested.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: reimbursements.sync_requested
SpendRequestsCommentCreated:
name: SpendRequestsCommentCreated
title: spend_requests.comment_created
summary: Fired when a comment is added to a spend request.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: spend_requests.comment_created
TransactionsAuthorized:
name: TransactionsAuthorized
title: transactions.authorized
summary: Fired when a corporate-card transaction is authorized.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: transactions.authorized
TransactionsCleared:
name: TransactionsCleared
title: transactions.cleared
summary: Fired when a corporate-card transaction settles/clears.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: transactions.cleared
TransactionsDeclined:
name: TransactionsDeclined
title: transactions.declined
summary: Fired when a corporate-card transaction is declined.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: transactions.declined
TransactionsReadyForReview:
name: TransactionsReadyForReview
title: transactions.ready_for_review
summary: Fired when a transaction is ready for review.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: transactions.ready_for_review
TransactionsReadyToSync:
name: TransactionsReadyToSync
title: transactions.ready_to_sync
summary: Fired when a transaction is ready to sync to accounting.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: transactions.ready_to_sync
TransactionsSyncRequested:
name: TransactionsSyncRequested
title: transactions.sync_requested
summary: Fired when a transaction sync is requested.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: transactions.sync_requested
TransactionsSynced:
name: TransactionsSynced
title: transactions.synced
summary: Fired when a transaction has been synced to accounting.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: transactions.synced
UnifiedRequestsCreated:
name: UnifiedRequestsCreated
title: unified_requests.created
summary: Fired when a unified request is created.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: unified_requests.created
UnifiedRequestsExternalApprovalRequest:
name: UnifiedRequestsExternalApprovalRequest
title: unified_requests.external_approval_request
summary: Fired when a unified request requires external approval.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: unified_requests.external_approval_request
UnifiedRequestsExternalApprovalRequestReset:
name: UnifiedRequestsExternalApprovalRequestReset
title: unified_requests.external_approval_request_reset
summary: Fired when an external approval request on a unified request is reset.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: unified_requests.external_approval_request_reset
UnifiedRequestsModified:
name: UnifiedRequestsModified
title: unified_requests.modified
summary: Fired when a unified request is modified.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: unified_requests.modified
UnifiedRequestsNodeAdvanced:
name: UnifiedRequestsNodeAdvanced
title: unified_requests.node_advanced
summary: Fired when a unified request advances to the next approval node.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: unified_requests.node_advanced
UnifiedRequestsOverrideApproved:
name: UnifiedRequestsOverrideApproved
title: unified_requests.override_approved
summary: Fired when a unified request is approved via override.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: unified_requests.override_approved
UnifiedRequestsUpdated:
name: UnifiedRequestsUpdated
title: unified_requests.updated
summary: Fired when a unified request is updated.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: unified_requests.updated
UsersInviteAccepted:
name: UsersInviteAccepted
title: users.invite_accepted
summary: Fired when an invited user accepts their Ramp invitation.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: users.invite_accepted
VendorsActivated:
name: VendorsActivated
title: vendors.activated
summary: Fired when a vendor is activated.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: vendors.activated
VendorsUpdated:
name: VendorsUpdated
title: vendors.updated
summary: Fired when a vendor record is updated.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: vendors.updated
TestsTestEvent:
name: TestsTestEvent
title: tests.test_event
summary: Test event delivered when a subscription's test action is invoked.
traits:
- $ref: '#/components/messageTraits/RampWebhookHeaders'
payload:
allOf:
- $ref: '#/components/schemas/RampEventEnvelope'
- type: object
properties:
type:
const: tests.test_event
schemas:
RampEventEnvelope:
type: object
description: |
Common envelope shared by every Ramp webhook delivery. The
`object` field carries the resource identifier; use the
corresponding Developer API resource endpoint to hydrate the
full record. Event IDs are stable across retries to support
idempotency.
required:
- id
- type
- created_at
- business_id
- object
properties:
id:
type: string
description: Unique event identifier. Stable across retry attempts.
example: evt_01HXYZABCDEF
type:
$ref: '#/components/schemas/RampEventType'
created_at:
type: string
format: date-time
description: ISO 8601 timestamp when the event was generated.
example: '2026-05-30T12:34:56Z'
business_id:
type: string
description: Identifier of the Ramp business account associated with the event.
example: bus_01HXYZ123456
object:
type: object
description: |
Reference to the affected resource. Carries at minimum
the resource identifier so subscribers can call the
Developer API to fetch the current state.
required:
- id
properties:
id:
type: string
description: Identifier of the affected resource.
example: txn_01HXYZ7891011
type:
type: string
description: Resource type (e.g. transaction, bill, reimbursement).
RampEventType:
type: string
description: Enumeration of every webhook event type Ramp may emit.
enum:
- applications.status_updated
- bills.approved
- bills.archived
- bills.created
- bills.paid
- bills.ready_to_sync
- bills.rejected
- entities.created
- item_receipts.created
- payments.updated
- purchase_orders.archived
- purchase_orders.created
- purchase_orders.updated
- reimbursements.batch_payment_reimbursed
- reimbursements.ready_for_review
- reimbursements.ready_to_sync
- reimbursements.sync_requested
- spend_requests.comment_created
- transactions.authorized
- transactions.cleared
- transactions.declined
- transactions.ready_for_review
- transactions.ready_to_sync
- transactions.sync_requested
- transactions.synced
- unified_requests.created
- unified_requests.external_approval_request
- unified_requests.external_approval_request_reset
- unified_requests.modified
- unified_requests.node_advanced
- unified_requests.override_approved
- unified_requests.updated
- users.invite_accepted
- vendors.activated
- vendors.updated
- tests.test_event
securitySchemes:
rampWebhookSignature:
type: httpApiKey
in: header
name: X-Ramp-Signature
description: |
Each delivery includes `X-Ramp-Signature`, an HMAC-SHA256
hash of the raw request body computed with the webhook
subscription's signing secret. Verify before processing.