Billing API (2019-08-31)

API Integration Support: integration@dintero.com License: UNLICENSED

Changelog

All notable changes to the API.

2020-12-01

new Support filter user payout rules with include_deleted query parameter.

2020-05-01

Payout Rules Add new endpoint for managing Payout rules.

Authentication

JWT

Bearer authentication (also called token authentication) should be used when accessing the API.

Use Get Token to get an access token for client credentials

Authorization by using the Bearer schema The content of the header should look like the following:

Authorization: Bearer {access_token}

where the access_token is JSON Web Tokens (JWT).

Security Scheme Type API Key
Header parameter name: Authorization

reports

List costs

Get the costs aggregated by periode

scopes:

  • admin:billing
  • read:billing
Authorizations:
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

query Parameters
year
required
integer

filter result by year, example: 2019

month
required
integer [ 1 .. 12 ]

filter result by month, example: 8

limit
integer [ 1 .. 1000 ]
Default: 100

A limit on the number of objects to be returned. Limit can range between 1 and 100 items, and the default is 10 items.

starting_after
string

cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

type
string

filter result by cost type, example: checkout/capture

date
string <date>

filter result by date, requires to be combined with type parameter

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List reports

Get billing reports

scopes:

  • admin:billing
  • read:billing
Authorizations:
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

query Parameters
limit
integer [ 1 .. 1000 ]
Default: 100

A limit on the number of objects to be returned. Limit can range between 1 and 100 items, and the default is 10 items.

starting_after
string

cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

Responses

Response samples

Content type
application/json
{
  • "starting_after": "string",
  • "reports": [
    ]
}

Rules

List payout rules

Get payout rules

scopes:

  • admin:billing
  • read:billing
Authorizations:
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

query Parameters
limit
integer [ 1 .. 1000 ]
Default: 100

A limit on the number of objects to be returned. Limit can range between 1 and 100 items, and the default is 10 items.

starting_after
string

cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

rule_type
string

Filter payment rules by rule_type

rule_id
string

Filter payment rules by rule_id. Must be used together with rule_type.

include_deleted
boolean
Default: false

include deleted payout rules in the response

Responses

Response samples

Content type
application/json
{
  • "starting_after": "string",
  • "payout_rules": [
    ]
}

Create payout rule

Create payout rules

scopes:

  • admin:billing
  • write:billing
Authorizations:
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

Request Body schema: application/json

New payout rule

rule_id
required
string

Unique ID given the rule type.

rule_type
required
string
required
Array of objects (BillingPayoutRuleDestination)

Destinations for the payout splits tree. The splitting is done in the order of the destinations.

  • A destination must include a destination or destinations.
  • The destination value is required for destinations with type percentage and flat_amount
metadata
object

Additional metadata about the payout rule

Responses

Request samples

Content type
application/json
{
  • "rule_type": "order.items.store.id",
  • "rule_id": "sc029",
  • "destinations": [
    ],
  • "metadata": { }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "created_by": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "account_id": "string",
  • "rule_type": "order.items.store.id",
  • "rule_id": "sc029",
  • "rule_version": 1,
  • "destinations": [