Skip to content

Latest commit

 

History

History
176 lines (130 loc) · 5.94 KB

File metadata and controls

176 lines (130 loc) · 5.94 KB

OrdersApi

All URIs are relative to https://checkout-test.adyen.com/v71

Method HTTP request Description
postOrders POST /orders Create an order
postOrdersCancel POST /orders/cancel Cancel an order
postPaymentMethodsBalance POST /paymentMethods/balance Get the balance of a gift card

postOrders

CreateOrderResponse postOrders(idempotencyKey, createOrderRequest)

Create an order

Creates an order to be used for partial payments. Make a POST `/orders` call before making a `/payments` call when processing payments with different payment methods.

Example

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

val apiInstance = OrdersApi()
val idempotencyKey : kotlin.String = 37ca9c97-d1d1-4c62-89e8-706891a563ed // kotlin.String | A unique identifier for the message with a maximum of 64 characters (we recommend a UUID).
val createOrderRequest : CreateOrderRequest =  // CreateOrderRequest | 
try {
    val result : CreateOrderResponse = apiInstance.postOrders(idempotencyKey, createOrderRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OrdersApi#postOrders")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OrdersApi#postOrders")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
idempotencyKey kotlin.String A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). [optional]
createOrderRequest CreateOrderRequest [optional]

Return type

CreateOrderResponse

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

postOrdersCancel

CancelOrderResponse postOrdersCancel(idempotencyKey, cancelOrderRequest)

Cancel an order

Cancels an order. Cancellation of an order results in an automatic rollback of all payments made in the order, either by canceling or refunding the payment, depending on the type of payment method.

Example

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

val apiInstance = OrdersApi()
val idempotencyKey : kotlin.String = 37ca9c97-d1d1-4c62-89e8-706891a563ed // kotlin.String | A unique identifier for the message with a maximum of 64 characters (we recommend a UUID).
val cancelOrderRequest : CancelOrderRequest =  // CancelOrderRequest | 
try {
    val result : CancelOrderResponse = apiInstance.postOrdersCancel(idempotencyKey, cancelOrderRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OrdersApi#postOrdersCancel")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OrdersApi#postOrdersCancel")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
idempotencyKey kotlin.String A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). [optional]
cancelOrderRequest CancelOrderRequest [optional]

Return type

CancelOrderResponse

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

postPaymentMethodsBalance

BalanceCheckResponse postPaymentMethodsBalance(idempotencyKey, balanceCheckRequest)

Get the balance of a gift card

Retrieves the balance remaining on a shopper's gift card. To check a gift card's balance, make a POST `/paymentMethods/balance` call and include the gift card's details inside a `paymentMethod` object.

Example

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

val apiInstance = OrdersApi()
val idempotencyKey : kotlin.String = 37ca9c97-d1d1-4c62-89e8-706891a563ed // kotlin.String | A unique identifier for the message with a maximum of 64 characters (we recommend a UUID).
val balanceCheckRequest : BalanceCheckRequest =  // BalanceCheckRequest | 
try {
    val result : BalanceCheckResponse = apiInstance.postPaymentMethodsBalance(idempotencyKey, balanceCheckRequest)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OrdersApi#postPaymentMethodsBalance")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OrdersApi#postPaymentMethodsBalance")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
idempotencyKey kotlin.String A unique identifier for the message with a maximum of 64 characters (we recommend a UUID). [optional]
balanceCheckRequest BalanceCheckRequest [optional]

Return type

BalanceCheckResponse

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