Link Search Menu Expand Document

Merchants

A merchant is member of the centrapay account. Merchant can have different configurations with different payment methods.

Contents

Creating merchant

POST https://service.centrapay.com/api/merchants

curl -X POST "https://service.centrapay.com/api/merchants" \
  -H "x-api-key: 1234" \
  -H "content-type: application/json" \
  -d '{
    "accountId": "C4QnjXvj8At6SMsEN4LRi9",
    "name": "Centrapay Cafe Auckland",
    "country": "NZ",
    "test": false
  }'

Required Fields

Field Type Description
accountId String Owning account reference
name String Merchant name
country String Merchants country in alpha 2 standard
test Boolean Flag configuring if this is test merchant

Optional Fields

Field Type Description
settlementConfig Object EXPERIMENTAL Merchant settlement config

Example response payload

{
  "id": "5ee0c486308f590260d9a07f",
  "accountId": "yqwyya0rzz3vvshqw0474u89xtj5fn",
  "name": "Parisian - Brown",
  "country": "AD",
  "test": false
}

Get information about a merchant

GET https://service.centrapay.com/api/merchants/{merchantId}

curl -X GET "https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f" \
  -H "x-api-key: 1234"

Example response payload

{
  "id": "5ee0c486308f590260d9a07f",
  "accountId": "yqwyya0rzz3vvshqw0474u89xtj5fn",
  "name": "Parisian - Brown",
  "test": false,
  "country": "AD"
}

List all merchants

GET https://service.centrapay.com/api/merchants

curl -X GET "https://service.centrapay.com/api/merchants" \
-H "x-api-key: 1234"

Example response payload

{
  "items": [
    {
      "accountId": "3xsjxxwmnpkunjbcpekyekc84rzxr4",
      "country": "BT",
      "id": "5f6bf6ff81552101f8ff6122",
      "name": "Adams, Runolfsdottir and Botsford",
      "test": true
    },
    {
      "accountId": "3xsjxxwmnpkunjbcpekyekc84rzxr4",
      "country": "GM",
      "id": "5f6bf6ff81552101f8ff6123",
      "name": "Vandervort Inc",
      "test": false
    },
    {
      "accountId": "3xsjxxwmnpkunjbcpekyekc84rzxr4",
      "country": "MZ",
      "id": "5f6bf6ff81552101f8ff6124",
      "name": "West, O'Reilly and Huels",
      "test": true
    },
  ]
}

Update a merchant

PUT https://service.centrapay.com/api/merchants/{merchantId}

curl -X PUT "https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f" \
  -H "x-api-key: 1234" \
  -H "content-type: application/json" \
  -d '{"name": "Parisian - Orange"}'

Optional Fields

Field Type Description
name String Merchant name
country String Merchants country in alpha 2 standard
settlementConfig Object EXPERIMENTAL Merchant settlement config

Example response payload

{
  "id": "5ee0c486308f590260d9a07f",
  "accountId": "yqwyya0rzz3vvshqw0474u89xtj5fn",
  "name": "Parisian - Orange",
  "test": false,
  "country": "AD"
}

Creating merchant configuration

POST https://service.centrapay.com/api/merchants/{merchantId}/configs/

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

See Merchant configuration model for expected request body format.

Example response payload

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

Get merchant configuration

GET https://service.centrapay.com/api/merchants/{merchantId}/configs/{id}

curl -X GET "https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs/5ee168e8597be5002af7b454" \
  -H "x-api-key: 1234"

Example response payload

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

List all merchant configurations

GET https://service.centrapay.com/api/merchants/{merchantId}/configs/

curl -X GET "https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs/" \
  -H "x-api-key: 1234"

Example response payload

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

Update merchant configuration

PUT https://service.centrapay.com/api/merchants/{merchantId}/configs/{id}

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

See Merchant configuration model for expected request body format.

Example response payload

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

Merchant configuration model

Required Fields

Field Type Description
paymentOptions Array Array of paymentOptions objects
paymentOptions[*] Object Object containing paymentOption properties
paymentOptions[*].type String Type of payment method. See supported payment types below.

Optional Fields

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

Supported Payment Types

The following table describes the supported payment option types.

Warning: Test payment options should never be used for live merchant configurations.
Name Description
centrapay.nzd.main Centrapay NZD wallet
centrapay.nzd.test Centrapay NZD wallet (test ledger)
bitcoin.main Bitcoin
epay.nzd.main EPay NZ giftcards
epay.nzd.test EPay NZ giftcards (test ledger)
cca.coke.main Coke tokens
cca.coke.test Coke tokens (test ledger)
cennznet.main Cennznet
pocketvouchers Pocket Vouchers
zap.main Zap tokens
test No-op test payment (always approved)