Billings

A service which allows to manage tariffs, billing automation and Xero integration.

List participant tariffs

Show participant doc with all tariffs

GET /billing-service/tariff/:participant
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
participant params Required: Participant (urn format)
Example req
GET '/billing-service/tariff/urn:authenticateit:participant:1'
Example Response
{
  "value": {
    "_id": "urn:authenticateit:participant:1@tariffs",
    "tariffs": [
      {
        "id": "ffb7c613-4b18-40fe-aa9d-afa28f5ec401",
        "starts_at": "2022-01-01T00:00:00.000Z",
        "created_at": "2021-12-20T12:30:10.532Z",
        "updated_at": "2021-12-20T12:32:12.132Z",
        "events": [
          {
            "event": 2,
            "value": 0.3
          },
          {
            "event": 3,
            "value": 0.3
          },
          {
            "event": 5,
            "value": 0.3
          },
          {
            "event": 7,
            "value": 0.3
          },
          {
            "event": 10,
            "value": 0.4
          },
          {
            "event": 11,
            "value": 0.35
          },
          {
            "event": 12,
            "value": 0.3
          },
          {
            "event": 15,
            "value": 0.03
          },
          {
            "event": 16,
            "value": 0.03
          },
          {
            "event": 17,
            "value": 0.03
          },
          {
            "event": 44,
            "cashback_transaction_fee": 0.45,
            "handling_fee": 0.3
          }
        ]
      },
      {
        "id": "aa9f6310-03c2-43a2-a138-175e908de745",
        "created_at": "2021-12-20T18:30:55.632Z",
        "updated_at": "2021-12-20T19:02:27.304Z",
        "starts_at": "2021-10-20T17:40:43.788Z",
        "events": [
          {
            "event": 44,
            "cashback_transaction_fee": 1.1,
            "handling_fee": 0.3
          },
          {
            "event": 13,
            "value": 0.5
          }
        ]
      }
    ],
    "type": "participant_tariffs"
  }
}

Get participant tariff

Shows exact participant tariff

GET /billing-service/tariff/:participant/:tariff_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
participant params Required: Participant (urn format)
tariff_id params Required: Tariff id (uuid)
Example req
GET '/billing-service/tariff/urn:authenticateit:participant:1/ffb7c613-4b18-40fe-aa9d-afa28f5ec401'
Example Response
{
  "value": {
    "id": "ffb7c613-4b18-40fe-aa9d-afa28f5ec401",
    "starts_at": "2022-01-01T00:00:00.000Z",
    "created_at": "2021-12-20T12:30:10.532Z",
    "updated_at": "2021-12-20T12:32:12.132Z",
    "events": [
      {
        "event": 2,
        "value": 0.3
      },
      {
        "event": 3,
        "value": 0.3
      },
      {
        "event": 5,
        "value": 0.3
      },
      {
        "event": 7,
        "value": 0.3
      },
      {
        "event": 10,
        "value": 0.4
      },
      {
        "event": 11,
        "value": 0.35
      },
      {
        "event": 12,
        "value": 0.3
      },
      {
        "event": 15,
        "value": 0.03
      },
      {
        "event": 16,
        "value": 0.03
      },
      {
        "event": 17,
        "value": 0.03
      },
      {
        "event": 44,
        "cashback_transaction_fee": 0.45,
        "handling_fee": 0.3
      }
    ]
  }
}

Create tariff

Create new participant tariff

POST /billing-service/tariff/:participant
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
participant params Required: Participant (urn format)
starts_at body Required: Date when new tariff starts (ISO Format)
events body Optional: Array of objects
Events structure
events: [
    {
        event:  number, required
        value: number
        cashback_transaction_fee: number
        handling_fee: number
    }
]
Example req body
{
    "starts_at": "2021-12-20T17:40:43.788Z",
    "events": [
        {
            "event": 44,
            "cashback_transaction_fee": 1.1,
            "handling_fee": 0.3
        },
        {
            "event": 13,
            "value": 0.5
        }
    ]
}
Example Response
{
  "value": {
    "id": "2dbe7901-9dbb-4a0f-bae5-e8f5ecf7f37f",
    "created_at": "2021-12-21T15:34:45.526Z",
    "updated_at": "2021-12-21T15:34:45.526Z",
    "starts_at": "2021-12-20T17:40:43.788Z",
    "events": [
      {
        "event": 44,
        "cashback_transaction_fee": 1.1,
        "handling_fee": 0.3
      },
      {
        "event": 13,
        "value": 0.5
      }
    ]
  }
}

Update participant tariff

Updates participant tariff

PATCH /billing-service/tariff/:participant/:tariff_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
participant params Required: Participant (urn format)
tariff_id params Required: Tariff id (uuid)
starts_at body Optional: Date when new tariff starts (ISO Format)
events body Optional: Array of objects
Events structure
events: [
    {
        event:  number, required
        value: number
        cashback_transaction_fee: number
        handling_fee: number
    }
]
Example req body
{
    "events": [
        {
            "event": 44,
            "cashback_transaction_fee": 1.1,
            "handling_fee": 0.3
        },
        {
            "event": 13,
            "value": 0.5
        }
    ]
}
Example Response
{
  "value": {
    "id": "aa9f6310-03c2-43a2-a138-175e908de745",
    "created_at": "2021-12-20T18:30:55.632Z",
    "updated_at": "2021-12-21T15:44:33.875Z",
    "starts_at": "2021-10-20T17:40:43.788Z",
    "events": [
      {
        "event": 44,
        "cashback_transaction_fee": 1.1,
        "handling_fee": 0.3
      },
      {
        "event": 13,
        "value": 0.5
      }
    ]
  }
}

Delete participant tariff

Removes participant tariff from doc.

DELETE /billing-service/tariff/:participant/:tariff_id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
participant params Required: Participant (urn format)
tariff_id params Required: Tariff id (uuid)
Example req
GET '/billing-service/tariff/urn:authenticateit:participant:1/aa9f6310-03c2-43a2-a138-175e908de745'
Example Response
{
  "value": {
    "_id": "urn:authenticateit:participant:1@tariffs",
    "tariffs": [
      {
        "id": "ffb7c613-4b18-40fe-aa9d-afa28f5ec401",
        "starts_at": "2022-01-01T00:00:00.000Z",
        "created_at": "2021-12-20T12:30:10.532Z",
        "updated_at": "2021-12-20T12:32:12.132Z",
        "events": [
          {
            "event": 2,
            "value": 0.3
          },
          {
            "event": 3,
            "value": 0.3
          },
          {
            "event": 5,
            "value": 0.3
          },
          {
            "event": 7,
            "value": 0.3
          },
          {
            "event": 10,
            "value": 0.4
          },
          {
            "event": 11,
            "value": 0.35
          },
          {
            "event": 12,
            "value": 0.3
          },
          {
            "event": 15,
            "value": 0.03
          },
          {
            "event": 16,
            "value": 0.03
          },
          {
            "event": 17,
            "value": 0.03
          },
          {
            "event": 44,
            "cashback_transaction_fee": 0.45,
            "handling_fee": 0.3
          }
        ]
      },
      {
        "id": "aa9f6310-03c2-43a2-a138-175e908de745",
        "created_at": "2021-12-20T18:30:55.632Z",
        "updated_at": "2021-12-21T15:46:11.383Z",
        "starts_at": "2021-10-20T17:40:43.788Z",
        "events": [
          {
            "event": 44,
            "cashback_transaction_fee": 1.1,
            "handling_fee": 0.3
          },
          {
            "event": 13,
            "value": 0.5
          }
        ]
      },
      {
        "id": "2dbe7901-9dbb-4a0f-bae5-e8f5ecf7f37f",
        "created_at": "2021-12-21T15:34:45.526Z",
        "updated_at": "2021-12-21T15:34:45.526Z",
        "starts_at": "2021-12-20T17:40:43.788Z",
        "events": [
          {
            "event": 44,
            "cashback_transaction_fee": 1.1,
            "handling_fee": 0.3
          },
          {
            "event": 13,
            "value": 0.5
          }
        ]
      }
    ],
    "type": "participant_tariffs"
  }
}

results matching ""

    No results matching ""