Back to top

Blaize public API documentation

Authentication

Login

Login
POST/blaize/login

User Login

Example URI

POST /blaize/login
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: blaize_session=... (optional)
Body
{
  "identifiers": {
    "email_address": "joe.blow@company.com"
  },
  "validators": {
    "password": "mysecurepassword123",
    "use_sso": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    },
    "validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        },
        "use_sso": {
          "type": "boolean",
          "description": "When this is present there should be no identifiers in the body. The user is identified through a blaize_session cookie."
        }
      }
    }
  },
  "required": [
    "identifiers",
    "validators"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "cookie": "blaize_session=0123456789ABCD; Expires=Fri, 16 Nov 2018 12:35:56 GMT; Path=/;",
  "message": "Registration successful",
  "tracking_id": "TT0123456789ABCD"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "cookie": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "tracking_id": {
      "type": "string"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Logout

Logout
POST/blaize/logout

User Logout

Example URI

POST /blaize/logout
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "where": "EVERYWHERE"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "where": {
      "type": "string",
      "description": "An enum of describing which sessions/devices to log out of.\n\nOptions are `JUST_HERE`, `THIS_DEVICE`, `OTHER_DEVICES`, `EVERYWHERE`.\nThese options are only valid when Single Sign-On is configured.\nWhen SSO is configured as `autoLogin`, then the default behaviour is `THIS_DEVICE`.\nWhen SSO is configured as `optIn`, then the default behaviour is `JUST_HERE`.\n`JUST_HERE` is not a valid option when SSO is configured as `autoLogin`."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Session deleted"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json

Zephr Public Sso V1 Status

RetrieveSsoStatus
GET/zephr/public/sso/v1/status

Retrieve the SSO status and metadata of the current user.

Example URI

GET /zephr/public/sso/v1/status
Response  200
HideShow

SSO status was retrieved successfully

Headers
Content-Type: application/json
Body
{
  "status": "authenticated",
  "meta": {}
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "The SSO status of the current user session. This can be:\n\n- `unknown`: The SSO token is not authenticated anywhere, or the current session is not associated with an SSO token.\n\n- `known`: The current session is anonymous, but the SSO token is authenticated on another site.\n\n- `authenticated`: The current session is authenticated through an SSO token."
    },
    "meta": {
      "type": [
        "object",
        "null"
      ],
      "properties": {}
    }
  },
  "required": [
    "status"
  ]
}

Zephr Public Sso V1 Status Meta

UpdateMeta
PUT/zephr/public/sso/v1/status/meta

Update the SSO metadata associated with the user.

Example URI

PUT /zephr/public/sso/v1/status/meta
Request
HideShow
Headers
Content-Type: application/json
Body
{}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {}
}
Response  200
HideShow
Body
Metadata updated successfully.
Response  400
HideShow
Headers
Content-Type: application/json
Body
There was a problem with the request data

Start Passwordless

Important Info

For passwordless authentication, first is required to send a POST to request an email to be sent to the User’s email with a link for the user to click on to verify his email.

Start Passwordless
POST/blaize/token-exchange

Start Passwordless Authentication

Example URI

POST /blaize/token-exchange
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "identifiers": {
    "email_address": "joe.blow@company.com"
  },
  "delivery": {
    "method": "email",
    "destination": "joe.blow@company.com",
    "action": "login",
    "redirect": "/"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    },
    "delivery": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string"
        },
        "destination": {
          "type": "string"
        },
        "action": {
          "type": "string"
        },
        "redirect": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "identifiers",
    "delivery"
  ]
}
Response  201
Response  400
HideShow
Headers
Content-Type: application/json

Complete Passwordless

Complete Passwordless
GET/blaize/token-exchange/

Complete Passwordless Authentication

Example URI

GET /blaize/token-exchange/
Response  302
HideShow
Headers
Location: (string)
Set-Cookie: (string)
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Start Password Reset

Important Info

To reset a User password, first is required to send a POST to request an email to be sent to the User’s email with a link for the user to click on so as to verify that he requested this password change.

Start password reset
POST/blaize/users/reset

Start password reset

Example URI

POST /blaize/users/reset
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "identifiers": {
    "email_address": "joe.blow@company.com"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "identifiers"
  ]
}
Response  200
Response  404
Response  400
HideShow
Headers
Content-Type: application/json

Complete Password Reset

Complete password reset
POST/blaize/users/reset/{state}

Complete password reset

Example URI

POST /blaize/users/reset/state
URI Parameters
HideShow
state
string (required) 

Unique State identifier

Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "validators": {
    "password": "mysecurepassword123",
    "use_sso": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        },
        "use_sso": {
          "type": "boolean",
          "description": "When this is present there should be no identifiers in the body. The user is identified through a blaize_session cookie."
        }
      }
    }
  },
  "required": [
    "validators"
  ]
}
Response  200
Response  404
Response  400
HideShow
Headers
Content-Type: application/json

Password Reset Form

Password Reset Form
GET/blaize/blaize/password-reset.html

Returns the Password Reset Form

Example URI

GET /blaize/blaize/password-reset.html
Response  200
HideShow
Headers
Content-Type: text/html

Anonymous Session

Anonymous Session
POST/blaize/anonymous-session

Create anonymous session.

Example URI

POST /blaize/anonymous-session
Request  with body
HideShow
Headers
Content-Type: application/json
Response  201
HideShow
Headers
Content-Type: application/json
Set-Cookie: blaize_session=5562c0cf-b07a-42d0-ac1a-c0e29735e73a; Expires=Tue, 1 Jan 2019 12:00:00 GMT; Path=/;
Set-Cookie: blaize_tracking_id=33d576c7-d036-40e7-8141-8a91998a5c79; Expires=Tue, 1 Jan 2019 12:00:00 GMT; Path=/;
Body
{
  "message": "Anonymous session created successfully",
  "tracking_id": "33d576c7-d036-40e7-8141-8a91998a5c79"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    },
    "tracking_id": {
      "type": "string"
    }
  }
}

Start update email request

Start update your current email address
POST/blaize/users/update-email

Example URI

POST /blaize/users/update-email
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "new_identifiers": {
    "email_address": "joe.blow@company.com"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "new_identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "new_identifiers"
  ]
}
Response  200
Response  404
Response  400
HideShow
Headers
Content-Type: application/json

Complete update email request

Complete update your current email address
POST/blaize/users/update-email/

Example URI

POST /blaize/users/update-email/
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "validators": {
    "password": "mysecurepassword123",
    "use_sso": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        },
        "use_sso": {
          "type": "boolean",
          "description": "When this is present there should be no identifiers in the body. The user is identified through a blaize_session cookie."
        }
      }
    }
  },
  "required": [
    "validators"
  ]
}
Response  200
Response  404
Response  400
HideShow
Headers
Content-Type: application/json

Update email request Form

Update email request Form
GET/blaize/update-email.html

Returns the update email request Form

Example URI

GET /blaize/update-email.html
Response  200
HideShow
Headers
Content-Type: text/html

Change password request

Change your password
POST/blaize/users/change-password

Example URI

POST /blaize/users/change-password
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "current_validators": {
    "password": "mysecurepassword123",
    "use_sso": true
  },
  "new_validators": {
    "password": "mysecurepassword123",
    "use_sso": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "current_validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        },
        "use_sso": {
          "type": "boolean",
          "description": "When this is present there should be no identifiers in the body. The user is identified through a blaize_session cookie."
        }
      }
    },
    "new_validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        },
        "use_sso": {
          "type": "boolean",
          "description": "When this is present there should be no identifiers in the body. The user is identified through a blaize_session cookie."
        }
      }
    }
  },
  "required": [
    "current_validators",
    "new_validators"
  ]
}
Response  200
Response  403
Response  404
Response  400
HideShow
Headers
Content-Type: application/json

User

Register

Register
POST/blaize/register

Register a new User

Example URI

