Webhooks
Retrieve notifications through webhooks on transaction events and status changes
mutation CreateSubscription($data: SubscriptionCreateInput!) {
createSubscription(data: $data) {
id,
token
}
}{
"data": {
"organization": {
"id": "clu1dzpny0007vjto1gxhl5my" # inabit organization Id
},
"url": "https://studio.apollographql.com", # Webhook for subscriber
}
}{
"data": {
"createSubscription": {
"id": "clugv892y0000vjhga8ugol38", # Created subscription Id
"token": "sub_c028ef8d-b8b9-49c0-b5a9-f7451884b834" # Unique generated token recognized by inabit
}
}
}{
"errors": [
{
"message": "INTERNAL_SERVER_ERROR",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"createSubscription"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"message": "There's already an active subscription for this organization. (organization: clu1dzpny0007vjto1gxhl5my)",
"exception": {
"message": "INTERNAL_SERVER_ERROR",
"stacktrace": [
"Error: There's already an active subscription for this organization. (organization: clu1dzpny0007vjto1gxhl5my)",
" at SubscriptionResolver.createSubscription (C:\\Users\\Ori Botan\\Documents\\inabit\\inabit\\server\\src\\subscription\\subscription.resolver.ts:81:13)"
]
}
}
}
],
"data": null
}{
"errors": [
{
"message": "INTERNAL_SERVER_ERROR",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"createSubscription"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Create subscription failed (organization: clu1dzpny0007vjto1gxhl5my)",
"exception": {
"message": "INTERNAL_SERVER_ERROR",
"stacktrace": [
"Error: Create subscription failed (organization: clu1dzpny0007vjto1gxhl5my)",
" at SubscriptionResolver.createSubscription (C:\\Users\\Ori Botan\\Documents\\inabit\\inabit\\server\\src\\subscription\\subscription.resolver.ts:81:13)"
]
}
}
}
],
"data": null
}query Subscriptions($where: SubscriptionWhereInput) {
subscriptions(where: $where) {
id
token
}
}mutation DeleteSubscription($where: SubscriptionWhereUniqueInput!) {
deleteSubscription(where: $where) {
id
}
}body:
{
"where": {
"id": "clu5bxctk0003vje4n4pqfdya" # Subscription Id
}
}{
"data": {
"deleteSubscription": {
"id": "clugwvbm70007vj4w74gxch3u"
}
}
}{
"errors": [
{
"message": "INTERNAL_SERVER_ERROR",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"deletesubscription"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Delete subscription failed (organization: clu1dzpny0007vjto1gxhl5my)",
"exception": {
"message": "INTERNAL_SERVER_ERROR",
"stacktrace": [
"Error: Delete subscription failed (organization: clu1dzpny0007vjto1gxhl5my)",
" at SubscriptionResolver.deleteSubscription (C:\\Users\\Ori Botan\\Documents\\inabit\\inabit\\server\\src\\subscription\\subscription.resolver.ts:81:13)"
]
}
}
}
],
"data": null
}