Skip to content

Commit 2d88093

Browse files
Diogo RibeiroDiogo Ribeiro
authored andcommitted
Add crypto-sent webhook docs
1 parent e5d60a1 commit 2d88093

2 files changed

Lines changed: 112 additions & 0 deletions

File tree

docs/events/crypto-onramp.mdx

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import TabItem from '@theme/TabItem';
1111
| - | - |
1212
| [`order:crypto-onramp:committed`](#ordercrypto-onrampcommitted) | User placed an order. |
1313
| [`order:crypto-onramp:charged`](#ordercrypto-onrampcharged) | User has been charged for their order. |
14+
| [`order:crypto-onramp:crypto-sent`](#ordercrypto-onrampcrypto-sent) | User's crypto delivery has started. |
1415
| [`order:crypto-onramp:completed`](#ordercrypto-onrampcompleted) | User's order has completed. |
1516
| [`order:crypto-onramp:failed`](#ordercrypto-onrampfailed) | User's order has failed. |
1617
| [`order:crypto-onramp:refund:completed`](#ordercrypto-onramprefundcompleted) | User's order has been successfully refunded. |
@@ -221,6 +222,116 @@ The values for `origin.paymentMethod.type` can be found using our [REST API](../
221222
</TabItem>
222223
</Tabs>
223224

225+
## `order:crypto-onramp:crypto-sent`
226+
227+
Triggered when a user's crypto delivery has started and is in progress.
228+
229+
<Tabs>
230+
<TabItem label="Schema" value="schema" default>
231+
232+
- `id`: UUID of the order.
233+
- `status`: Status of the order (`processing`).
234+
- `createdAt`: Timestamp at which the order was created.
235+
- `updatedAt`: Timestamp at which the order was last updated.
236+
- `origin`: Object containing information about how the user paid.
237+
- `amount`: Amount the user paid.
238+
- `rate`: Rate used to calculate the amount.
239+
- `asset`: Currency code in the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) format used to make the payment.
240+
- `paymentMethod`: Object containing information about the payment method used.
241+
- `type`: Type of payment method.
242+
- `destination`: Object containing information about what the user will receive.
243+
- `amount`: Amount the user will receive.
244+
- `rate`: Rate used to calculate the amount.
245+
- `asset`: Cryptoasset the user will receive.
246+
- `network`: Network of the receiving asset.
247+
- `address`: Recipient wallet address.
248+
- `tag` (_optional_): Tag of the crypto transaction, used to complement the `address`.
249+
- `type`: Tag type (e.g.: `memo` or `destination-tag`).
250+
- `value`: Tag value.
251+
- `priority` (_optional_): Priority of the crypto transaction.
252+
- `ledger` (_optional_): Object containing information about the transaction on the ledger.
253+
- `txid`: Transaction ID on the ledger.
254+
- `url`: URL to view the transaction details on a blockchain explorer.
255+
- `fees`: Array containing fees associated with the order.
256+
- `amount`: Amount user was charged for this fee.
257+
- `asset`: Asset used to charge the fee.
258+
- `normalized`: Amount in USD that the user was charged for this fee.
259+
- `type`: Type of fee (`network`, `deposit` or `partner`).
260+
- `widget`: Widget associated with the session.
261+
- `id` UUID of the widget.
262+
- `name`: Name of the widget.
263+
- `flow`: Flow associated with the widget.
264+
265+
:::note
266+
The values for `origin.paymentMethod.type` can be found using our [REST API](../rest-api.md), via the [payment methods endpoint](https://api.topperpay.com/payment-methods/crypto-onramp).
267+
:::
268+
269+
</TabItem>
270+
<TabItem label="Example" value="example">
271+
272+
```js
273+
{
274+
"name": "order:crypto-onramp:crypto-sent",
275+
"id": "00a991cf-a870-43af-88b8-43c51532831d",
276+
"bootstrapTokenId": "141bfa06-481e-4684-96eb-cec4ad529616",
277+
"data": {
278+
// highlight-start
279+
"id": "966b8e24-6a65-442a-942e-577f16288789",
280+
"status": "processing",
281+
"createdAt": "2023-06-12T17:21:21.240Z",
282+
"updatedAt": "2023-06-12T17:21:21.240Z",
283+
"origin": {
284+
"amount": "100.00",
285+
"rate": "1770.27534301775263314892",
286+
"asset": "USD",
287+
"paymentMethod": {
288+
"type": "credit-card"
289+
}
290+
},
291+
"destination": {
292+
"amount": "0.047116964221968237",
293+
"rate": "0.00056488387749632223",
294+
"asset": "ETH",
295+
"ledger": {
296+
"txid": "0xdfa1ea4ddb841af466a5ca78c6e1f0edfaef5e54e79a28238d2a5bb2da4f1911",
297+
"url": "https://etherscan.io/tx/0xdfa1ea4ddb841af466a5ca78c6e1f0edfaef5e54e79a28238d2a5bb2da4f1911"
298+
},
299+
"network": "ethereum",
300+
"address": "0xb794F5eA0ba39494cE839613fffBA74279579268"
301+
},
302+
"fees": [
303+
{
304+
"amount": "14.17",
305+
"asset": "USD",
306+
"normalized": "14.17",
307+
"type": "network"
308+
},
309+
{
310+
"amount": "2.42",
311+
"asset": "USD",
312+
"normalized": "2.42",
313+
"type": "deposit"
314+
},
315+
{
316+
"amount": "1.00",
317+
"asset": "USD",
318+
"normalized": "1.00",
319+
"type": "partner"
320+
}
321+
],
322+
"widget": {
323+
"id": "998544f2-5b01-4062-9394-22827ff5db6c",
324+
"name": "ACME",
325+
"flow": "crypto_onramp"
326+
}
327+
// highlight-end
328+
}
329+
}
330+
```
331+
332+
</TabItem>
333+
</Tabs>
334+
224335
## `order:crypto-onramp:completed`
225336

226337
Triggered when a user's order has completed.

docs/webhooks.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Full information about the available events and their associated payloads can be
3030
| - | - |
3131
| [`order:crypto-onramp:committed`](./events/crypto-onramp.mdx#ordercrypto-onrampcommitted) | User placed an order. |
3232
| [`order:crypto-onramp:charged`](./events/crypto-onramp.mdx#ordercrypto-onrampcharged) | User has been charged for their order. |
33+
| [`order:crypto-onramp:crypto-sent`](./events/crypto-onramp.mdx#ordercrypto-onrampcrypto-sent) | User's crypto delivery has started. |
3334
| [`order:crypto-onramp:completed`](./events/crypto-onramp.mdx#ordercrypto-onrampcompleted) | User's order has completed. |
3435
| [`order:crypto-onramp:failed`](./events/crypto-onramp.mdx#ordercrypto-onrampfailed) | User's order has failed. |
3536
| [`order:crypto-onramp:refund:completed`](./events/crypto-onramp.mdx#ordercrypto-onramprefundcompleted) | User's order has been successfully refunded. |

0 commit comments

Comments
 (0)