POST /blaize/register
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "identifiers": {
    "email_address": "joe.blow@company.com"
  },
  "validators": {
    "password": "mysecurepassword123",
    "use_sso": true
  },
  "attributes": {
    "first_name": "Joe",
    "surname": "Blow"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    },
    "validators": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string"
        },
        "use_sso": {
          "type": "boolean",
          "description": "When this is present there should be no identifiers in the body. The user is identified through a blaize_session cookie."
        }
      }
    },
    "attributes": {
      "type": "object",
      "properties": {
        "first_name": {
          "type": "string"
        },
        "surname": {
          "type": "string"
        }
      }
    }
  },
  "required": [
    "identifiers",
    "validators"
  ]
}
Response  201
HideShow
Body
{
  "cookie": "blaize_session=0123456789ABCD; Expires=Fri, 16 Nov 2018 12:35:56 GMT; Path=/;",
  "message": "Registration successful",
  "tracking_id": "TT0123456789ABCD"
}
Schema
{
  "type": "object",
  "properties": {
    "cookie": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "tracking_id": {
      "type": "string"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  400
HideShow
Headers
Content-Type: application/json

Forget Me

Forget Me
POST/blaize/forget-me

Delete user related data like sessions, elasticSearch data, O2Auth tokens by the provided user_id in the session cookie.

Example URI

POST /blaize/forget-me
Request
HideShow
Headers
Cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User deleted successfully"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}
Response  500
HideShow
Headers
Content-Type: application/json

Account

Account
GET/blaize/account

Retrieves the user’s core account details

Example URI

GET /blaize/account
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "identifiers": {
    "email_address": "joe.blow@company.com"
  },
  "tracking_id": "123"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "identifiers": {
      "type": "object",
      "properties": {
        "email_address": {
          "type": "string"
        }
      }
    },
    "tracking_id": {
      "type": "string",
      "description": "456 (string)"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json

Profile

Profile
GET/blaize/profile

Retrieves the user’s profile

Example URI

GET /blaize/profile
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json

Save Profile
PUT/blaize/profile

Creates/Updates the user’s profile

Example URI

PUT /blaize/profile
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Update Profile
POST/blaize/profile

Updates the user’s profile, merging with any exist fields

Example URI

POST /blaize/profile
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Update Profile
PATCH/blaize/profile

Updates the user’s profile, merging with any exist fields

Example URI

PATCH /blaize/profile
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Extended Profile

Extended Profile
GET/blaize/profile/{appId}

Retrieves the user’s Extended Profile

Example URI

GET /blaize/profile/appId
URI Parameters
HideShow
appId
string (required) 

Unique Profile identifier. This cannot start with ‘_restricted’.

Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json

Save Extended Profile
PUT/blaize/profile/{appId}

Creates/Updates the user’s Extended Profile

Example URI

PUT /blaize/profile/appId
URI Parameters
HideShow
appId
string (required) 

Unique Profile identifier. This cannot start with ‘_restricted’.

Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Body
{
  "first_name": "Joe",
  "surname": "Blow"
}
Schema
{
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string"
    },
    "surname": {
      "type": "string"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Authorization Challenge

Authorization Challenge
POST/blaize/authorization/challenge

Authorization Challenge against array of entitlement IDs.

Example URI

POST /blaize/authorization/challenge
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: blaize_session=5562c0cf-b07a-42d0-ac1a-c0e29735e73a;...
Body
{
  "entitlementIds": [
    "68cc48be-e47e-4707-8958-1249d87fca86"
  ],
  "contentIdentifier": "/"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "entitlementIds": {
      "type": "array"
    },
    "contentIdentifier": {
      "type": "string"
    }
  },
  "required": [
    "entitlementIds"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "68cc48be-e47e-4707-8958-1249d87fca86": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "68cc48be-e47e-4707-8958-1249d87fca86": {
      "type": "boolean"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: application/json

Decision Engine

Decision Engine

The Blaize Decision Engine can be invoked via the Public API to calculate an HTTP Response based upon Request-Level Rules created in the Admin Console. This functionality is built into the Blaize Dynamic CDN but the API variant is useful for CMS or edge side integrations.

Decision Engine
POST/blaize/decision-engine

Example URI

POST /blaize/decision-engine
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "path": "/x.html",
  "http_method": "POST",
  "session": "xxx-xxx-xxx",
  "foreign_keys": {},
  "request_headers": {
    "User-Agent": "<userAgent>"
  },
  "content_metadata": {
    "publishedDate": "<contentAge>"
  },
  "jwt": "xxx-xxx-xxx",
  "btr": "17e74b9e49e66282e55d4b7ec73de951"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "path": {
      "type": "string"
    },
    "http_method": {
      "type": "string"
    },
    "session": {
      "type": "string"
    },
    "foreign_keys": {
      "type": "object",
      "properties": {},
      "description": "Foreign system and ID used to identify the user"
    },
    "request_headers": {
      "type": "object",
      "properties": {
        "User-Agent": {
          "type": "string"
        }
      }
    },
    "content_metadata": {
      "type": "object",
      "properties": {
        "publishedDate": {
          "type": "string"
        }
      }
    },
    "jwt": {
      "type": "string"
    },
    "btr": {
      "type": "string",
      "description": "MD5-hex-encoding of: path + \"|\" + trusted referrer secret"
    }
  },
  "required": [
    "path"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "301",
  "body": "Redirecting to login page...",
  "headers": {
    "Location": "/login.html"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "status": {
      "type": "string"
    },
    "body": {
      "type": "string"
    },
    "headers": {
      "type": "object",
      "properties": {
        "Location": {
          "type": "string"
        }
      }
    }
  }
}
Response  409

Decision Engine
GET/blaize/decision-engine{?path}{&session,foreign_id.xxx,content_id,jwt,btr}

For compatibility with CDN, any web headers (Referrer, User-Agent) will be accepted and passed onto the rule engine

Example URI

GET /blaize/decision-engine?path=&session=&foreign_id.xxx=&content_id=&jwt=&btr=
URI Parameters
HideShow
path
string (required) 

Uniquely identifies the content Zephr is making a decision about. Request rules can be configured to only execute when the request path matches a provided regular expression.

session
string (optional) 

Zephr Session ID - same as the blaize_session cookie used by the CDN and authentication endpoints

foreign_id.xxx
string (optional) 

Foreign ID used to identify the user. The foreign system is parsed as the remainder of the parameter key name following ‘foreign_id.’

content_id
string (optional) 

Passed as metadata.content_id to the Content API template, used to perform requests to a 3rd party API for additional content information used in making a decision

jwt
string (optional) 

A Json Web Token, may include identity or product holding claims

btr
string (optional) 

A trusted referrer token. If Zephr generates a matching token using path, passed-in Referer header and a configured secret, all entitlements used in this decision will be temporarily granted for this request

Response  200
HideShow

Response status and body are determined by the executed rule. If there is an error executing the rule, a 200 will be returned.

Dynamic Package Decision Engine

Dynamic Package Decision Engine

The Dynamic Package Decision Engine can be invoked via the Public API to calculate a decision output response based upon each property rule under the Dynamic Package created in the Zephr Console.

Process dynamic package decisions
POST/zephr/public/decisions/v1/dynamic-packages

Example URI

POST /zephr/public/decisions/v1/dynamic-packages
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "dynamic_package": {
    "slug": "packageX",
    "inputs": {}
  },
  "session": "xxx-xxx-xxx",
  "foreign_keys": {},
  "ip": "x.x.x.x",
  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11)...",
  "jwt": "xxx-xxx-xxx",
  "path": "/x.html"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "dynamic_package": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string",
          "description": "Dynamic Package slug"
        },
        "inputs": {
          "type": "object",
          "properties": {},
          "description": "Custom inputs configured in Dynamic Package. This can be any single layer map of key-value pairs."
        }
      },
      "required": [
        "slug"
      ],
      "description": "The dynamic package to evaluate, must specify the slug of the dynamic package, and any custom input to be used in the rules"
    },
    "session": {
      "type": "string",
      "description": "Zephr Session ID, required for trials"
    },
    "foreign_keys": {
      "type": "object",
      "properties": {},
      "description": "Foreign system and ID used to identify the user"
    },
    "ip": {
      "type": "string",
      "description": "Client IP address, defaults to request IP"
    },
    "user_agent": {
      "type": "string",
      "description": "Client user agent"
    },
    "jwt": {
      "type": "string",
      "description": "A Json Web Token, may include identity or product holding claims"
    },
    "path": {
      "type": "string",
      "description": "Request path, required for trials if used"
    }
  },
  "required": [
    "dynamic_package"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "results": [
    {
      "property": "product",
      "status": "SUCCESS",
      "outputType": "ENUM",
      "outputValue": "YES",
      "error": "500: Internal error ..."
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "description": "List of dynamic package decision outcomes. These will be ordered by the priority of each property's execution order, by default: Product rule is executed first then any other properties are executed in parallel."
    }
  },
  "required": [
    "results"
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json

SDK Feature Decision Engine

SDK Feature Decision Engine

The SDK Feature Decision Engine can be invoked via the Public API to calculate a decision output response based upon Feature SDK Rules created in the Zephr Console.

Process multiple decisions
POST/zephr/decide

Example URI

POST /zephr/decide
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "features": [
    {
      "slug": "featureX",
      "path": "/x.html",
      "contentId": "xxx-xxx-xxx",
      "inputs": {}
    }
  ],
  "session": "xxx-xxx-xxx",
  "foreign_keys": {},
  "ip": "x.x.x.x",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11)...",
  "jwt": "xxx-xxx-xxx"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "features": {
      "type": "array",
      "description": "The list of features to evaluate. This must be contain at least one element. Features are evaluated sequentially, in the order they are provided."
    },
    "session": {
      "type": "string",
      "description": "Zephr Session ID, required for trials"
    },
    "foreign_keys": {
      "type": "object",
      "properties": {},
      "description": "Foreign system and ID used to identify the user"
    },
    "ip": {
      "type": "string",
      "description": "Client IP address, defaults to request IP"
    },
    "userAgent": {
      "type": "string",
      "description": "Client user agent"
    },
    "jwt": {
      "type": "string",
      "description": "A Json Web Token, may include identity or product holding claims"
    }
  },
  "required": [
    "features"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "results": [
    {
      "sdkFeatureSlug": "featureX",
      "outputType": "ENUM",
      "outputValue": "YES",
      "error": "500: Internal error ..."
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "results": {
      "type": "array",
      "description": "List of feature decision outcomes. These will be ordered as provided in the request."
    }
  },
  "required": [
    "results"
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json

SDK Feature Decision Engine

The SDK Feature Decision Engine can be invoked via the Public API to calculate a decision output response based upon Feature SDK Rules created in the Zephr Console. This endpoint is used by the Zephr SDK but can be called directly for custom integrations.

Process single decision
POST/zephr/decision-engine{&raw}

Example URI

POST /zephr/decision-engine&raw=
URI Parameters
HideShow
raw
boolean (optional) Default: false 

Should output raw value

Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "sdkFeatureSlug": "featureX",
  "session": "xxx-xxx-xxx",
  "foreign_keys": {},
  "ip": "x.x.x.x",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11)...",
  "path": "/x.html",
  "contentId": "xxx-xxx-xxx",
  "jwt": "xxx-xxx-xxx",
  "...": "..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "sdkFeatureSlug": {
      "type": "string",
      "description": "Feature SDK slug"
    },
    "session": {
      "type": "string",
      "description": "Zephr Session ID, required for trials"
    },
    "foreign_keys": {
      "type": "object",
      "properties": {},
      "description": "Foreign system and ID used to identify the user"
    },
    "ip": {
      "type": "string",
      "description": "Client IP address, defaults to request IP"
    },
    "userAgent": {
      "type": "string",
      "description": "Client user agent"
    },
    "path": {
      "type": "string",
      "description": "Request path, required for trials"
    },
    "contentId": {
      "type": "string",
      "description": "Content ID, used to perform requests to a 3rd party API for additional content information used in making a decision"
    },
    "jwt": {
      "type": "string",
      "description": "A Json Web Token, may include identity or product holding claims"
    },
    "...": {
      "type": "string",
      "description": "Custom inputs configured in Feature SDK rule"
    }
  },
  "required": [
    "sdkFeatureSlug"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "sdkFeatureSlug": "featureX",
  "outputType": "ENUM",
  "outputValue": "YES",
  "error": "500: Internal error ..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "sdkFeatureSlug": {
      "type": "string",
      "description": "Feature SDK slug"
    },
    "outputType": {
      "type": "string",
      "enum": [
        "ENUM",
        "STRING",
        "NUMBER",
        "TRANSFORMATION",
        "JSON_COMPONENT"
      ],
      "description": "Feature output type. Present if there were no errors."
    },
    "outputValue": {
      "type": "string",
      "description": "Feature output value. Present if there were no errors.\n\nFor the 'JSON_COMPONENT' output type, the response will be stringified JSON, and where ?raw is used in the request, the response will be JSON.\nFor the 'TRANSFORMATION' output type, the response will contain a list of transformations to be applied, including ENABLE_CONTENT, CUSTOM_COMPONENT, TEMPLATE_COMPONENT and FORM."
    },
    "error": {
      "type": "string",
      "description": "The error message explaining why this decision failed to resolve. Present only if there was an error."
    }
  },
  "required": [
    "sdkFeatureSlug"
  ]
}
Response  200
HideShow

