Getting started

Getting started with Indexing of content

An external sale is a way for 3rd parties to inform user purchases to the Sesamy platform so we can give access to the external purchasing users to the entitlements they purchased (normally a subscription that consists of one or more products). This is known in our system as a “contract”. Each contract consists of a sub-set of products, a duration and some payment methods.

Initial Configuration

We will set up different base contracts for you based on a specific promo code that you provide. Those base contracts will contain common data that you can define so you don’t have to send it every time you want to create a new contract.

Once the promo codes have been set up you can call the “New Contract Endpoint” below to create a new contract for a specific user.

API Access (Authorization)

To access our API you will be given a client ID a client secret. Use those to get an access token using the following request. Once you obtain an access token you must send it as a Bearer “YOUR_TOKEN” on each request.

POST https://token.sesamy.com/oauth/token
Content-Type: application/json
{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET",
  "grant_type":"client_credentials",
  "scope": "payments:contract:third-party-onboarding"
}

New Contract Endpoint

To create a new contract call the following endpoint. vendorId is the ID you were given when you signed up to Sesamy and promoCode is one of the codes that have been set up in the previous step.

You can send the confirm query param to 1 if you want to confirm the contract immediately. If you don’t want to confirm right away, you can call the next endpoint to confirm it later.

POST https://api.sesamy.com/payments/vendor/{vendorId}/promos/code/{promoCode}?confirm=false
Content-Type: application/json

{
  "externalOrderId": "string", // An ID to identify your order from your system
  "paymentProvider": "KLARNA", // KLARNA,STRIPE,BILLOGRAM,SESAMY
  "paymentMethod": "BANKGIRO", // BANKGIRO,EXTERNAL,INVOICE,SWISH,CARD,FREE
  "quantity": 1, // The amount of items (normally 1)
	"vendorData": { // Extra vendor data that you want to send (optional)
    "additionalProp3": "string"
  },
	"providerData": { // Any extra provider payment data you want to send (optional)
    "additionalProp3": "string"
  },
  "userData": {
    "extraData": { // Any extra data you want to save for this user
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "gender": "string", // 'male' | 'female' | 'other'
    "birthday": "string", // User birthday as a ISO string
    "address": { // User address
      "country": "string",
      "zip": "string",
      "city": "string",
      "street": "string",
      "co": "string",
      "lastName": "string",
      "firstName": "string"
    },
    "businessDetails": { // User business details (optional)
      "vatNr": "string",
      "companyName": "string"
    },
    "phone": "string",
    "fullName": "string",
    "invoiceEmail": "string", // Extra email (optional)
    "email": "string", // User email that the contract will be associated with
  },
	"ownerData": { // In case the owner is different than the payer user (optional)
    "extraData": { // Any extra data you want to save for this user
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "gender": "string", // 'male' | 'female' | 'other'
    "birthday": "string", // User birthday as an ISO string
    "address": { // User address
      "country": "string",
      "zip": "string",
      "city": "string",
      "street": "string",
      "co": "string",
      "lastName": "string",
      "firstName": "string"
    },
    "businessDetails": { // User business details (optional)
      "vatNr": "string",
      "companyName": "string"
    },
    "phone": "string",
    "fullName": "string",
    "invoiceEmail": "string", // Extra email (optional)
    "email": "string", // User email that the contract will be associated with
  }
}

The response will be a “contract” JSON containing the information about the contract and an ID that identifies that contract.

Confirm Contract Endpoint

To confirm a contract call this endpoint with vendorId value you have obtained in the previous endpoint response.

POST https://api.sesamy.com/payments/vendor/{vendorId}/promos/code/{promoCode}/confirm/{contractId}
Content-Type: application/json

{
	"providerPaymentData": { // Any extra provider payment data you want to send (optional)
    "additionalProp3": "string"
  }
}

This will confirm the contract and give the user access to the entitlements.

Did this answer your question?
😞
😐
🤩