Merchant Configs

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

Attributes

  • paymentOptions

    array
  • createdAt

    timestamp

    When the Merchant Config was created.

  • createdBy

    crn

    The User or API Key that created the Merchant Config.

  • updatedAt

    timestamp

    When the Merchant Config was updated.

  • updatedBy

    crn

    The User or API Key that updated the Merchant Config.

  • allowedRedirectUrls

    arrayexperimental

    Allowed prefixes for the redirectUrl property on Payment Requests created with this Config.


Attributes

  • type

    stringrequired

    Type of payment method. See supported payment types below.

  • walletId

    string

    Merchant’s Centrapay Settlement Wallet to receive payments. Optional for centrapay.nzd types, if not supplied then a settlement wallet may be created and then assigned.

  • terminalId

    string

    Merchant’s Epay terminal id.

  • paypalMerchantAccountId

    string

    Id of the PayPal merchants account. Required for paypal.usd and venmo.usd types.

  • paypalStoreId

    string

    Id of the PayPal merchants store. Required for paypal.usd and venmo.usd types.

  • farmlandsMerchantNumber

    string

    Id of the Farmlands merchant that funds will be transferred to.

  • externalMerchantId

    string

    Id of the external merchant. Required for stadius and uplinkapi.test types.

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

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


POST/api/merchants/{merchantId}/configs

This endpoint allows you to create a Merchant Config for a Merchant.

Attributes

  • paymentOptions

    arrayrequired
  • allowedRedirectUrls

    arrayexperimental

    Allowed prefixes for the redirectUrl property on Payment Requests created with this Config.

Errors

Request
POST/api/merchants/5ee0c486308f590260d9a07f/configs
curl -X POST \
 https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs \
 -H 'content-type: application/json' \
 -H 'x-api-key: <TOKEN>' \
 -d '
{
 "paymentOptions": [
  {
   "type": "centrapay.nzd.main",
   "walletId": "1234c486308f3f0a23f0f92b"
  },
  {
   "type": "epay.nzd.main",
   "terminalId": "11000021"
  },
  {
   "type": "farmlands.nzd.main",
   "farmlandsMerchantNumber": "DbgY2SyD5M85zkePJjsQEf"
  }
 ]
}
'
Response
{
  "id": "5ee168e8597be5002af7b454",
  "merchantId": "5ee0c486308f590260d9a07f",
  "createdAt": "2021-11-12T01:17:46.499Z",
  "updatedAt": "2021-11-12T01:17:46.499Z",
  "createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
  "updatedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
  "paymentOptions": [
    {
      "type": "centrapay.nzd.main",
      "walletId": "1234c486308f3f0a23f0f92b"
    },
    {
      "type": "epay.nzd.main",
      "terminalId": "11000021"
    },
    {
      "type": "farmlands.nzd.main",
      "farmlandsMerchantNumber": "DbgY2SyD5M85zkePJjsQEf"
    }
  ]
}

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

This endpoint allows you to retrieve a Merchant Config by id.

Request
GET/api/merchants/5ee0c486308f590260d9a07f/configs/5ee168e8597be5002af7b454
curl -X GET \
 https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs/5ee168e8597be5002af7b454 \
 -H 'x-api-key: <TOKEN>'
Response
{
  "id": "5ee168e8597be5002af7b454",
  "merchantId": "5ee0c486308f590260d9a07f",
  "createdAt": "2021-11-12T01:17:46.499Z",
  "updatedAt": "2021-11-12T01:17:46.499Z",
  "createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
  "updatedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
  "paymentOptions": [
    {
      "type": "farmlands.nzd.main",
      "farmlandsMerchantNumber": "DbgY2SyD5M85zkePJjsQEf"
    }
  ]
}

GET/api/merchants/{merchantId}/configs

This endpoint allows you to retrieve a list of Merchant Configs.

Request
GET/api/merchants/5ee0c486308f590260d9a07f/configs
curl -X GET \
 https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs \
 -H 'x-api-key: <TOKEN>'
Response
[
  {
    "id": "5ee168e8597be5002af7b454",
    "merchantId": "5ee0c486308f590260d9a07f",
    "createdAt": "2021-09-12T01:17:46.499Z",
    "updatedAt": "2021-09-12T01:17:46.499Z",
    "createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
    "updatedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
    "paymentOptions": [
      {
        "type": "farmlands.nzd.main",
        "farmlandsMerchantNumber": "DbgY2SyD5M85zkePJjsQEf"
      }
    ]
  },
  {
    "id": "5ee168e8597be5002af7baed",
    "merchantId": "5ee0c486308f590260d9a07f",
    "createdAt": "2021-11-12T01:17:46.499Z",
    "updatedAt": "2021-11-12T01:17:46.499Z",
    "createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
    "updatedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
    "paymentOptions": [
      {
        "type": "test"
      }
    ]
  }
]

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

This endpoint allows you to update a Merchant Config.

Attributes

  • paymentOptions

    arrayrequired
  • allowedRedirectUrls

    arrayexperimental

    Allowed prefixes for the redirectUrl property on Payment Requests created with this Config.

Errors

Request
PUT/api/merchants/5ee0c486308f590260d9a07f/configs/5ee168e8597be5002af7baed
curl -X PUT \
 https://service.centrapay.com/api/merchants/5ee0c486308f590260d9a07f/configs/5ee168e8597be5002af7baed \
 -H 'content-type: application/json' \
 -H 'x-api-key: <TOKEN>' \
 -d '
{
 "paymentOptions": [
  {
   "type": "bitcoin.main"
  },
  {
   "type": "centrapay.nzd.test",
   "walletId": "1234c486308f3f0a23f0f92b"
  },
  {
   "type": "farmlands.nzd.main",
   "farmlandsMerchantNumber": "DbgY2SyD5M85zkePJjsQEf"
  }
 ]
}
'
Response
{
  "id": "5ee168e8597be5002af7baed",
  "merchantId": "5ee0c486308f590260d9a07f",
  "createdAt": "2021-09-12T01:17:46.499Z",
  "updatedAt": "2021-12-12T01:17:46.499Z",
  "createdBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
  "updatedBy": "crn:WIj211vFs9cNACwBb04vQw:api-key:MyApiKey",
  "paymentOptions": [
    {
      "type": "bitcoin.main"
    },
    {
      "type": "centrapay.nzd.test",
      "walletId": "1234c486308f3f0a23f0f92b"
    },
    {
      "type": "farmlands.nzd.main",
      "farmlandsMerchantNumber": "DbgY2SyD5M85zkePJjsQEf"
    }
  ]
}