Raw parameter response

Body
Raw output value

Get single decision
GET/zephr/decision-engine{?sdkFeatureSlug}{&sdkFeatureSlug,session,foreign_id.xxx,ip,userAgent,path,content_id,jwt,raw}

For compatibility with CDN, any web headers (Referrer, User-Agent) will be accepted and passed onto the rule engine

Example URI

GET /zephr/decision-engine?sdkFeatureSlug=featureX&sdkFeatureSlug=featureX&session=xxx-xxx-xxx&foreign_id.xxx=xxx-xxx-xxx&ip=x.x.x.x&userAgent=Mozilla/5.0 (Macintosh; Intel Mac OS X 11)...&path=/x.html&content_id=xxx-xxx-xxx&jwt=xxx-xxx-xxx&raw=
URI Parameters
HideShow
sdkFeatureSlug
string (required) Example: featureX

Feature SDK slug

session
string (optional) Example: xxx-xxx-xxx

Zephr Session ID, required for trials

foreign_id.xxx
string (optional) Example: xxx-xxx-xxx

Foreign ID used to identify the user. The foreign system is parsed as the remainder of the parameter key name following ‘foreign_id.’

ip
string (optional) Example: x.x.x.x

Client IP address, defaults to request IP

userAgent
string (optional) Example: Mozilla/5.0 (Macintosh; Intel Mac OS X 11)...

Client user agent

path
string (optional) Example: /x.html

Request path, required for trials

content_id
string (optional) Example: xxx-xxx-xxx

Content ID, used to perform requests to a 3rd party API for additional content information used in making a decision

jwt
string (optional) Example: xxx-xxx-xxx

A Json Web Token, may include identity or product holding claims

raw
boolean (optional) Default: false 

Should output raw value

...
string (optional) 

Custom inputs configured in Feature SDK rule

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "sdkFeatureSlug": "featureX",
  "outputType": "ENUM",
  "outputValue": "YES",
  "error": "500: Internal error ..."
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "sdkFeatureSlug": {
      "type": "string",
      "description": "Feature SDK slug"
    },
    "outputType": {
      "type": "string",
      "enum": [
        "ENUM",
        "STRING",
        "NUMBER",
        "TRANSFORMATION",
        "JSON_COMPONENT"
      ],
      "description": "Feature output type. Present if there were no errors."
    },
    "outputValue": {
      "type": "string",
      "description": "Feature output value. Present if there were no errors.\n\nFor the 'JSON_COMPONENT' output type, the response will be stringified JSON, and where ?raw is used in the request, the response will be JSON.\nFor the 'TRANSFORMATION' output type, the response will contain a list of transformations to be applied, including ENABLE_CONTENT, CUSTOM_COMPONENT, TEMPLATE_COMPONENT and FORM."
    },
    "error": {
      "type": "string",
      "description": "The error message explaining why this decision failed to resolve. Present only if there was an error."
    }
  },
  "required": [
    "sdkFeatureSlug"
  ]
}
Response  200
HideShow

Raw parameter response

Body
Raw output value

Browser Feature Decisions

Browser Feature Decisions

Zephr HTML Features can be run in the browser by calling this API directly or using the Zephr Browser SDK.

Browser Feature Decisions
POST/zephr/feature-decisions

For compatibility with CDN, any web headers (Referrer, User-Agent) will be accepted and passed onto the rule engine

Example URI

POST /zephr/feature-decisions
Request  with body
HideShow
Headers
Content-Type: application/json
Cookie: blaize_session=...
Body
{
  "featureIds": [
    "featureX"
  ],
  "session": "xxx-xxx-xxx",
  "referer": "https://www.zephr.com/",
  "path": "/x.html",
  "contentId": "xxx-xxx-xxx",
  "jwt": "xxx-xxx-xxx",
  "customData": {
    "key": "value"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "featureIds": {
      "type": "array",
      "description": "Array of HTML Feature IDs"
    },
    "session": {
      "type": "string",
      "description": "Zephr Session ID"
    },
    "referer": {
      "type": "string",
      "description": "Browser referer"
    },
    "path": {
      "type": "string",
      "description": "Request path, defaults to \"/\""
    },
    "contentId": {
      "type": "string",
      "description": "Content ID, used to perform requests to a 3rd party API for additional content information used in making a decision"
    },
    "jwt": {
      "type": "string",
      "description": "A Json Web Token, may include identity or product holding claims"
    },
    "customData": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Any key value pair"
        }
      },
      "description": "Custom data to be used in Feature HTML browser rule"
    }
  },
  "required": [
    "featureIds"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "featureResults": {
    "featureX": "blaize.transform.resource('...')"
  },
  "resources": {
    "uiComponents": {
      "...": "<h1>Example</h1>"
    }
  },
  "accessDetails": {
    "authenticated": false,
    "accessDecisions": {
      "...": false
    },
    "entitlements": {
      "...": {
        "usedInDecision": false,
        "decrementedInDecision": false
      }
    },
    "credits": {
      "...": {
        "usedInDecision": false,
        "decrementedInDecision": false,
        "totalCredits": 0,
        "remainingCredits": 0
      }
    },
    "meters": {
      "...": {
        "usedInDecision": false,
        "decrementedInDecision": false,
        "totalCredits": 0,
        "remainingCredits": 0
      }
    },
    "trialTrackingDetails": [
      {
        "entitlementId": "...",
        "entitlementType": "entitlement",
        "trackCreditsUsed": false,
        "trackCreditsRemaining": false,
        "creditsUsedKey": "",
        "creditsRemainingKey": ""
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "featureResults": {
      "type": "object",
      "properties": {
        "featureX": {
          "type": "string",
          "description": "Feature result transformations"
        }
      },
      "description": "Map of HTML Feature IDs and feature result transformations"
    },
    "resources": {
      "type": "object",
      "properties": {
        "forms": {
          "type": "object",
          "properties": {},
          "description": "Forms used in feature results"
        },
        "paymentForms": {
          "type": "object",
          "properties": {},
          "description": "Payment Forms used in feature results"
        },
        "uiComponents": {
          "type": "object",
          "properties": {
            "...": {
              "type": "string"
            }
          },
          "description": "UI Components used in feature results"
        },
        "hostedUiComponents": {
          "type": "object",
          "properties": {},
          "description": "Hosted UI Components used in feature results"
        },
        "componentTemplates": {
          "type": "object",
          "properties": {},
          "description": "Component Templates used in feature results"
        }
      },
      "description": "Map of transformation resources"
    },
    "accessDetails": {
      "type": "object",
      "properties": {
        "authenticated": {
          "type": "boolean",
          "description": "Is the session authenticated"
        },
        "accessDecisions": {
          "type": "object",
          "properties": {
            "...": {
              "type": "boolean",
              "description": "Whether the user has access or not"
            }
          },
          "description": "Map of access decisions for this feature"
        },
        "entitlements": {
          "type": "object",
          "properties": {
            "...": {
              "type": "object",
              "properties": {
                "usedInDecision": {
                  "type": "boolean"
                },
                "decrementedInDecision": {
                  "type": "boolean"
                }
              }
            }
          },
          "description": "Map of entitlement usage"
        },
        "credits": {
          "type": "object",
          "properties": {
            "...": {
              "type": "object",
              "properties": {
                "usedInDecision": {
                  "type": "boolean"
                },
                "decrementedInDecision": {
                  "type": "boolean"
                },
                "totalCredits": {
                  "type": "number"
                },
                "remainingCredits": {
                  "type": "number"
                }
              }
            }
          },
          "description": "Map of credit usage"
        },
        "meters": {
          "type": "object",
          "properties": {
            "...": {
              "type": "object",
              "properties": {
                "usedInDecision": {
                  "type": "boolean"
                },
                "decrementedInDecision": {
                  "type": "boolean"
                },
                "totalCredits": {
                  "type": "number"
                },
                "remainingCredits": {
                  "type": "number"
                }
              }
            }
          },
          "description": "Map of meter usage"
        },
        "trialTrackingDetails": {
          "type": "array",
          "description": "Array of trial tracking details"
        }
      },
      "description": "Feature access details"
    }
  }
}

Zephr Features

Zephr Features

Zephr Feature
GET/zephr/features{?ruleType}

Returns the Zephr browser features by default, or optionally with query parameter ?ruleType returns the given type, they can be html, browser, json, sdk.

Example URI

GET /zephr/features?ruleType=
URI Parameters
HideShow
ruleType
string (optional) 

Type of the feature rule

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "feature-live",
    "label": "feature-label",
    "slug": "feature-slug"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

OAuth Flow

Start

Start
POST/blaize/oauth/state

Start OAuth Flow

Example URI

POST /blaize/oauth/state
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "start_url": "http://blaize.io",
  "target_url": "http://blaize.io"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "start_url": {
      "type": "string"
    },
    "target_url": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "State initialized"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string"
    }
  }
}

Google

Google
GET/blaize/oauth/google/callback{?code}

Callback for Google OAuth Flow.

Example URI

GET /blaize/oauth/google/callback?code=
URI Parameters
HideShow
code
string (required) 

OAuth code

Response  302
HideShow
Headers
Location: (string)
Set-Cookie: (string)

Facebook

Facebook
GET/blaize/oauth/facebook/callback{?code}

Callback for Google OAuth Flow.

Example URI

GET /blaize/oauth/facebook/callback?code=
URI Parameters
HideShow
code
string (required) 

OAuth code

Response  302
HideShow
Headers
Location: (string)
Set-Cookie: (string)

Linkedin

Linkedin
GET/blaize/oauth/linkedin/callback{?code}

Callback for Linkedin OAuth Flow.

Example URI

GET /blaize/oauth/linkedin/callback?code=
URI Parameters
HideShow
code
string (required) 

OAuth code

Response  302
HideShow
Headers
Location: (string)
Set-Cookie: (string)

Third-Party Authentication

Oauth2 Auth Code Flow

Start

Start
GET/zephr/oauth2{?client_id,response_type,redirect_uri,scope,state}

Start OAuth2 Authorization Code Flow. The resource owner will be authenticated and will be presented with the third party application access request.

Example URI

GET /zephr/oauth2?client_id=&response_type=&redirect_uri=&scope=&state=
URI Parameters
HideShow
client_id
string (required) 

Zephr Site Oauth2 Client ID

response_type
string (required) 

Must be set to “code”

redirect_uri
string (required) 

Client’s redirection endpoint. Must be an absolute URI.

scope
string (required) 

The scope of the access request.

state
string (required) 

An opaque value used by the client to maintain state between the request and callback.

Response  302
HideShow
Headers
Location: (Error response to the redirect URI with error and state params)

Grant

Grant
POST/zephr/oauth2/grant

The resource owner will consent or deny the third party application access request, and Zephr will return an authorization code upon user’s consent.

Example URI

POST /zephr/oauth2/grant
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "client_id": "1234567890",
  "response_type": "code",
  "redirect_uri": "https://someUrl.com/callback",
  "scope": "user.account:read user.profile:read",
  "state": "abcdefghijklmnopqrstuvwsyz",
  "allow": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "client_id": {
      "type": "string",
      "description": "Zephr Site Oauth2 Client ID"
    },
    "response_type": {
      "type": "string",
      "description": "Must be set to `code`"
    },
    "redirect_uri": {
      "type": "string",
      "description": "Client's redirection endpoint. Must be an absolute URI"
    },
    "scope": {
      "type": "string",
      "description": "The scope of the access request. Supported scopes: user.account:read, user.profile:read and user.profile:update"
    },
    "state": {
      "type": "string",
      "description": "An opaque value used by the client to maintain state between the request and callback"
    },
    "allow": {
      "type": "boolean",
      "description": "Resource owner consent"
    }
  },
  "required": [
    "client_id",
    "response_type",
    "redirect_uri",
    "scope",
    "state",
    "allow"
  ]
}
Response  200
HideShow
Headers
Location: (Successful response to the redirect URI with code and state params)
Body
{
  "state": "Hello, world!",
  "code": "Hello, world!"
}
Schema
{
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "description": "State (string)"
    },
    "code": {
      "type": "string",
      "description": "Authorization code (string)"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  401
HideShow
Body
{
  "state": "Hello, world!",
  "error": "Hello, world!"
}
Schema
{
  "type": "object",
  "properties": {
    "state": {
      "type": "string",
      "description": "State (string)"
    },
    "error": {
      "type": "string",
      "description": "Error type (string)"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}

Payments

Start Subscription

Start Subscription
POST/zephr/subscribe

Use the payment info captured by the payment provider drop-in UI and create a customer with a recurring payment. When the payment provider responds successfully, the logged-in user will be temporarily granted all entitlements in the product’s associated bundle.

Example URI

POST /zephr/subscribe
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "product_id": "premium-access-monthly-recurring",
  "plan_id": "plan-5",
  "discount_code": "SAVE10",
  "vendor_fields": {
    "payment_nonce": "eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ==",
    "skip_trial_period": true,
    "start_date": "2021-01-01T00:00:00Z",
    "payment_method": "pm_123456789",
    "vault_payment_method": false
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "Product Id/slug"
    },
    "plan_id": {
      "type": "string",
      "description": "Plan Id/slug"
    },
    "discount_code": {
      "type": "string",
      "description": "Discount/promotion code"
    },
    "vendor_fields": {
      "type": "object",
      "properties": {
        "payment_nonce": {
          "type": "string",
          "description": "(Stripe) Payment method nonce from Braintree drop-in UI"
        },
        "skip_trial_period": {
          "type": "boolean",
          "description": "(Braintree) Whether or not to skip any trial period that may be associated with this subscription. This should be `null` or not set to use the configured trial period."
        },
        "start_date": {
          "type": "string",
          "description": "(Braintree) ISO 8601 date format which determines when the subscription will start. When the attribute is passed, the value must be in the future. Otherwise, the subscription is expected to start immediately."
        },
        "payment_method": {
          "type": "string",
          "description": "(Stripe) Payment method from Stripe Elements UI"
        },
        "vault_payment_method": {
          "type": "boolean",
          "description": "(Braintree) If the payment nonce requires vaulting, for example if Google Pay is being used. Defaults to false."
        }
      },
      "description": "Parameters specific to the payment provider in use"
    }
  },
  "required": [
    "product_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "33d576c7-d036-40e7-8141-8a91998a5c79",
  "client_secret": "src_client_secret_QfsM25CJ2uCMon72MiOmUNTj`",
  "payment_intent_id": "pi_1GYZYWLgUJT2XNPAYQMomeqf"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    },
    "client_secret": {
      "type": "string",
      "description": "(Stripe) reference to Stripe payment required to process payment in front end"
    },
    "payment_intent_id": {
      "type": "string",
      "description": "(Stripe)  reference to the payment intent if payment requires confirmation"
    }
  }
}
Response  400
Response  401

Change Subscription

Change Subscription
PATCH/zephr/subscriptions/:subscriptionId

Update an existing subscription to change the associated product and plan. Updating the subscription may modify the price of the subscription, and if so the balance will be billed immediately at a pro-rated amount. Parameters specific to the vendor may be specified to change the payment method for the subscription. Changing to a plan with a different billing frequency from the existing subscription is not supported for some payment providers (Braintree).

Example URI

PATCH /zephr/subscriptions/:subscriptionId
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "product_id": "premium-access-monthly-recurring",
  "plan_id": "plan-5",
  "vendor_fields": {
    "payment_nonce": "eyJ2ZXmsaW5nQWdyZWmVubW8iOiJvZmYifQ=="
  },
  "navigated_from": "/some/path"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "Product Id/slug"
    },
    "plan_id": {
      "type": "string",
      "description": "Plan Id/slug"
    },
    "vendor_fields": {
      "type": "object",
      "properties": {
        "payment_nonce": {
          "type": "string",
          "description": "(Braintree) Payment method nonce from Braintree drop-in UI. If not specified, the existing payment method on the subscription will be retained."
        }
      },
      "description": "Parameters specific to the payment provider in use"
    },
    "navigated_from": {
      "type": "string",
      "description": "Specify where the request was made from. Used as data to pass to change subscription webhooks."
    }
  },
  "required": [
    "product_id",
    "plan_id",
    "vendor_fields"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "33d576c7-d036-40e7-8141-8a91998a5c79"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    }
  }
}
Response  400
Response  401
Response  404

Braintree Payments

Get Braintree Token

Get Braintree Token
GET/blaize/payment/braintree/token{?allowUnauthenticated}

Issue a Braintree client token for the current blaize session. This holds the user’s userId if the user has an authenticated session. This token can be used to request a payment nonce.

Example URI

GET /blaize/payment/braintree/token?allowUnauthenticated=
URI Parameters
HideShow
allowUnauthenticated
boolean (optional) 

if tokens can be generated for unauthenticated user sessions - defaults to false

Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ=="
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "token": {
      "type": "string"
    }
  }
}
Response  401

Subscription start callback

Callback
POST/blaize/payment/braintree/subscriptionChargedCallback/

To use subscriptions, braintree callback must be configured to point to this endpoint.

Example URI

POST /blaize/payment/braintree/subscriptionChargedCallback/
Request  with body
HideShow
Headers
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json

User Braintree subscriptions

List User Braintree subscriptions
GET/blaize/payment/braintree/subscriptions

List all Braintree subscriptions for the logged-in user.

Example URI

GET /blaize/payment/braintree/subscriptions
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "8m2kc5g",
  "managed-by": "Braintree",
  "external-id": "abc123",
  "next-billing-time": "2021-05-17T04:31:33Z",
  "ends": "2021-05-17T04:31:33Z",
  "blaize-product": {
    "id": "one-month-one-off",
    "label": "One month access",
    "description": "One month access"
  },
  "transaction-history": [
    {
      "human-readable-amount": "$2.34",
      "time": "Hello, world!",
      "currency": "$",
      "cents": 234,
      "cycle": "month",
      "cycleCount": 1,
      "taxRate": {
        "taxPercent": 15,
        "isTaxInclusive": true,
        "displayName": "VAT",
        "active": true
      }
    }
  ],
  "subscription-state": "active",
  "paid_through_date": "2021-05-17T04:31:33Z",
  "plan_id": "plan-123",
  "plan_name": "monthly-plan",
  "currency_code": "GBP",
  "pre_discount_price": 50,
  "billing_frequency_unit": "MONTH",
  "billing_frequency": 1,
  "discounts_applied": true,
  "multiphase_plan": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "The token identifier for this payment method."
    },
    "managed-by": {
      "type": "string"
    },
    "external-id": {
      "type": "string",
      "description": "The ID for this subscription in Braintree."
    },
    "next-billing-time": {
      "type": "string",
      "description": "ISO-8601 formatted time at which the subscription will next be billed."
    },
    "ends": {
      "type": "string",
      "description": "ISO-8601 formatted time at which the subscription is expected to end."
    },
    "blaize-product": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Zephr product ID"
        },
        "label": {
          "type": "string",
          "description": "Zephr product label"
        },
        "description": {
          "type": "string",
          "description": "Description of Zephr product"
        }
      },
      "description": "The Zephr product associated with this subscription."
    },
    "transaction-history": {
      "type": "array"
    },
    "subscription-state": {
      "type": "string",
      "description": "The subscription state, as acquired from Braintree."
    },
    "paid_through_date": {
      "type": "string",
      "description": "ISO-8601 formatted time up to which the subscription has been paid for. This will be `null` if the subscription has not yet been paid for."
    },
    "plan_id": {
      "type": "string",
      "description": "The Braintree plan ID"
    },
    "plan_name": {
      "type": "string",
      "description": "The Braintree plan name"
    },
    "currency_code": {
      "type": "string",
      "description": "The currency of the subscription price."
    },
    "pre_discount_price": {
      "type": "number",
      "description": "The subscription price before any discounts are applied."
    },
    "billing_frequency_unit": {
      "type": "string",
      "description": "The time unit of the billing frequency, one of: YEAR, MONTH, WEEK, DAY."
    },
    "billing_frequency": {
      "type": "number",
      "description": "The frequency at which the subscription is billed, in the units specified by billing_frequency_unit."
    },
    "discounts_applied": {
      "type": "boolean",
      "description": "If the subscription has any applied discounts."
    },
    "multiphase_plan": {
      "type": "boolean",
      "description": "If the subscription plan has multiple phases."
    }
  },
  "required": [
    "token",
    "managed-by",
    "external-id",
    "next-billing-time",
    "ends",
    "blaize-product",
    "transaction-history",
    "subscription-state",
    "plan_id",
    "plan_name",
    "currency_code",
    "pre_discount_price",
    "billing_frequency_unit",
    "billing_frequency",
    "discounts_applied",
    "multiphase_plan"
  ]
}
Response  401
Response  404

Modify Braintree Subscription

Update Braintree Subscription
PATCH/blaize/payment/braintree/subscriptions/{subscriptionId}

Update a Braintree subscription by ID. This currently only supports updating the payment method for a subscription, sending the payment method token or nonce.

Example URI

PATCH /blaize/payment/braintree/subscriptions/subscriptionId
URI Parameters
HideShow
subscriptionId
string (required) 

Subscription ID

Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "payment_method_token": "alpha123token",
  "payment_method_nonce": "alpha123token"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "payment_method_token": {
      "type": "string",
      "description": "Payment method token referencing a payment method in Braintree."
    },
    "payment_method_nonce": {
      "type": "string",
      "description": "Payment method nonce referencing a payment method in Braintree."
    }
  }
}
Response  204
Response  401
Response  404

Cancel Braintree Subscription
DELETE/blaize/payment/braintree/subscriptions/{subscriptionId}

Cancel a Braintree subscription by ID.

Example URI

DELETE /blaize/payment/braintree/subscriptions/subscriptionId
URI Parameters
HideShow
subscriptionId
string (required) 

Subscription ID

Response  200
Response  404
Response  409

Braintree Buy One-Off

Braintree Buy (one-off)
POST/blaize/payment/braintree/buy

Use the payment info captured by the braintree drop-in UI and encoded in the payment nonce to create a braintree customer and issue a one-off payment. When braintree responds successfully, the logged-in user will be granted all entitlements in the product’s associated bundle.

Example URI

POST /blaize/payment/braintree/buy
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "product_id": "lifetime-membership",
  "price_point_id": "gold-package",
  "payment_nonce": "eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ=="
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "Product Id/slug"
    },
    "price_point_id": {
      "type": "string",
      "description": "Price Point Id/slug"
    },
    "payment_nonce": {
      "type": "string",
      "description": "Payment method nonce from Braintree drop-in UI"
    }
  },
  "required": [
    "product_id",
    "price_point_id",
    "payment_nonce"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "aa583cb8-51d1-4bd9-9ec7-3a43796ef8e5"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    }
  }
}
Response  400
Response  401
Response  404

Braintree User Payment Methods

Braintree List User Payment Methods
GET/zephr/payment/braintree/payment-methods

List the Braintree payment methods details associated with the logged-in user.

Example URI

GET /zephr/payment/braintree/payment-methods
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "token": "8m2kc5g",
    "default": false,
    "card_type": "Visa",
    "card_holder_name": "John Rambo",
    "card_number_masked": "654321******0987",
    "expiration_date": "07/22",
    "expired": false,
    "expiring_soon": false,
    "in_use": false,
    "last_4": "1111",
    "nonce": "086128f3-04c2-069e-78d2-3f4de98508e5",
    "type": "CreditCard",
    "zipcode": "123456"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Braintree Create User Payment Method
POST/zephr/payment/braintree/payment-methods

Create the Braintree payment method with the associated vaulted nonce, for the authenticated user.

Example URI

