LogoLogo
System Status
2020-09-30
2020-09-30
  • 2020-09-30
  • Charges
  • Checkouts
  • Country specification
  • Customers
  • Events
  • Fees
  • File links
  • Files
  • Fulfillments
  • Invoices
  • Orders
  • Payouts
  • Refunds
  • Returns
  • SKUs
  • Sales summaries
  • Sales transactions
  • Sources
  • Webhooks
Powered by GitBook
On this page

Webhooks

PreviousSources

Last updated 6 months ago

Webhooks provide a way to receive real-time notifications about events occurring within your Digital River account. These notifications are sent via HTTP POST requests, allowing your application to respond immediately to changes, even those not initiated through direct API interactions. Setting up one or more webhook endpoints ensures your system stays updated and synchronizes seamlessly with Digital River events, facilitating efficient and engaging app experiences.

Digital River can send webhook events that notify your application whenever an event occurs in your account. This mechanism is especially useful for events that are not triggered by a direct API request and for services that are not directly responsible for making an API request but still need to know the response to that request.

Register webhook URLs, and we will notify you of any event in your account. When the event occurs, Digital River creates an Event object.

This Event object contains all the relevant information about what happened, including the event and the associated data. Digital River then sends the Event object, via an HTTP POST request, to any endpoint URLs you have defined in your account’s Webhooks settings. You can have Digital River send a single event to many webhook endpoints.

Gets a webhook endpoint by ID

get

Retrieves the details of a webhook endpoint. Supply the unique identifier of the webhook endpoint.

Authorizations
Path parameters
idstringRequired

Webhook ID

Responses
200
200 OK. Returns an event object if a valid identifier was provided. All events share a common structure. The only property that will differ is the data property. The data dictionary's values will be the same as retrieving the same object directly from the API. For example, a charge.created event will have the same information as retrieving the relevant charge would.
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
404 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
get
GET /webhooks/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdTime": "2025-05-09T04:55:04.508Z",
  "updatedTime": "2025-05-09T04:55:04.508Z",
  "types": [
    "order.created"
  ],
  "apiVersion": "default",
  "enabled": true,
  "address": "https://company.com",
  "transportType": "HTTP",
  "oauth": {
    "tokenEndPoint": "text",
    "userName": "text",
    "password": "text",
    "clientID": "text",
    "clientSecret": "text",
    "grantType": "password"
  },
  "authentication": {
    "username": "text",
    "password": "text"
  }
}

Deletes a webhook endpoint by ID

delete

Permanently deletes a webhook endpoint. Supply the unique identifier of the webhook.

Authorizations
Path parameters
idstringRequired

Webhook ID

Responses
204
204 No Content
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
401 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
409
409 Conflict
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
delete
DELETE /webhooks/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Returns a list of webhooks

get

Get all webhooks.

Authorizations
Query parameters
typestringOptional

A string containing a specific webhook endpoint name, or a group of events using * as a wildcard. The list will be filtered to include only webhooks with a matching webhook property.

typesstringOptional

An array of up to 20 strings containing specific event names. The list will be filtered to include only events with a matching event property. You may pass either type or types, but not both.

Responses
200
200 OK. A dictionary with a data property that contains an array of up to limit webhooks. Each entry in the array is a separate webhook object. If no more webhooks are available, the resulting array will be empty. This request should never return an error.
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
get
GET /webhooks HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "createdTime": "2025-05-09T04:55:04.508Z",
    "updatedTime": "2025-05-09T04:55:04.508Z",
    "types": [
      "order.created"
    ],
    "apiVersion": "default",
    "enabled": true,
    "address": "https://company.com",
    "transportType": "HTTP",
    "oauth": {
      "tokenEndPoint": "text",
      "userName": "text",
      "password": "text",
      "clientID": "text",
      "clientSecret": "text",
      "grantType": "password"
    },
    "authentication": {
      "username": "text",
      "password": "text"
    }
  }
]
  • POSTCreates a new webhook
  • GETGets a webhook endpoint by ID
  • DELETEDeletes a webhook endpoint by ID
  • PATCHUpdates an existing webhook endpoint
  • GETReturns a list of webhooks

Creates a new webhook

