APG PayAPG Paydocs

Marketplaces

Create marketplace fee structures

POST/marketplace-fee-structures

Add a fee structure to a marketplace, for one sub-merchant or for all of them.

Permissions

Required permission
marketplaces:update

Requires the `update` action on `marketplaces` for the supplied runtime context

Request body

This body is a tagged shape: type is always "MktpfeestructCmdCreate". Send it; more variants can be added, and a caller that switches on it keeps working when they are.

Discriminated by type
type = "MktpfeestructCmdCreate"
marketplaceIdMktpIdrequired

The marketplace whose earnings these are.

Example mktp_9f2Kd8QpLzXw

marketplaceMerchantIdMchtIdrequired

The marketplace's own merchant entity, where the earnings are credited.

Example mcht_9f2Kd8QpLzXw

subMerchantIdMchtId

The sub-merchant it applies to. Omit to apply it to every sub-merchant of the marketplace.

Example mcht_9f2Kd8QpLzXw

enabledbooleanrequired

false configures it without earning on it yet.

Example true

curl -X POST https://api.tst.au.apgpay.dev/marketplace-fee-structures \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "MktpfeestructCmdCreate",
  "marketplaceId": "mktp_9f2Kd8QpLzXw",
  "marketplaceMerchantId": "mcht_9f2Kd8QpLzXw",
  "subMerchantId": "mcht_9f2Kd8QpLzXw",
  "fees": {
    "type": "FeesByPaymentForm",
    "fees": {
      "type": "FeeStructAttributes",
      "split": {
        "type": "FeeTableAttributes",
        "domestic": {
          "type": "FeeAttributes",
          "rate": 0.9412,
          "fixed": 1250,
          "cards": [
            {
              "type": "CardFeeAttributes",
              "cardFunding": "Credit",
              "cardBrand": "Visa",
              "rate": 0.9412,
              "fixed": 1250
            }
          ]
        },
        "international": {
          "type": "FeeAttributes",
          "rate": 0.9412,
          "fixed": 1250,
          "cards": [
            {
              "type": "CardFeeAttributes",
              "cardFunding": "Credit",
              "cardBrand": "Visa",
              "rate": 0.9412,
              "fixed": 1250
            }
          ]
        }
      },
      "full": {
        "type": "FeeTableAttributes",
        "domestic": {
          "type": "FeeAttributes",
          "rate": 0.9412,
          "fixed": 1250,
          "cards": [
            {
              "type": "CardFeeAttributes",
              "cardFunding": "Credit",
              "cardBrand": "Visa",
              "rate": 0.9412,
              "fixed": 1250
            }
          ]
        },
        "international": {
          "type": "FeeAttributes",
          "rate": 0.9412,
          "fixed": 1250,
          "cards": [
            {
              "type": "CardFeeAttributes",
              "cardFunding": "Credit",
              "cardBrand": "Visa",
              "rate": 0.9412,
              "fixed": 1250
            }
          ]
        }
      }
    }
  },
  "enabled": true
}'

Responses

The response is a tagged shape: type is always "MktpfeestructCreateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.

Discriminated by type
type = "MktpfeestructCreateRspAttributes"

The resource that was created.

Example
{
  "type": "MktpfeestructCreateRspAttributes",
  "created": {
    "type": "MktpfeestructViewAttributes",
    "feeStructureId": "mktpfeestruct_9f2Kd8QpLzXw",
    "marketplaceId": "mktp_9f2Kd8QpLzXw",
    "marketplaceMerchantId": "mcht_9f2Kd8QpLzXw",
    "subMerchantId": "mcht_9f2Kd8QpLzXw",
    "fees": {
      "type": "FeesByPaymentForm",
      "fees": {
        "type": "FeeStructAttributes",
        "split": {
          "type": "FeeTableAttributes",
          "domestic": {
            "type": "FeeAttributes",
            "rate": 0.9412,
            "fixed": 1250,
            "cards": [
              {
                "type": "CardFeeAttributes",
                "cardFunding": "Credit",
                "cardBrand": "Visa",
                "rate": 0.9412,
                "fixed": 1250
              }
            ]
          },
          "international": {
            "type": "FeeAttributes",
            "rate": 0.9412,
            "fixed": 1250,
            "cards": [
              {
                "type": "CardFeeAttributes",
                "cardFunding": "Credit",
                "cardBrand": "Visa",
                "rate": 0.9412,
                "fixed": 1250
              }
            ]
          }
        },
        "full": {
          "type": "FeeTableAttributes",
          "domestic": {
            "type": "FeeAttributes",
            "rate": 0.9412,
            "fixed": 1250,
            "cards": [
              {
                "type": "CardFeeAttributes",
                "cardFunding": "Credit",
                "cardBrand": "Visa",
                "rate": 0.9412,
                "fixed": 1250
              }
            ]
          },
          "international": {
            "type": "FeeAttributes",
            "rate": 0.9412,
            "fixed": 1250,
            "cards": [
              {
                "type": "CardFeeAttributes",
                "cardFunding": "Credit",
                "cardBrand": "Visa",
                "rate": 0.9412,
                "fixed": 1250
              }
            ]
          }
        }
      }
    },
    "enabled": true,
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses