# Amazon Pay

> Manage Amazon Pay Checkout sessions, charges and refunds.

App · 14 actions. Web page: https://docs.lodol.com/docs/integrations/amazon-pay

## Actions

### Cancel charge

Cancel charge.

**Inputs**

- Charge ID (`charge_id`, text, required): Charge ID from the Amazon Pay transaction.
- Cancellation reason (`cancellation_reason`, text, required): Reason to cancel the charge.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "chargeId": "example",
    "statusDetails": {}
  }
}
```

### Capture charge

Capture charge.

**Inputs**

- Charge ID (`charge_id`, text, required): Charge ID from the Amazon Pay transaction.
- Idempotency key (`idempotency_key`, text, required): Unique key for this operation. Reuse it if you retry the same operation.
- Amount (`amount`, text, required): Amount in major currency units, such as 12.50.
- Currency code (`currency_code`, text, required): Currency of the amount. One of: `USD`, `EUR`, `GBP`, `JPY`, `AUD`, `CAD`, `CHF`, `DKK`, `HKD`, `NOK`, and 3 more.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "chargeId": "example",
    "statusDetails": {}
  }
}
```

### Close charge permission

Close charge permission.

**Inputs**

- Charge permission ID (`charge_permission_id`, text, required): Charge Permission ID from Amazon Pay checkout.
- Closure reason (`closure_reason`, text, required): Reason to close the permission.
- Cancel pending charges (`cancel_pending_charges`, true/false): Cancel pending charges as well.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "chargePermissionId": "example",
    "statusDetails": {}
  }
}
```

### Complete checkout session

Finish a checkout after the buyer returns from Amazon Pay, which charges or holds the amount as the session was set up to. The amount must match the session's.

**Inputs**

- Checkout session ID (`checkout_session_id`, text, required): Checkout session ID from Create checkout session.
- Idempotency key (`idempotency_key`, text, required): Unique key for this operation. Reuse it if you retry the same operation.
- Amount (`amount`, text, required): Amount in major currency units, such as 12.50; the same as the session's.
- Currency code (`currency_code`, text, required): Currency of the amount. One of: `USD`, `EUR`, `GBP`, `JPY`, `AUD`, `CAD`, `CHF`, `DKK`, `HKD`, `NOK`, and 3 more.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "chargeId": "example",
    "chargePermissionId": "example",
    "checkoutSessionId": "example",
    "statusDetails": {}
  }
}
```

### Create charge

Create charge.

**Inputs**

- Idempotency key (`idempotency_key`, text, required): Unique key for this operation. Reuse it if you retry the same operation.
- Charge permission ID (`charge_permission_id`, text, required): Charge Permission ID from checkout.
- Amount (`amount`, text, required): Amount in major currency units, such as 12.50.
- Currency code (`currency_code`, text, required): Currency of the amount. One of: `USD`, `EUR`, `GBP`, `JPY`, `AUD`, `CAD`, `CHF`, `DKK`, `HKD`, `NOK`, and 3 more.
- Capture now (`capture_now`, true/false): Capture the charge immediately.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "chargeId": "example",
    "statusDetails": {}
  }
}
```

### Create checkout session

Create checkout session.

**Inputs**

- Idempotency key (`idempotency_key`, text, required): Unique key for this operation. Reuse it if you retry the same operation.
- Store ID (`store_id`, text): Store ID from Integration Central.
- Review return URL (`review_return_url`, text): HTTPS URL where buyers return to review checkout.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "checkoutSessionId": "example",
    "statusDetails": {},
    "webCheckoutDetails": {}
  }
}
```

### Create refund

Create refund.

**Inputs**