POST /zephr/payment/braintree/payment-methods
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Body
{
  "payment_method_nonce": "aa583cb8...and other characters...3a43796ef8e5"
}
Schema
{
  "type": "object",
  "properties": {
    "payment_method_nonce": {
      "type": "string",
      "description": "The vaulted nonce associated with the new payment method"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "8m2kc5g",
  "default": false,
  "card_type": "Visa",
  "card_holder_name": "John Rambo",
  "card_number_masked": "654321******0987",
  "expiration_date": "07/22",
  "expired": false,
  "expiring_soon": false,
  "in_use": false,
  "last_4": "1111",
  "nonce": "086128f3-04c2-069e-78d2-3f4de98508e5",
  "type": "CreditCard",
  "zipcode": "123456"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "The token identifier for this payment method."
    },
    "default": {
      "type": "boolean",
      "description": "If this the default payment method for this user."
    },
    "card_type": {
      "type": "string",
      "description": "In the case of a card payment method, the type of the card."
    },
    "card_holder_name": {
      "type": "string",
      "description": "In the case of a credit card payment method, the name of the card holder."
    },
    "card_number_masked": {
      "type": "string",
      "description": "In the case of a card payment method, the masked card number, compliant with PCI security standards."
    },
    "expiration_date": {
      "type": "string",
      "description": "In the case of a card payment method, the expiration date, in the format of MM/YY or MM/YYYY."
    },
    "expired": {
      "type": "boolean",
      "description": "In the case of a card payment method, if the card has expired."
    },
    "expiring_soon": {
      "type": "boolean",
      "description": "In the case of a card payment method, if the card will expire within the configured number of days."
    },
    "in_use": {
      "type": "boolean",
      "description": "Indicates if this payment method is used by any subscriptions that have not been finalised and would be cancelled if this payment method is deleted."
    },
    "last_4": {
      "type": "string",
      "description": "In the case of a card payment method, the last four digits of the card number."
    },
    "nonce": {
      "type": "string",
      "description": "A nonce that can be used for other payment method operations."
    },
    "type": {
      "type": "string",
      "description": "The payment method type."
    },
    "zipcode": {
      "type": "string",
      "description": "In the case of a card payment method, the zip code associated with the card."
    }
  },
  "required": [
    "token",
    "default",
    "nonce",
    "type"
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Braintree User Payment Method

Braintree Update User Payment Method
PATCH/zephr/payment/braintree/payment-methods/{paymentMethodToken}

Update the Braintree payment method details associated with the logged-in user. The details to update must first be captured from Braintree in a nonce and vaulted.

Example URI

PATCH /zephr/payment/braintree/payment-methods/paymentMethodToken
URI Parameters
HideShow
paymentMethodToken
string (required) 

The unique ID of the payment method

Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Body
{
  "payment_method_nonce": "aa583cb8...and other characters...3a43796ef8e5"
}
Schema
{
  "type": "object",
  "properties": {
    "payment_method_nonce": {
      "type": "string",
      "description": "The vaulted nonce associated with the update payment method"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "8m2kc5g",
  "default": false,
  "card_type": "Visa",
  "card_holder_name": "John Rambo",
  "card_number_masked": "654321******0987",
  "expiration_date": "07/22",
  "expired": false,
  "expiring_soon": false,
  "in_use": false,
  "last_4": "1111",
  "nonce": "086128f3-04c2-069e-78d2-3f4de98508e5",
  "type": "CreditCard",
  "zipcode": "123456"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "The token identifier for this payment method."
    },
    "default": {
      "type": "boolean",
      "description": "If this the default payment method for this user."
    },
    "card_type": {
      "type": "string",
      "description": "In the case of a card payment method, the type of the card."
    },
    "card_holder_name": {
      "type": "string",
      "description": "In the case of a credit card payment method, the name of the card holder."
    },
    "card_number_masked": {
      "type": "string",
      "description": "In the case of a card payment method, the masked card number, compliant with PCI security standards."
    },
    "expiration_date": {
      "type": "string",
      "description": "In the case of a card payment method, the expiration date, in the format of MM/YY or MM/YYYY."
    },
    "expired": {
      "type": "boolean",
      "description": "In the case of a card payment method, if the card has expired."
    },
    "expiring_soon": {
      "type": "boolean",
      "description": "In the case of a card payment method, if the card will expire within the configured number of days."
    },
    "in_use": {
      "type": "boolean",
      "description": "Indicates if this payment method is used by any subscriptions that have not been finalised and would be cancelled if this payment method is deleted."
    },
    "last_4": {
      "type": "string",
      "description": "In the case of a card payment method, the last four digits of the card number."
    },
    "nonce": {
      "type": "string",
      "description": "A nonce that can be used for other payment method operations."
    },
    "type": {
      "type": "string",
      "description": "The payment method type."
    },
    "zipcode": {
      "type": "string",
      "description": "In the case of a card payment method, the zip code associated with the card."
    }
  },
  "required": [
    "token",
    "default",
    "nonce",
    "type"
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Braintree Delete User Payment Method
DELETE/zephr/payment/braintree/payment-methods/{paymentMethodToken}

Delete the Braintree payment method associated with the provided token.

Example URI

DELETE /zephr/payment/braintree/payment-methods/paymentMethodToken
URI Parameters
HideShow
paymentMethodToken
string (required) 

The unique ID of the payment method

Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  204
Response  401
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Braintree User Default Payment Method

Braintree Set User Default Payment Method
PUT/zephr/payment/braintree/default-payment-method

Set the Braintree default payment method for the logged-in user. This must be a valid payment method already associated with the user.

Example URI

PUT /zephr/payment/braintree/default-payment-method
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Body
{
  "payment_method_token": "payment-method-123"
}
Schema
{
  "type": "object",
  "properties": {
    "payment_method_token": {
      "type": "string",
      "description": "The unique ID of the payment method to be set as default for the user"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  204
Response  400
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Braintree Plans

Braintree List Plans
GET/zephr/payment/braintree/plans{?product_id}

List the plans associated with the identified product. The product ID is required.

Example URI

GET /zephr/payment/braintree/plans?product_id=
URI Parameters
HideShow
product_id
string (required) 

Product ID

Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "plan-id": {
    "id": "annual-plan",
    "name": "Sports+ Membership Annual",
    "currency_code": "USD",
    "base_price": 10.2,
    "billing_interval_unit": "MONTH",
    "billing_interval": 3,
    "billing_cycles": 12,
    "trial_duration_unit": "DAY",
    "trial_duration": 30,
    "discounts": [
      {
        "id": "annual-discount",
        "name": "Sports+ Membership Discount",
        "description": "This is a discount description",
        "amount": "9.99",
        "billing_cycles": "6",
        "current_billing_cycle": "4"
      }
    ],
    "zephr_product_id": "product-123"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "$ref": "#/definitions/plan-id",
  "definitions": {
    "plan-id": {
      "type": "object",
      "patternProperties": {
        "": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "The identifier for this payment plan."
            },
            "name": {
              "type": "string",
              "description": "The name of this payment plan."
            },
            "currency_code": {
              "type": "string",
              "description": "The ISO 4217 currency code for the transaction."
            },
            "base_price": {
              "type": "number",
              "description": "The price of this plan, without any discounts applied."
            },
            "billing_interval_unit": {
              "type": "string",
              "description": "The time measurement unit for billing interval."
            },
            "billing_interval": {
              "type": "number",
              "description": "How many time units lapse between billing events."
            },
            "billing_cycles": {
              "type": "number",
              "description": "How many times billing will occur."
            },
            "trial_duration_unit": {
              "type": "string",
              "description": "The time measurement unit for trial duration. This will always be present if `trial_duration` is set."
            },
            "trial_duration": {
              "type": "number",
              "description": "How long the trial period lasts."
            },
            "discounts": {
              "type": "array",
              "description": "Any discounts that may apply to this plan."
            },
            "zephr_product_id": {
              "type": "string",
              "description": "The Zephr product ID associated with this plan."
            }
          },
          "required": [
            "id",
            "name",
            "currency_code",
            "base_price",
            "billing_interval_unit",
            "billing_interval",
            "billing_cycles",
            "zephr_product_id"
          ]
        }
      }
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: application/json
Response  404
HideShow
Headers
Content-Type: application/json

Braintree Get Promo Code

Braintree Get Promo Code
GET/blaize/payment/braintree/promo-code{?code,paymentForm}

Get a Braintree promo code.

Example URI

GET /blaize/payment/braintree/promo-code?code=&paymentForm=
URI Parameters
HideShow
code
string (required) 

promo code to lookup by ID

paymentForm
string (required) 

payment form to lookup by slug

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "promo-123",
  "discount": 20,
  "paymentOptions": [
    {
      "slug": "plan-123",
      "currency": "$",
      "pricePointId": "cost-123",
      "originalPrice": 3.45,
      "discountPrice": 2
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "The promo code identifier."
    },
    "discount": {
      "type": "number",
      "description": "The discount amount."
    },
    "paymentOptions": {
      "type": "array",
      "description": "The list of payment options."
    }
  },
  "required": [
    "code",
    "discount",
    "paymentOptions"
  ]
}
Response  400
Response  401
Response  403
Response  404

Braintree Calculate Promo Code

Braintree Calculate Promo Code
POST/blaize/payment/braintree/promo-code-check

Calculate the prices of the specified payment options with a promo code applied.

Example URI

POST /blaize/payment/braintree/promo-code-check
Request
HideShow
Body
{
  "promoCode": "promo-123",
  "paymentOptions": [
    {
      "slug": "plan-123",
      "productId": "prod-123",
      "currency": "$",
      "price": 12.34
    }
  ]
}
Schema
{
  "type": "object",
  "properties": {
    "promoCode": {
      "type": "string",
      "description": "A promo code to use when calculating the payment option prices."
    },
    "paymentOptions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "The plan slug."
          },
          "productId": {
            "type": "string",
            "description": "The product ID."
          },
          "currency": {
            "type": "string",
            "description": "The currency symbol."
          },
          "price": {
            "type": "number",
            "description": "The price."
          }
        }
      },
      "description": "The list of payment options."
    }
  },
  "required": [
    "paymentOptions"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "promo-123",
  "discount": 20,
  "paymentOptions": [
    {
      "slug": "plan-123",
      "currency": "$",
      "pricePointId": "cost-123",
      "originalPrice": 3.45,
      "discountPrice": 2
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "The promo code identifier."
    },
    "discount": {
      "type": "number",
      "description": "The discount amount."
    },
    "paymentOptions": {
      "type": "array",
      "description": "The list of payment options."
    }
  },
  "required": [
    "code",
    "discount",
    "paymentOptions"
  ]
}
Response  400
Response  401
Response  403
Response  404

Braintree List Add-ons

Braintree List Add-ons
GET/blaize/payment/braintree/addons{?paymentForm}{&promoCode}

Get a list of Braintree add-ons.

Example URI

GET /blaize/payment/braintree/addons?paymentForm=&promoCode=
URI Parameters
HideShow
paymentForm
string (required) 

payment form to lookup by slug

promoCode
string (optional) 

promo code to lookup by ID

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "add-123",
    "label": "Easy Add-on",
    "value": 12,
    "type": "PERCENT",
    "paymentOptions": [
      {
        "slug": "plan-123",
        "currency": "$",
        "addonPrice": 12.34
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  400
Response  401
Response  403
Response  404

Braintree Calculate Add-ons

Braintree Calculate Add-ons
POST/blaize/payment/braintree/addons-check

Calculate the cost of Braintree add-ons as applied to the specified list of payment options.

Example URI

POST /blaize/payment/braintree/addons-check
Request
HideShow
Body
{
  "promoCode": "promo-123",
  "paymentOptions": [
    {
      "slug": "plan-123",
      "productId": "prod-123",
      "currency": "$",
      "price": 12.34
    }
  ]
}
Schema
{
  "type": "object",
  "properties": {
    "promoCode": {
      "type": "string",
      "description": "A promo code to also use when calculating the payment option prices."
    },
    "paymentOptions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "The plan slug."
          },
          "productId": {
            "type": "string",
            "description": "The product ID."
          },
          "currency": {
            "type": "string",
            "description": "The currency symbol."
          },
          "price": {
            "type": "number",
            "description": "The price."
          }
        }
      },
      "description": "The list of payment options."
    }
  },
  "required": [
    "paymentOptions"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "add-123",
    "label": "Easy Add-on",
    "value": 12,
    "type": "PERCENT",
    "paymentOptions": [
      {
        "slug": "plan-123",
        "currency": "$",
        "addonPrice": 12.34
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  400
Response  401
Response  403
Response  404

Deprecated

Start Braintree Subscription (Deprecated)
POST/blaize/payment/braintree/subscribe

(Deprecated - use /zephr/subscribe) Use the payment info captured by the braintree drop-in UI and encoded in the payment nonce to create a braintree customer in with a recurring payment. When braintree responds successfully, the logged-in user will be temporarily granted all entitlements in the product’s associated bundle.

Example URI

POST /blaize/payment/braintree/subscribe
Request  with body
HideShow
Headers
Content-Type: application/json
cookie: `blaize_session=...` (string)
Body
{
  "product_id": "premium-access-monthly-recurring",
  "payment_nonce": "eyJ2ZXmsaW5nQW...(lots more random-looking characters)...dyZWmVubW8iOiJvZmYifQ==",
  "skip_trial_period": true,
  "start_date": "2021-01-01T00:00:00Z"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "Product Id/slug"
    },
    "payment_nonce": {
      "type": "string",
      "description": "Payment method nonce from Braintree drop-in UI"
    },
    "skip_trial_period": {
      "type": "boolean",
      "description": "Whether or not to skip any trial period that may be associated with this subscription. This should be `null` or not set to use the configured trial period."
    },
    "start_date": {
      "type": "string",
      "description": "ISO 8601 date format which determines when the subscription will start. When the attribute is passed, the value must be in the future. Otherwise, the subscription is expected to start immediately."
    }
  },
  "required": [
    "product_id",
    "payment_nonce"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "33d576c7-d036-40e7-8141-8a91998a5c79"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    }
  }
}
Response  400
Response  401

Stripe Payments

Get Stripe Public Key

Get Stripe Public Key
GET/blaize/payment/stripe/publicKey

Retrieve the public key for a tenant to process a payment

Example URI

GET /blaize/payment/stripe/publicKey
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
pk_live_PFghBsstUo5FwUGcXBiNvIkY00X1YHtpnJ - String key

Stripe Setup Intent Secret

Create Stripe Setup Intent Secret
POST/zephr/payment/stripe/setupIntentSecret

Create the client secret to update card details

Example URI

POST /zephr/payment/stripe/setupIntentSecret
Request
HideShow
Headers
cookie: `blaize_session=...` (string)
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "clientSecret": "src_client_secret_QfsM25CJ2uCMon72MiOmUNTj"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "clientSecret": {
      "type": "string",
      "description": "reference to Stripe payment required to process payment in front end"
    }
  }
}

Stripe Calculate Promo Code

Stripe Calculate Promo Code
POST/zephr/payment/stripe/promo-code-check

Calculate the prices of the specified payment options with a promo code applied.

Example URI

POST /zephr/payment/stripe/promo-code-check
Request
HideShow
Body
{
  "promoCode": "promo-123",
  "paymentOptions": [
    {
      "slug": "plan-123",
      "productId": "prod-123",
      "currency": "$",
      "price": 12.34
    }
  ]
}
Schema
{
  "type": "object",
  "properties": {
    "promoCode": {
      "type": "string",
      "description": "A promo code to use when calculating the payment option prices."
    },
    "paymentOptions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "The plan slug."
          },
          "productId": {
            "type": "string",
            "description": "The product ID."
          },
          "currency": {
            "type": "string",
            "description": "The currency symbol."
          },
          "price": {
            "type": "number",
            "description": "The price."
          }
        }
      },
      "description": "The list of payment options."
    }
  },
  "required": [
    "paymentOptions"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "code": "promo-123",
  "discount": 20,
  "paymentOptions": [
    {
      "slug": "plan-123",
      "currency": "$",
      "pricePointId": "cost-123",
      "originalPrice": 3.45,
      "discountPrice": 2
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "The promo code identifier."
    },
    "discount": {
      "type": "number",
      "description": "The discount amount."
    },
    "paymentOptions": {
      "type": "array",
      "description": "The list of payment options."
    }
  },
  "required": [
    "code",
    "discount",
    "paymentOptions"
  ]
}
Response  400
Response  401
Response  403
Response  404

Start Stripe Subscription Confirmation

Start Stripe Subscription Confirmation
POST/blaize/payment/stripe/subscription/confirmation

If a payment requires confirmation (3dSecure etc), the payment is confirmed in the front end,

Example URI

POST /blaize/payment/stripe/subscription/confirmation
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "subscriptionId": "sub_H8eIeMFwMawg6w"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "subscriptionId": {
      "type": "string"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "aa583cb8-51d1-4bd9-9ec7-3a43796ef8e5"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    }
  }
}

Stripe Update Subscription with Payment Method

Update Stripe Subscription
POST/zephr/payment/stripe/updateSubscription

