Membership Transactions

Membership transactions represent points added or deducted from a customer's membership program.

Base URL: https://memberships.vivenu.com/api

POST/api/transactions

Create transaction

Creates a new transaction

Payload

Required attributes

  • Name
    amount
    Type
    integer
    Description
  • Name
    customerId
    Type
    string
    Description
  • Name
    programId
    Type
    string
    Description

Optional attributes

  • Name
    description
    Type
    string
    Description
  • Name
    meta
    Type
    object
    Description
  • Name
    sellerId
    Type
    string
    Description

Request

POST
/api/transactions
const response = await fetch('https://memberships.vivenu.com/api/transactions', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer {token}',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(  {
    "amount": 1,
    "customerId": "507f191e810c19729de860ea",
    "programId": "507f191e810c19729de860ea",
    "description": "string",
    "meta": {},
    "sellerId": "507f191e810c19729de860ea"
  }),
})

const data = await response.json()

Response (200)

{
  "_id": "507f191e810c19729de860ea",
  "amount": 1,
  "createdAt": "2030-01-23T23:00:00.123Z",
  "customerId": "507f191e810c19729de860ea",
  "description": "string",
  "membershipId": "507f191e810c19729de860ea",
  "meta": {},
  "programId": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "updatedAt": "2030-01-23T23:00:00.123Z"
}

Was this page helpful?