- Idempotency key (`idempotency_key`, text, required): Unique key for this operation. Reuse it if you retry the same operation.
- Charge ID (`charge_id`, text, required): Charge ID to refund.
- Amount (`amount`, text, required): Amount in major currency units, such as 12.50.
- Currency code (`currency_code`, text, required): Currency of the amount. One of: `USD`, `EUR`, `GBP`, `JPY`, `AUD`, `CAD`, `CHF`, `DKK`, `HKD`, `NOK`, and 3 more.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "refundId": "example",
    "statusDetails": {}
  }
}
```

### Get buyer

Look up the Amazon Pay buyer who signed in with Amazon on your site: their name, email and buyer ID.

**Inputs**

- Buyer token (`buyer_token`, text, required): The buyer token Amazon Pay added to your sign-in return page's address.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "buyerId": "example",
    "countryCode": "example",
    "email": "example",
    "name": "example",
    "postalCode": "example"
  }
}
```

### Get charge

Get charge.

**Inputs**

- Charge ID (`charge_id`, text, required): Charge ID from the Amazon Pay transaction.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "chargeAmount": {},
    "chargeId": "example",
    "statusDetails": {}
  }
}
```

### Get charge permission

Get charge permission.

**Inputs**

- Charge permission ID (`charge_permission_id`, text, required): Charge Permission ID from Amazon Pay checkout.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "chargePermissionId": "example",
    "statusDetails": {}
  }
}
```

### Get checkout session

Get checkout session.

**Inputs**

- Checkout session ID (`checkout_session_id`, text, required): Checkout session ID from Create checkout session.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "checkoutSessionId": "example",
    "statusDetails": {},
    "webCheckoutDetails": {}
  }
}
```

### Get refund

Get refund.

**Inputs**

- Refund ID (`refund_id`, text, required): Refund ID from Create refund.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "refundAmount": {},
    "refundId": "example",
    "statusDetails": {}
  }
}
```

### Update charge permission

Add or change your order number, store name or note to the buyer on a charge permission after checkout. Amazon Pay may show these to the buyer.

**Inputs**

- Charge permission ID (`charge_permission_id`, text, required): Charge Permission ID from Amazon Pay checkout.
- Merchant reference ID (`merchant_reference_id`, text): Your own order number.
- Merchant store name (`merchant_store_name`, text): Your store's name.
- Note to buyer (`note_to_buyer`, text): A short note to the buyer.
- Custom information (`custom_information`, text): Your own notes, not shown to the buyer.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "chargePermissionId": "example",
    "merchantMetadata": {},
    "statusDetails": {}
  }
}
```

### Update checkout session

Set the amount, what happens to the payment and your order details on a checkout session before the buyer is sent to Amazon Pay to confirm it. Nothing is charged yet.

**Inputs**

- Checkout session ID (`checkout_session_id`, text, required): Checkout session ID from Create checkout session.
- Checkout result return URL (`checkout_result_return_url`, text): HTTPS page buyers return to after confirming the payment on Amazon Pay.
- Payment intent (`payment_intent`, text): What happens to the payment: Confirm only checks it, Authorize holds the money for you to capture later, AuthorizeWithCapture takes it at once. One of: `Confirm`, `Authorize`, `AuthorizeWithCapture`.
- Amount (`amount`, text): Amount to charge in major currency units, such as 12.50.
- Currency code (`currency_code`, text): Currency of the amount. Needed with an amount. One of: `USD`, `EUR`, `GBP`, `JPY`, `AUD`, `CAD`, `CHF`, `DKK`, `HKD`, `NOK`, and 3 more.
- Merchant reference ID (`merchant_reference_id`, text): Your own order number, shown to the buyer.
- Merchant store name (`merchant_store_name`, text): Your store's name, shown to the buyer.
- Note to buyer (`note_to_buyer`, text): A short note shown to the buyer.

**Outputs**

- `data` (object): The response from Amazon Pay.

**Example output**

```json
{
  "data": {
    "checkoutSessionId": "example",
    "merchantMetadata": {},
    "paymentDetails": {},
    "statusDetails": {},
    "webCheckoutDetails": {}
  }
}
```
