Skip to content

Latest commit

 

History

History
405 lines (303 loc) · 16.8 KB

WebhooksMerchantLevelApi.md

File metadata and controls

405 lines (303 loc) · 16.8 KB

WebhooksMerchantLevelApi

All URIs are relative to https://management-test.adyen.com/v3

Method HTTP request Description
deleteMerchantsMerchantIdWebhooksWebhookId DELETE /merchants/{merchantId}/webhooks/{webhookId} Remove a webhook
getMerchantsMerchantIdWebhooks GET /merchants/{merchantId}/webhooks List all webhooks
getMerchantsMerchantIdWebhooksWebhookId GET /merchants/{merchantId}/webhooks/{webhookId} Get a webhook
patchMerchantsMerchantIdWebhooksWebhookId PATCH /merchants/{merchantId}/webhooks/{webhookId} Update a webhook
postMerchantsMerchantIdWebhooks POST /merchants/{merchantId}/webhooks Set up a webhook
postMerchantsMerchantIdWebhooksWebhookIdGenerateHmac POST /merchants/{merchantId}/webhooks/{webhookId}/generateHmac Generate an HMAC key
postMerchantsMerchantIdWebhooksWebhookIdTest POST /merchants/{merchantId}/webhooks/{webhookId}/test Test a webhook

deleteMerchantsMerchantIdWebhooksWebhookId

deleteMerchantsMerchantIdWebhooksWebhookId(merchantId, webhookId)

Remove a webhook

Remove the configuration for the webhook identified in the path. To make this request, your API credential must have the following roles: * Management API—Webhooks read and write

Example

// Import classes:
//import com.adyen.client.infrastructure.*
//import com.adyen.model.management.*

