Skip to content

Commit 60c06cc

Browse files
authored
docs: added spec for 'incomingPaymentCreated' and schema for 'amount' in webhooks.yaml (#2978)
* Added spec for 'incomingPaymentCreated' and schema for 'amount', removed 'postinstall' and 'copy-op-schemas' scripts.
1 parent 46e069d commit 60c06cc

File tree

2 files changed

+36
-7
lines changed

2 files changed

+36
-7
lines changed

packages/backend/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
"build": "pnpm build:deps && pnpm clean && tsc --build tsconfig.json && pnpm copy-files",
1313
"clean": "rm -fr dist/",
1414
"copy-files": "cp src/graphql/schema.graphql dist/graphql/ && cp -r ./src/openapi ./dist/",
15-
"copy-op-schemas": "cp ./node_modules/@interledger/open-payments/dist/openapi/specs/schemas.yaml ./src/openapi/specs/",
1615
"prepack": "pnpm build",
17-
"postinstall": "pnpm copy-op-schemas",
1816
"dev": "ts-node-dev --inspect=0.0.0.0:9229 --respawn --transpile-only --require ./src/telemetry/index.ts src/index.ts"
1917
},
2018
"devDependencies": {

packages/backend/src/openapi/specs/webhooks.yaml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ info:
88
servers:
99
- url: 'https://account-servicing-entity.com/webhooks'
1010
webhooks:
11+
incomingPaymentCreated:
12+
post:
13+
requestBody:
14+
description: Notify account servicing entity that an incoming payment was created.
15+
content:
16+
application/json:
17+
schema:
18+
$ref: '#/components/schemas/incomingPaymentEvent'
19+
responses:
20+
'200':
21+
description: Returns a 200 status to indicate that the data was received successfully.
1122
incomingPaymentCompleted:
1223
post:
1324
requestBody:
@@ -148,9 +159,9 @@ components:
148159
completed:
149160
type: boolean
150161
incomingAmount:
151-
$ref: ./schemas.yaml#/components/schemas/amount
162+
$ref: '#/components/schemas/amount'
152163
receivedAmount:
153-
$ref: ./schemas.yaml#/components/schemas/amount
164+
$ref: '#/components/schemas/amount'
154165
metadata:
155166
type: object
156167
additionalProperties: true
@@ -214,9 +225,9 @@ components:
214225
type: string
215226
format: uri
216227
debitAmount:
217-
$ref: ./schemas.yaml#/components/schemas/amount
228+
$ref: '#/components/schemas/amount'
218229
sentAmount:
219-
$ref: ./schemas.yaml#/components/schemas/amount
230+
$ref: '#/components/schemas/amount'
220231
metadata:
221232
type: object
222233
additionalProperties: true
@@ -293,7 +304,7 @@ components:
293304
type: string
294305
format: date-time
295306
receivedAmount:
296-
$ref: ./schemas.yaml#/components/schemas/amount
307+
$ref: '#/components/schemas/amount'
297308
additionalProperties: false
298309
liquidityEvent:
299310
required:
@@ -341,3 +352,23 @@ components:
341352
scale:
342353
type: number
343354
additionalProperties: false
355+
amount:
356+
type: object
357+
properties:
358+
value:
359+
type: string
360+
format: uint64
361+
description: 'The value is an unsigned 64-bit integer amount, represented as a string.'
362+
assetCode:
363+
type: string
364+
description: The assetCode is a code that indicates the underlying asset. This SHOULD be an ISO4217 currency code.
365+
assetScale:
366+
type: integer
367+
minimum: 0
368+
maximum: 255
369+
description: The scale of amounts denoted in the corresponding asset code.
370+
required:
371+
- value
372+
- assetCode
373+
- assetScale
374+
additionalProperties: false

0 commit comments

Comments
 (0)