post

Creates a new webhook

Authorizations
Body
typesstring[]Optional

Each element of the array represents the name of an event type.

Example: order.created
apiVersionstring · enumOptional

Indicates whether to use the current default version of the API or the latest version of the API.

Default: defaultExample: defaultPossible values:
enabledbooleanOptional

Indicates whether the webhook is enabled and receives notifications.

Default: trueExample: true
addressstringRequired

URL of the webhook endpoint on your server you have set up to receive webhook notifications. Webhook data is sent as JSON in the POST request body. The full event details are included and can be used directly, after parsing the JSON into an Event object.

Example: https://company.com
transportTypestring · enumOptionalDefault: HTTPPossible values:
Responses
201
201 Created
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
409
409 Conflict
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
post
POST /webhooks HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 307

{
  "types": [
    "order.created"
  ],
  "apiVersion": "default",
  "enabled": true,
  "address": "https://company.com",
  "transportType": "HTTP",
  "oauth": {
    "tokenEndPoint": "text",
    "userName": "text",
    "password": "text",
    "clientID": "text",
    "clientSecret": "text",
    "grantType": "password"
  },
  "authentication": {
    "username": "text",
    "password": "text"
  }
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdTime": "2025-05-09T04:55:04.508Z",
  "updatedTime": "2025-05-09T04:55:04.508Z",
  "types": [
    "order.created"
  ],
  "apiVersion": "default",
  "enabled": true,
  "address": "https://company.com",
  "transportType": "HTTP",
  "oauth": {
    "tokenEndPoint": "text",
    "userName": "text",
    "password": "text",
    "clientID": "text",
    "clientSecret": "text",
    "grantType": "password"
  },
  "authentication": {
    "username": "text",
    "password": "text"
  }
}

Updates an existing webhook endpoint

patch

Updates a existing webhook endpoint.

Authorizations
Path parameters
idstringRequired

Webhook ID.

Body
typesstring[]Optional

The name of the event type.

Example: order.created
apiVersionstring · enumOptional

Indicates whether to use the current default version of the API or the latest version of the API

Default: defaultExample: defaultPossible values:
enabledbooleanOptional

Indicate that webhook is enabled and receives notifications or is not enabled and does not receive notifications

Default: trueExample: true
addressstringOptional

URL of the webhook endpoint on your server you have set up to receive webhook notifications. Webhook data is sent as JSON in the POST request body. The full event details are included and can be used directly, after parsing the JSON into an Event object.

Example: https://company.com
transportTypestring · enumOptionalDefault: HTTPPossible values:
Responses
200
200 OK
application/json
400
400 Bad Request
application/json
401
401 Unauthorized
application/json
403
403 Forbidden
application/json
404
401 Not Found
application/json
405
405 Method Not Allowed
application/json
406
406 Not Acceptable
application/json
408
408 Request Timeout
application/json
409
409 Conflict
application/json
429
429 Too Many Requests
application/json
500
500 Internal Server Error
application/json
502
502 Bad Gateway Error
application/json
503
503 Service Unavailable Error
application/json
504
504 Gateway Timeout Error
application/json
patch
PATCH /webhooks/{id} HTTP/1.1
Host: api.digitalriver.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 307

{
  "types": [
    "order.created"
  ],
  "apiVersion": "default",
  "enabled": true,
  "address": "https://company.com",
  "transportType": "HTTP",
  "oauth": {
    "tokenEndPoint": "text",
    "userName": "text",
    "password": "text",
    "clientID": "text",
    "clientSecret": "text",
    "grantType": "password"
  },
  "authentication": {
    "username": "text",
    "password": "text"
  }
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "createdTime": "2025-05-09T04:55:04.508Z",
  "updatedTime": "2025-05-09T04:55:04.508Z",
  "types": [
    "order.created"
  ],
  "apiVersion": "default",
  "enabled": true,
  "address": "https://company.com",
  "transportType": "HTTP",
  "oauth": {
    "tokenEndPoint": "text",
    "userName": "text",
    "password": "text",
    "clientID": "text",
    "clientSecret": "text",
    "grantType": "password"
  },
  "authentication": {
    "username": "text",
    "password": "text"
  }
}