This endpoint is used to update payment method in the subscription. Payment method id will be provided by stripe on updating card details in the front end.

Example URI

POST /zephr/payment/stripe/updateSubscription
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "subscription_id": "sub_H8eIeMFwMawg6w",
  "payment_method_id": "pm_2KrMmOCvDgIhZCB6u0Yn7COE"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "subscription_id": {
      "type": "string"
    },
    "payment_method_id": {
      "type": "string"
    }
  },
  "required": [
    "subscription_id",
    "payment_method_id"
  ]
}
Response  200

Stripe Buy

Stripe Buy
POST/blaize/payment/stripe/buy

Uses the payment method collected by Stripe Elements to create a one off payment

Example URI

POST /blaize/payment/stripe/buy
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "product_id": "lifetime-membership",
  "price_point_id": "gold-package",
  "payment_method": "pm_123456789",
  "payment_intent_id": "pi_1GYZYWLgUJT2XNPAYQMomeqf"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "Product Id/slug"
    },
    "price_point_id": {
      "type": "string",
      "description": "Price Point Id/slug"
    },
    "payment_method": {
      "type": "string",
      "description": "Payment method from Stripe Elements UI"
    },
    "payment_intent_id": {
      "type": "string",
      "description": "PaymentIntent id returned after confirming a card payment"
    }
  },
  "required": [
    "product_id",
    "price_point_id",
    "payment_method"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "aa583cb8-51d1-4bd9-9ec7-3a43796ef8e5",
  "client_secret": "src_client_secret_QfsM25CJ2uCMon72MiOmUNTj`",
  "payment_intent_id": "pi_1GYZYWLgUJT2XNPAYQMomeqf"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    },
    "client_secret": {
      "type": "string",
      "description": "reference to Stripe payment required to process payment in front end"
    },
    "payment_intent_id": {
      "type": "string",
      "description": "reference to the payment intent if payment requires confirmation"
    }
  }
}

WebHook

WebHook
POST/blaize/payment/stripe/subscriptionChargedCallback

To use subscriptions, Stripe Webhooks for invoice.payment_succeeded must be configured to point to this endpoint.

Example URI

POST /blaize/payment/stripe/subscriptionChargedCallback
Request  with body
HideShow
Headers
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json

Stripe Change Subscription Preview

Stripe Change Subscription Preview
POST/zephr/payment/stripe/subscription/{subscriptionId}/change-previews

Generate a preview of the invoice that Stripe will create for the customer if their subscription is changed to a new plan. The invoice will be a prorated invoice for the price difference between current and new subscription plans for the remainder of the current billing period. The invoice will be billed immediately upon changing subscription. The invoice amount may be negative if the customer is changing to a lower-priced plan.

Note: This method does not modify the user’s subscription.

Example URI

POST /zephr/payment/stripe/subscription/subscriptionId/change-previews
URI Parameters
HideShow
subscriptionId
string (required) 

The ID of the Stripe subscription to change.

Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "plan_id": "price_H8eIeMFwMawg6w"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "plan_id": {
      "type": "string",
      "description": "The new Stripe price plan ID."
    }
  },
  "required": [
    "plan_id"
  ]
}
Response  200
HideShow
Body
{
  "total": 5000,
  "sub_total": 4500
}
Schema
{
  "type": "object",
  "properties": {
    "total": {
      "type": "number",
      "description": "The total amount of the prorate invoice in the relevant currency's lowest denomination (e.g. pence)."
    },
    "sub_total": {
      "type": "number",
      "description": "The total amount of the prorate invoice minus tax in the relevant currency's lowest denomination (e.g. pence)."
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  401
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json

Stripe Preview Create Subscription Price

Stripe Preview Create Subscription Price
POST/zephr/payment/stripe/create-subscription-previews

Generate a preview of the total price and tax amount that Stripe will charge the customer if they create a new subscription for the specified plan.

Note: This method does not create any entities in Stripe and does not result in any payments being made.

Example URI

POST /zephr/payment/stripe/create-subscription-previews
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "product_id": "zephr-prod-1",
  "plan_id": "price_H8eIeMFwMawg6w",
  "promo_code": "discount15",
  "billing_country": "US",
  "billing_post_code": "90210"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "The ID of the new Zephr product."
    },
    "plan_id": {
      "type": "string",
      "description": "The new Stripe price plan ID."
    },
    "promo_code": {
      "type": "string",
      "description": "The Stripe promo code that will be attached to the subscription."
    },
    "billing_country": {
      "type": "string",
      "description": "The user's billing country, for tax calculation purposes."
    },
    "billing_post_code": {
      "type": "string",
      "description": "The user's billing postal code, for tax calculation purposes."
    }
  },
  "required": [
    "product_id",
    "plan_id"
  ]
}
Response  200
HideShow
Body
{
  "total": 5000,
  "sub_total": 4500,
  "tax": 500,
  "discount": 0
}
Schema
{
  "type": "object",
  "properties": {
    "total": {
      "type": "number",
      "description": "The total amount the user will be initially charged for the subscription in the relevant currency's lowest denomination (e.g. pence), i.e. for a monthly subscription, the first month's cost."
    },
    "sub_total": {
      "type": "number",
      "description": "The total amount minus tax for the initial charge in the relevant currency's lowest denomination (e.g. pence)."
    },
    "tax": {
      "type": "number",
      "description": "The tax amount for the initial charge in the relevant currency's lowest denomination (e.g. pence)."
    },
    "discount": {
      "type": "number",
      "description": "The discount amount for the initial charge in the relevant currency's lowest denomination (e.g. pence)."
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  400
HideShow
Headers
Content-Type: application/json

Deprecated

Start Stripe Subscription (Deprecated)
POST/blaize/payment/stripe/subscribe

(Deprecated - use /zephr/subscribe) Use the payment method info captured by the Stripe Elements UI to create a Stripe customer with a recurring payment. When Stripe responds successfully, the logged-in user will be temporarily granted all entitlements in the product’s associated bundle.

Example URI

POST /blaize/payment/stripe/subscribe
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "product_id": "premium-access-monthly-recurring",
  "payment_method": "pm_123456789"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "Product Id/slug"
    },
    "payment_method": {
      "type": "string",
      "description": "Payment method from Stripe Elements UI"
    }
  },
  "required": [
    "product_id",
    "payment_method"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "grant_id": "33d576c7-d036-40e7-8141-8a91998a5c79",
  "clientSecret": "src_client_secret_QfsM25CJ2uCMon72MiOmUNTj",
  "paymentIntentStatus": "requires_action | requires_payment_method"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "grant_id": {
      "type": "string",
      "description": "New grant of product bundle to user"
    },
    "clientSecret": {
      "type": "string",
      "description": "reference to Stripe payment required to process payment in front end"
    },
    "paymentIntentStatus": {
      "type": "string",
      "description": "status of the payment which may require further action"
    }
  }
}

Web Analytics

Get Datalayer

Get Datalayer
GET/blaize/datalayer

Get the datalayer object for the current session. All fields configured in the admin console will be resolved against the current session and returned

Example URI

GET /blaize/datalayer
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "dataLayer": [
    "[ {key1: value1}, {key2: value2} ]"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "dataLayer": {
      "type": "array",
      "description": "Resolved datalayer fields. Any fields that cannot be resolved will be present as fieldKey: null"
    }
  }
}

Product Sharing

Get Product Sharing Summary

Get Product Sharing Summary
GET/zephr/public/products/v1/shares

Get a summary of the products that the current user shares with other users, and products that are shared with the current user.

Example URI

GET /zephr/public/products/v1/shares
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "owned_products": [
    {
      "product_id": "product-1",
      "product_label": "Gold Product",
      "sharing_limit": 3,
      "shares": {
        "member_email": "name@domain.com",
        "sharing_id": "0nasdj-aso25-6454",
        "status": "active",
        "created_at": "2021-05-17T04:31:33Z"
      }
    }
  ],
  "member_products": [
    {
      "product_id": "product-1",
      "product_label": "Gold Product",
      "sharing_id": "0nasdj-aso25-6454",
      "status": "active",
      "shared_by_email": "owner-user@domain.com",
      "created_at": "2021-05-17T04:31:33Z",
      "meta_data": {}
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "owned_products": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "string",
            "description": "The ID of the product that is shared"
          },
          "product_label": {
            "type": "string",
            "description": "The label of the product that is shared"
          },
          "sharing_limit": {
            "type": "number",
            "description": "The maximum number of users that this product can be shared with by the owner"
          },
          "shares": {
            "type": "object",
            "properties": {
              "member_email": {
                "type": "string",
                "description": "The email of the user that this product is shared with. This will be null if this product share has not yet been accepted"
              },
              "sharing_id": {
                "type": "string",
                "description": "The ID of the user product share"
              },
              "status": {
                "type": "string",
                "description": "The status of the user product share. One of 'active', 'inactive', 'pending'"
              },
              "created_at": {
                "type": "string",
                "description": "ISO-8601 formatted time at which the share was created"
              }
            }
          }
        }
      }
    },
    "member_products": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "string",
            "description": "The ID of the product that is shared"
          },
          "product_label": {
            "type": "string",
            "description": "The label of the product that is shared"
          },
          "sharing_id": {
            "type": "string",
            "description": "The ID of the user product share"
          },
          "status": {
            "type": "string",
            "description": "The status of the user product share. One of 'active', 'inactive', 'pending'"
          },
          "shared_by_email": {
            "type": "string",
            "description": "The email of the product owner"
          },
          "created_at": {
            "type": "string",
            "description": "ISO-8601 formatted time at which the share was created"
          },
          "meta_data": {
            "type": "object",
            "properties": {},
            "description": "Any metadata configured for the user product share, defined at the point of creation"
          }
        }
      }
    }
  }
}

Delete User Product Sharing

Delete User Product Sharing
DELETE/zephr/public/products/v1/shares/{sharing_id}

Delete a user product share by ID. Pending invites and accepted shares can be deleted.

Invoking this method will increase the number of shares that the user has available for the given product. If the sharing_id represents an accepted product sharing, the member used will immediately lose access to the product that was shared with them (unless they have separately granted access to the same product). The member user will also receive an email notifying them that they have been removed from the product. This email is configurable in admin console.

Example URI

DELETE /zephr/public/products/v1/shares/0nasdj-aso25-6454
URI Parameters
HideShow
sharing_id
string (required) Example: 0nasdj-aso25-6454