val apiInstance = WebhooksMerchantLevelApi()
val merchantId : kotlin.String = merchantId_example // kotlin.String | The unique identifier of the merchant account.
val webhookId : kotlin.String = webhookId_example // kotlin.String | Unique identifier of the webhook configuration.
try {
    apiInstance.deleteMerchantsMerchantIdWebhooksWebhookId(merchantId, webhookId)
} catch (e: ClientException) {
    println("4xx response calling WebhooksMerchantLevelApi#deleteMerchantsMerchantIdWebhooksWebhookId")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhooksMerchantLevelApi#deleteMerchantsMerchantIdWebhooksWebhookId")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
merchantId kotlin.String The unique identifier of the merchant account.
webhookId kotlin.String Unique identifier of the webhook configuration.

Return type

null (empty response body)

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["X-API-Key"] = "" ApiClient.apiKeyPrefix["X-API-Key"] = "" Configure BasicAuth: ApiClient.username = "" ApiClient.password = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getMerchantsMerchantIdWebhooks

ListWebhooksResponse getMerchantsMerchantIdWebhooks(merchantId, pageNumber, pageSize)

List all webhooks

Lists all webhook configurations for the merchant account. To make this request, your API credential must have one of the following roles: * Management API—Webhooks read * Management API—Webhooks read and write

Example

// Import classes:
//import com.adyen.client.infrastructure.*
//import com.adyen.model.management.*

val apiInstance = WebhooksMerchantLevelApi()
val merchantId : kotlin.String = merchantId_example // kotlin.String | The unique identifier of the merchant account.
val pageNumber : kotlin.Int = 56 // kotlin.Int | The number of the page to fetch.
val pageSize : kotlin.Int = 56 // kotlin.Int | The number of items to have on a page, maximum 100. The default is 10 items on a page.
try {
    val result : ListWebhooksResponse = apiInstance.getMerchantsMerchantIdWebhooks(merchantId, pageNumber, pageSize)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhooksMerchantLevelApi#getMerchantsMerchantIdWebhooks")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhooksMerchantLevelApi#getMerchantsMerchantIdWebhooks")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
merchantId kotlin.String The unique identifier of the merchant account.
pageNumber kotlin.Int The number of the page to fetch. [optional]
pageSize kotlin.Int The number of items to have on a page, maximum 100. The default is 10 items on a page. [optional]

Return type

ListWebhooksResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["X-API-Key"] = "" ApiClient.apiKeyPrefix["X-API-Key"] = "" Configure BasicAuth: ApiClient.username = "" ApiClient.password = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getMerchantsMerchantIdWebhooksWebhookId

Webhook getMerchantsMerchantIdWebhooksWebhookId(merchantId, webhookId)

Get a webhook

Returns the configuration for the webhook identified in the path. To make this request, your API credential must have one of the following roles: * Management API—Webhooks read * Management API—Webhooks read and write

Example

// Import classes:
//import com.adyen.client.infrastructure.*
//import com.adyen.model.management.*

val apiInstance = WebhooksMerchantLevelApi()
val merchantId : kotlin.String = merchantId_example // kotlin.String | The unique identifier of the merchant account.
val webhookId : kotlin.String = webhookId_example // kotlin.String | Unique identifier of the webhook configuration.
try {
    val result : Webhook = apiInstance.getMerchantsMerchantIdWebhooksWebhookId(merchantId, webhookId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhooksMerchantLevelApi#getMerchantsMerchantIdWebhooksWebhookId")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhooksMerchantLevelApi#getMerchantsMerchantIdWebhooksWebhookId")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
merchantId kotlin.String The unique identifier of the merchant account.
webhookId kotlin.String Unique identifier of the webhook configuration.

Return type

Webhook

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["X-API-Key"] = "" ApiClient.apiKeyPrefix["X-API-Key"] = "" Configure BasicAuth: ApiClient.username = "" ApiClient.password = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

patchMerchantsMerchantIdWebhooksWebhookId

Webhook patchMerchantsMerchantIdWebhooksWebhookId(merchantId, webhookId, updateMerchantWebhookRequest)

Update a webhook

Make changes to the configuration of the webhook identified in the path. The request contains the new values you want to have in the webhook configuration. The response contains the full configuration for the webhook, which includes the new values from the request. To make this request, your API credential must have the following roles: * Management API—Webhooks read and write

Example

// Import classes:
//import com.adyen.client.infrastructure.*
//import com.adyen.model.management.*

val apiInstance = WebhooksMerchantLevelApi()
val merchantId : kotlin.String = merchantId_example // kotlin.String | The unique identifier of the merchant account.
val webhookId : kotlin.String = webhookId_example // kotlin.String | Unique identifier of the webhook configuration.
val updateMerchantWebhookRequest : UpdateMerchantWebhookRequest =  // UpdateMerchantWebhookRequest | 
try {
    val result : Webhook = apiInstance.patchMerchantsMerchantIdWebhooksWebhookId(merchantId, webhookId, updateMerchantWebhookRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhooksMerchantLevelApi#patchMerchantsMerchantIdWebhooksWebhookId")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhooksMerchantLevelApi#patchMerchantsMerchantIdWebhooksWebhookId")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
merchantId kotlin.String The unique identifier of the merchant account.
webhookId kotlin.String Unique identifier of the webhook configuration.
updateMerchantWebhookRequest UpdateMerchantWebhookRequest [optional]

Return type

Webhook

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["X-API-Key"] = "" ApiClient.apiKeyPrefix["X-API-Key"] = "" Configure BasicAuth: ApiClient.username = "" ApiClient.password = ""

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

postMerchantsMerchantIdWebhooks

Webhook postMerchantsMerchantIdWebhooks(merchantId, createMerchantWebhookRequest)

Set up a webhook

Subscribe to receive webhook notifications about events related to your merchant account. You can add basic authentication to make sure the data is secure. To make this request, your API credential must have the following roles: * Management API—Webhooks read and write

Example

// Import classes:
//import com.adyen.client.infrastructure.*
//import com.adyen.model.management.*

val apiInstance = WebhooksMerchantLevelApi()
val merchantId : kotlin.String = merchantId_example // kotlin.String | The unique identifier of the merchant account.
val createMerchantWebhookRequest : CreateMerchantWebhookRequest =  // CreateMerchantWebhookRequest | 
try {
    val result : Webhook = apiInstance.postMerchantsMerchantIdWebhooks(merchantId, createMerchantWebhookRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhooksMerchantLevelApi#postMerchantsMerchantIdWebhooks")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhooksMerchantLevelApi#postMerchantsMerchantIdWebhooks")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
merchantId kotlin.String The unique identifier of the merchant account.
createMerchantWebhookRequest CreateMerchantWebhookRequest [optional]

Return type

Webhook

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["X-API-Key"] = "" ApiClient.apiKeyPrefix["X-API-Key"] = "" Configure BasicAuth: ApiClient.username = "" ApiClient.password = ""

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

postMerchantsMerchantIdWebhooksWebhookIdGenerateHmac

GenerateHmacKeyResponse postMerchantsMerchantIdWebhooksWebhookIdGenerateHmac(merchantId, webhookId)

Generate an HMAC key

Returns an HMAC key for the webhook identified in the path. This key allows you to check the integrity and the origin of the notifications you receive.By creating an HMAC key, you start receiving HMAC-signed notifications from Adyen. Find out more about how to verify HMAC signatures. To make this request, your API credential must have the following roles: * Management API—Webhooks read and write

Example

// Import classes:
//import com.adyen.client.infrastructure.*
//import com.adyen.model.management.*

val apiInstance = WebhooksMerchantLevelApi()
val merchantId : kotlin.String = merchantId_example // kotlin.String | The unique identifier of the merchant account.
val webhookId : kotlin.String = webhookId_example // kotlin.String | 
try {
    val result : GenerateHmacKeyResponse = apiInstance.postMerchantsMerchantIdWebhooksWebhookIdGenerateHmac(merchantId, webhookId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhooksMerchantLevelApi#postMerchantsMerchantIdWebhooksWebhookIdGenerateHmac")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhooksMerchantLevelApi#postMerchantsMerchantIdWebhooksWebhookIdGenerateHmac")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
merchantId kotlin.String The unique identifier of the merchant account.
webhookId kotlin.String

Return type

GenerateHmacKeyResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["X-API-Key"] = "" ApiClient.apiKeyPrefix["X-API-Key"] = "" Configure BasicAuth: ApiClient.username = "" ApiClient.password = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

postMerchantsMerchantIdWebhooksWebhookIdTest

TestWebhookResponse postMerchantsMerchantIdWebhooksWebhookIdTest(merchantId, webhookId, testWebhookRequest)

Test a webhook

Sends sample notifications to test if the webhook is set up correctly. We send four test notifications for each event code you choose. They cover success and failure scenarios for the hard-coded currencies EUR and GBP, regardless of the currencies configured in the merchant accounts. For custom notifications, we only send the specified custom notification. The response describes the result of the test. The `status` field tells you if the test was successful or not. You can use the other fields to troubleshoot unsuccessful tests. To make this request, your API credential must have the following roles: * Management API—Webhooks read and write

Example

// Import classes:
//import com.adyen.client.infrastructure.*
//import com.adyen.model.management.*

val apiInstance = WebhooksMerchantLevelApi()
val merchantId : kotlin.String = merchantId_example // kotlin.String | The unique identifier of the merchant account.
val webhookId : kotlin.String = webhookId_example // kotlin.String | Unique identifier of the webhook configuration.
val testWebhookRequest : TestWebhookRequest =  // TestWebhookRequest | 
try {
    val result : TestWebhookResponse = apiInstance.postMerchantsMerchantIdWebhooksWebhookIdTest(merchantId, webhookId, testWebhookRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling WebhooksMerchantLevelApi#postMerchantsMerchantIdWebhooksWebhookIdTest")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling WebhooksMerchantLevelApi#postMerchantsMerchantIdWebhooksWebhookIdTest")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
merchantId kotlin.String The unique identifier of the merchant account.
webhookId kotlin.String Unique identifier of the webhook configuration.
testWebhookRequest TestWebhookRequest [optional]

Return type

TestWebhookResponse

Authorization

Configure ApiKeyAuth: ApiClient.apiKey["X-API-Key"] = "" ApiClient.apiKeyPrefix["X-API-Key"] = "" Configure BasicAuth: ApiClient.username = "" ApiClient.password = ""

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json