Link Search Menu Expand Document

Merchant Configs

A Merchant Config defines the available payment options for paying a Payment Request.

Contents

Models

Merchant Config

Required Fields

Field Type Description
paymentOptions Array Array of Payment Option Configs.

Optional Fields

Field Type Description
allowedRedirectUrls Array Experimental Allowed prefixes for the redirectUrl property on Payment Requests created with this Config.

Payment Option Config

Required Fields

Field Type Description
type String Type of payment method. See supported payment types below.

Optional Fields

Field Type Description
walletId String Merchant’s Centrapay Settlement Wallet to receive payments. Required for centrapay.nzd types.
terminalId String Merchant’s Epay terminal id.
wavesPublicAddress String Merchant’s public waves address. Required for zap.main types.

See Asset Types for values that may be present in the type field.

Warning: Test payment options should never be used for live merchant configurations.

Operations

Create a Merchant Config

POST /api/merchants/{merchantId}/configs/

curl -X POST https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs/ \
  -H "X-Api-Key: $api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "paymentOptions": [
      {
        "type": "centrapay.nzd.main",
        "walletId": "1234c486308f3f0a23f0f92b"
      },
      {
        "type": "epay.nzd.main",
        "terminalId": "11000021"
      },
      {
        "type": "pocketvouchers"
      }
    ]
  }'

Example response payload

{
  "id": "5ee168e8597be5002af7b454",
  "merchantId": "5ee0c486308f590260d9a07f",
  "paymentOptions": [
    {
        "type": "pocketvouchers"
    },
    {
      "type": "centrapay.nzd.test",
      "walletId": "1234c486308f3f0a23f0f92b"
    }
  ]
}

Get a Merchant Config

GET /api/merchants/{merchantId}/configs/{configId}

curl https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs/5ee168e8597be5002af7b454 \
  -H "X-Api-Key: $api_key"

Example response payload

{
  "id": "5ee168e8597be5002af7b454",
  "merchantId": "5ee0c486308f590260d9a07f",
  "paymentOptions": [
    {
      "type": "pocketvouchers"
    }
  ]
}

List Merchant Configs

GET /api/merchants/{merchantId}/configs/

curl https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs/ \
  -H "X-Api-Key: $api_key"

Example response payload

[
  {
    "id": "5ee168e8597be5002af7b454",
    "merchantId": "5ee0c486308f590260d9a07f",
    "paymentOptions": [
      {
        "type": "pocketvouchers"
      }
    ]
  },
  {
    "id": "5ee168e8597be5002af7baed",
    "merchantId": "5ee0c486308f590260d9a07f",
    "paymentOptions": [
      {
        "type": "test"
      }
    ]
  }
]

Update a Merchant Config

PUT /api/merchants/{merchantId}/configs/{configId}

curl -X PUT https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs/5ee168e8597be5002af7baed \
  -H "X-Api-Key: $api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "paymentOptions": [
      {
        "type": "bitcoin.main"
      },
      {
        "type": "centrapay.nzd.test",
        "walletId": "1234c486308f3f0a23f0f92b"
      }
    ]
  }'

Example response payload

{
  "id": "5ee168e8597be5002af7baed",
  "merchantId": "5ee0c486308f590260d9a07f",
  "paymentOptions": [
    {
      "type": "bitcoin.main"
    },
    {
      "type": "centrapay.nzd.test",
      "walletId": "1234c486308f3f0a23f0f92b"
    }
  ]
}