The ID of the user product share to delete

Response  200
Response  404

Create Product Sharing Invite via Email

Create Product Sharing Invite via Email
POST/zephr/public/products/v1/shares/invitations/emails

Create a new user product share and send it via email. The exact contents of this email are configurable in the admin console. The email may include a link composed of the required attribute base_url and an additional path parameter sharing_id. It is expected that the specified base_url will direct invite recipients to a page that allows them to accept the invite and register/login. Custom metadata can also be passed to this method, which will be made available in the invitation email template and any later calls to access the publicly available share data. This metadata can be used, for example, to include the product owner’s first name and a personalised message that is shown to the recipient in the invitation email and in a screen that allows the recipient to accept the invite.

Invoking this method will reduce the number of shares that the user has available for the given product.

The specified product must be shareable, the current user must have active grants for the product and must not have already exceeded the configured maximum number of shares for the product.

Example URI

POST /zephr/public/products/v1/shares/invitations/emails
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "product_id": "product-1",
  "email_address": "name@domain.com",
  "base_url": "https://example.com/accept-invite"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "The ID of the product that is being shared"
    },
    "email_address": {
      "type": "string",
      "description": "The email address to send the invite to"
    },
    "base_url": {
      "type": "string",
      "description": "The invite link destination URL. The path parameter 'sharing_id=xxx' will be added to this URL. Other path parameters and anchors are accepted."
    },
    "meta_data": {
      "type": "object",
      "properties": {},
      "description": "Extra information for the user product share, which can be included in the sent email"
    }
  },
  "required": [
    "product_id",
    "email_address",
    "base_url"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "sharing_id": "0nasdj-aso25-6454"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "sharing_id": {
      "type": "string",
      "description": "The ID of the created product share"
    }
  },
  "required": [
    "sharing_id"
  ]
}
Response  400
Response  403
Response  409

Create Product Share Invite Token

Create Product Share Invite Token
POST/zephr/public/products/v1/shares/invitations/tokens

Create a new user product share. Invoking this method will reduce the number of shares that the user has available for the given product. The returned token sharing ID can later be passed to the accept invite method.

Custom metadata can also be passed to this method, which will be made available in later calls to access the publicly available share data. This metadata can be used, for example, to include the product owner’s first name and a personalised message that is shown to the recipient in a screen that allows the recipient to accept the invite.

Invoking this method will reduce the number of shares that the user has available for the given product.

The specified product must be shareable, the current user must have active grants for the product and must not have already exceeded the configured maximum number of shares for the product.

Example URI

POST /zephr/public/products/v1/shares/invitations/tokens
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "product_id": "product-1"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "The ID of the product that is being shared"
    },
    "meta_data": {
      "type": "object",
      "properties": {},
      "description": "Extra information for the user product share"
    }
  },
  "required": [
    "product_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "sharing_id": "0nasdj-aso25-6454"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "sharing_id": {
      "type": "string",
      "description": "The ID of the created product share"
    }
  },
  "required": [
    "sharing_id"
  ]
}
Response  400
Response  403
Response  409

Product Share Invites

Get Product Share Invite Public Data
GET/zephr/public/products/v1/shares/invitations/{sharing_id}

The publicly accessible data relating to a user product share invite. This can be used to inform the invitee of the details of the product that is being shared, and any meta_data added at the point of invite creation, such as the name of the user that sent the invite.

This endpoint is not authenticated. The information provided by this endpoint is available to anyone with a valid sharing_id. Invoking this endpoint too rapidly will result in a 429 error response.

Example URI

GET /zephr/public/products/v1/shares/invitations/0nasdj-aso25-6454
URI Parameters
HideShow
sharing_id
string (required) Example: 0nasdj-aso25-6454

The ID of the user product sharing invite

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "product_id": "product-1",
  "product_label": "Gold Product",
  "meta_data": {}
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "product_id": {
      "type": "string",
      "description": "The ID of the product that is shared"
    },
    "product_label": {
      "type": "string",
      "description": "The label of the product that is shared"
    },
    "meta_data": {
      "type": "object",
      "properties": {},
      "description": "Extra information for the user product share, defined at the point of creation"
    }
  }
}
Response  404
Response  429

Accept a Product Share Invite
PUT/zephr/public/products/v1/shares/invitations/{sharing_id}

Accept a product sharing invite. The current user will gain access to the product linked to the sharing invite. The user that send the invite must have an active grant for the product at the point of acceptance.

If the current user already has a product share for the same product from the same product owner, an error code 409 will be returned and the invite will not be accepted.

Example URI

PUT /zephr/public/products/v1/shares/invitations/0nasdj-aso25-6454
URI Parameters
HideShow
sharing_id
string (required) Example: 0nasdj-aso25-6454

The ID of the user product sharing invite

Response  200
Response  400
Response  404
Response  409

Sessions

Note: The ip attribute in the Session data structure is now deprecated and will be set to null in future responses.

List User Sessions

List User Sessions
GET/zephr/public/sessions/v1/sessions

Get a list of all sessions for the current user and site.

Example URI

GET /zephr/public/sessions/v1/sessions
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "aba22-a5mfh-",
    "startDate": "2011-11-11T11:11:11.000",
    "deviceType": "pc",
    "deviceName": "Google Nexus 5",
    "ip": "10.10.10.1",
    "browser": "Chrome",
    "os": "Android",
    "city": "Huston",
    "geoState": "Texas",
    "country": "USA",
    "isRequestingSession": true
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "description": "The ID of the session"
      },
      "startDate": {
        "type": "string",
        "description": "The creation date-time of the session"
      },
      "deviceType": {
        "type": "string",
        "description": "The type of device this session was created on"
      },
      "deviceName": {
        "type": "string",
        "description": "The name of the device this session was created on"
      },
      "ip": {
        "type": "string",
        "description": "The IP address this session was created from. This field is deprecated and will be set to null."
      },
      "browser": {
        "type": "string",
        "description": "The name of the browser that this session was created from"
      },
      "os": {
        "type": "string",
        "description": "The operating system of the device that this session was created from"
      },
      "city": {
        "type": "string",
        "description": "The name of the city that this session was created from"
      },
      "geoState": {
        "type": "string",
        "description": "The name of the state that this session was created from"
      },
      "country": {
        "type": "string",
        "description": "The name of the country that this session was created from"
      },
      "isRequestingSession": {
        "type": "boolean",
        "description": "True if this session is the session that made the request to this endpoint, otherwise false"
      }
    }
  }
}

Delete Sessions

Delete Session
DELETE/zephr/public/sessions/v1/sessions/{sessionId}

Delete a session by ID. Returns a 404 if the specified session does not exist or does not belong to the current user.

Example URI

DELETE /zephr/public/sessions/v1/sessions/0nasdj-aso25-6454
URI Parameters
HideShow
sessionId
string (required) Example: 0nasdj-aso25-6454

The ID of the session to delete

Response  200
Response  404

Delete All Other Sessions

Delete All Other Sessions
DELETE/zephr/public/sessions/v1/sessions?except-current

Delete all sessions for the current user and site apart from the session used to make the request.

Example URI

DELETE /zephr/public/sessions/v1/sessions?except-current
Response  200

V4 Gifts

Create a Gift resource for V4. Gifts can be used to provide access to a particular URL for one session only by appending a gift token ID to the URL as the ‘gift’ path parameter.

V4 Gifts

V4 Create Gift
POST/zephr/public/gift-tokens/v1/gift-tokens

Example URI

POST /zephr/public/gift-tokens/v1/gift-tokens
Request  with body
HideShow
Headers
Content-Type: application/json
Body
{
  "path": "/my-path"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "path": {
      "type": "string",
      "description": "The gift will be created for the provided path in the request body."
    }
  },
  "required": [
    "path"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "absd-acsd34-casdae-1243c",
  "claimPath": "/my-path?gift=absd-acsd34-casdae-1243c"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "description": "The token of the created gift."
    },
    "claimPath": {
      "type": "string",
      "description": "The path that was generated for claiming the gift."
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json

Component Library

Component Library

Components configured in the component library can be retrieved as rendered HTML. The formId passed in the path can be versioned to reference a specific version of a library component. For example, ‘payment-form:1’, ‘payment-form:4’ or ‘payment-form:active’ to reference the default version of the component.

Component Library
GET/zephr/public/component-library/v1/library-components/:componentId

Example URI

GET /zephr/public/component-library/v1/library-components/:componentId
Response  200
HideShow
Headers
Content-Type: text/html
Response  400
HideShow
Headers
Content-Type: application/json

Template Components

Template components can be retrieved as rendered HTML. This endpoint is intended to be consumed by callers processing the output of an SDK TRANSFORMATION rule, where templateConfigId will identify a particular instance of a template component being used in an outcome with variables specified.

Template Components
GET/zephr/public/template-components/v1/template-components/:templateConfigId

Example URI

GET /zephr/public/template-components/v1/template-components/:templateConfigId
Response  200
HideShow
Headers
Content-Type: text/html
Response  400
HideShow
Headers
Content-Type: application/json

UI Components

UI components can be retrieved as rendered HTML. This endpoint is intended to be consumed by callers processing the output of an SDK TRANSFORMATION rule, where componentId will reference a form or custom component created within an outcome of a rule.

UI Components
GET/zephr/public/ui-components/v1/ui-components/:componentId

Example URI

GET /zephr/public/ui-components/v1/ui-components/:componentId
Response  200
HideShow
Headers
Content-Type: text/html
Response  400
HideShow
Headers
Content-Type: application/json

Forms

Forms can be retrieved as rendered HTML. This endpoint is intended to be consumed by callers processing the output of an SDK TRANSFORMATION rule, where formId will reference a form used in the outcome of a rule.

Forms
GET/zephr/public/forms/v1/forms/:formId

Example URI

GET /zephr/public/forms/v1/forms/:formId
Response  200
HideShow
Headers
Content-Type: text/html
Response  400
HideShow
Headers
Content-Type: application/json

Custom Templates

Custom Templates (Internal Templates) [/zephr/public/internal-templates/v1/internal-templates/:internalTemplateId]

Custom Templates can be retrieved as rendered HTML. The internalTemplateId is a unique identifier used to reference a specific custom template.

Custom Templates [GET]

  • Response 200 (text/html)

  • Response 400 (application/json)

Generated by aglio on 22 Sep 2023