Customers

Validate metadata

Validate metadata against merchant schema and return validation results.

post/v4/customers/validate-metadata

Request

  • Base URL
    https://api.slopepay.com
  • URL
    https://api.slopepay.com/v4/customers/validate-metadata
  • Auth
    HTTP basic

Request body

metadataobject required

Metadata object to validate against merchant schema

Example request

{
  "metadata": {
    "joinDateRange": "L1",
    "lastTransactionDateRange": "L2",
    "customerTier": "gold"
  }
}

Response

Validation results for the provided metadata.

isValidboolean required

Whether the metadata is valid according to the schema

validFieldsobject required

Metadata fields that passed validation

cleanedResultobject required

The cleaned metadata that would be saved

Example response

{
  "validFields": {
    "joinDateRange": "L1",
    "customerTier": "gold"
  },
  "ignoredFields": [
    "unknownField",
    "invalidEnumValue"
  ],
  "errors": [
    "lastTransactionDateRange: must be one of L1, L2, L3, L4, L5"
  ],
  "cleanedResult": {
    "joinDateRange": "L1",
    "customerTier": "gold"
  }
}

Changes

No recorded changes to this operation across all 2 revisions of this API.